ucscXena / XenaGoWidget

Xena Gene Set Viewer (demo: http://xenademo.berkeleybop.io/xena)
https://xenageneset.berkeleybop.io/xena/
BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

fix gene sample order, fix pathway and gene sample color - validate a custom GMT using Default to make sure it is the same #684

Closed nathandunn closed 3 years ago

nathandunn commented 3 years ago

nathandunn commented 3 years ago

Using defaultBAGeneSetsSample1_reordered (and plain) .

nathandunn commented 3 years ago

Pathway scores are the same for pathways minus a small rounding error. Visually, the sample pathway

image

image

nathandunn commented 3 years ago

Using a smaller sample size:

image

Need to create another BPA GMT file

nathandunn commented 3 years ago

Using a smaller set:

RLF_tf_targets      RALA    EPHB2   SMN1
MELK_tf_targets     MELK    CDC25B
DCP1A_tf_targets        GABPA   GATA2
ERV3_tf_targets     NFYA    NFYB    TAL1    GATA2
nathandunn commented 3 years ago

image

nathandunn commented 3 years ago

image

image

nathandunn commented 3 years ago

http://localhost:3000/#cohort1=TCGA%20Colon%20Cancer%20(COAD)&cohort2=TCGA%20Prostate%20Cancer%20(PRAD)&filter=BPA%20Gene%20Expression&geneset=RLF_tf_targets&genesetOpen=true&selectedSubCohorts1=GI.HM-SNV&selectedSubCohorts2=PRAD.7-IDH1&geneSetLimit=45&sortViewByLabel=Differential

nathandunn commented 3 years ago

The color with the hover data is consistent with the colors shown

nathandunn commented 3 years ago

The coloring error is because the maxValue is different for both sets due to the size. In the vertical gene set array, we are using:

function calculateColorArray(maxValue,score){
  const key = maxValue+'::'+score
  if(!colorArrayGeneExpressionCache[key]){
    colorArrayGeneExpressionCache[key] = getColorArray(interpolateGenesetScoreFunction(maxValue )(score))
  }
  return colorArrayGeneExpressionCache[key]
}

... 

export const interpolateGenesetScoreFunction = max => {
  if(!interpolationTable[max]){
    interpolationTable[max] = d3.scaleLinear().domain([-max,0,max]).range(['blue','white','red']).interpolate(d3.interpolateRgb)
  }
  return interpolationTable[max]
}

However, the other ones all use:

export let interpolateGeneExpression = (score) => score==='NaN' ? 'gray' : interpolateGeneExpressionFunction(score)

So, we can either use a "max" that uses 2 all the time, or use the max scale, which we already indicate. The latter is most likely better.

nathandunn commented 3 years ago

In the "working" samples it goes: 23, 72, 25

image

in the non-working, it goes: 25, 23, 72

image

However, they seems to be aligned properly. On both sides.

nathandunn commented 3 years ago

nathandunn commented 3 years ago

Using defaultBPAGeneSetSample3, we can look at a much smaller set (only 2 gene sets) to evaluate differences in sample order:

MYST2_tf_targets        YY1 THAP1   NR3C1   KLK3
HIP1_tf_targets     NR3C1   PBX3    KLK3

for:

image