114bd9cc108feeb8b20ad0b98b35454ea3fde8e0 kate Mon May 2 11:45:50 2016 -0700 Add details page info to show highest expressed tissue with scores. refs #17244 diff --git src/hg/lib/gtexGeneBed.c src/hg/lib/gtexGeneBed.c index 5f0d4ad..1b3348b 100644 --- src/hg/lib/gtexGeneBed.c +++ src/hg/lib/gtexGeneBed.c @@ -275,15 +275,33 @@ boolean gtexGeneIsCoding(struct gtexGeneBed *geneBed) /* Return TRUE if biotype indicates this is a protein coding gene */ { return sameString("coding", gtexGeneClass(geneBed)); } float gtexGeneTotalMedianExpression(struct gtexGeneBed *geneBed) /* Return total of all tissue medians */ { int i; float sum = 0.0; for (i=0; iexpCount; i++) sum += geneBed->expScores[i]; return sum; } + +float gtexGeneHighestMedianExpression(struct gtexGeneBed *geneBed, int *tissueIdRet) +/* Return tissue median and id of tissue with highest expression of this gene */ +{ +int i; +float maxScore = 0.0; +assert(tissueIdRet); +for (i=0; iexpCount; i++) + { + float score = geneBed->expScores[i]; + if (score > maxScore) + { + maxScore = score; + *tissueIdRet = i; + } + } +return maxScore; +}