-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Genie fusion issue 5613 #2311
Genie fusion issue 5613 #2311
Conversation
3da8ed2
to
e30419a
Compare
e30419a
to
470665b
Compare
@@ -271,8 +271,8 @@ export default class LollipopMutationPlot extends React.Component<ILollipopMutat | |||
|
|||
@computed private get domainMap(): {[pfamAccession:string]: PfamDomain} | |||
{ | |||
if (!this.props.store.pfamDomainData.isPending && | |||
this.props.store.pfamDomainData.result && | |||
if (!this.props.store.pfamDomainData.isPending && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets revert this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted.
@@ -1054,6 +1056,9 @@ export class StudyViewPageStore { | |||
case ChartTypeEnum.MUTATED_GENES_TABLE: | |||
this.resetGeneFilter(); | |||
break; | |||
case ChartTypeEnum.FUSION_GENES_TABLE: | |||
this.resetGeneFilter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just confirming that we don't have separate FusionGene filter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do not. Fusions are not properly tracked in the database at the moment. This is really a temporary solution to address GENIE study mutations over counting problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update: discussed with @zhx828, added a new gene filter for fusions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be resetFusionGeneFilter
right?
readonly fusionGeneData = remoteData<FusionGenesData>({ | ||
await: () => [this.mutationProfiles], | ||
invoke: async () => { | ||
if (!_.isEmpty(this.mutationProfiles.result!)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not too important, but you might not have to use ! after result here. one would think that isEmpty typing would accept undefined since it's meant to test for undefined (among other things).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. thanks for pointing this out. Will remove !.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
! removed.
await: () => [this.mutationProfiles], | ||
invoke: async () => { | ||
if (!_.isEmpty(this.mutationProfiles.result!)) { | ||
// TODO: get data for all profiles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if i understand the TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I forgot too. It has been really a while, will back to you later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove these TODOs. I placed there as a reminder for a feature which should be transferred to a proper issue on github.
class FusionGenesTableComponent extends FixedHeaderTable<MutationCountByGene> { | ||
} | ||
|
||
@observer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JJ, @alisman, @zhx828,
how will fusion table be displayed once structure variant PR merged in, will still be as same as mutation table?
I am re-thinking how to address Aaron's above comment to factor gene tables. CNAGenesTable and MutationGenesTable are a bit different since we have cytobands and alterations in the CNAGenesTable, while have Frequencies in the MutationGenesTable, makes sense to give them their own tables. But new fusionGenesTable is merely a copy of Mutation table, since it does not have its own data model at the moment. If FusionGenesTable is always as same as MutationGenesTable, it will make more sense to have a super class for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khzhu we may keep it the same way after using the SV table for the first iteration. In the long run, we may want to to find a way to display the partner genes, but let's not worry about it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alisman these tables are using the same component FixedHeaderTable. There is no much of space to create a super class for these study view tables since they are highly customized. But I do think there are more space to move some of the functions to utils so they can be shared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved some common interface/type to TabUtil file for share.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alisman I merged three tables to one component. It's not a super class, since we already using FixedHeaderTable. Essentially, it's just a util component including all the column definitions.
|
||
@autobind | ||
@action | ||
updateCellMargin() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like it could be shared b/c there's nothing implementation specific. or is there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer use updateCellMargin().
470665b
to
8bd80f8
Compare
9ccc847
to
19d0ab8
Compare
19d0ab8
to
8b5e6bd
Compare
@@ -2743,13 +2829,40 @@ export class StudyViewPageStore { | |||
default: [] | |||
}); | |||
|
|||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why Kelsey added this. I'm looking into
@@ -77,6 +78,7 @@ export enum ChartTypeNameEnum { | |||
TABLE = 'table', | |||
SCATTER = 'density plot', | |||
MUTATED_GENES_TABLE = 'table', | |||
FUSION_GENES_TABLE = 'table', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to me - Need to update study page setting api to support FUSION_GENES_TABLE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1054,6 +1056,9 @@ export class StudyViewPageStore { | |||
case ChartTypeEnum.MUTATED_GENES_TABLE: | |||
this.resetGeneFilter(); | |||
break; | |||
case ChartTypeEnum.FUSION_GENES_TABLE: | |||
this.resetGeneFilter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be resetFusionGeneFilter
right?
@@ -1236,6 +1292,9 @@ export class StudyViewPageStore { | |||
case ChartTypeEnum.MUTATED_GENES_TABLE: | |||
this.resetGeneFilter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be rename it to resetMutatedGeneFilter
src/pages/studyView/TableUtils.tsx
Outdated
<Else> | ||
<DefaultTooltip | ||
placement="right" | ||
disabled={type === 'fusion'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't be rendered when type === 'fusion'
src/pages/studyView/TableUtils.tsx
Outdated
} | ||
|
||
export function rowIsChecked(entrezGeneId:number, preSelectedRows:AlteredGenesTableUserSelectionWithIndex[], selectedRows:AlteredGenesTableUserSelectionWithIndex[]) { | ||
const record = _.find( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not do find in preSelectedRows
and selectedRows
together?
src/pages/studyView/TableUtils.tsx
Outdated
} | ||
|
||
export function rowIsDisabled(entrezGeneId: number, selectedRows:AlteredGenesTableUserSelectionWithIndex[]) { | ||
return !_.isUndefined( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be !!_.find(...
instead of !_.isUndefined(
3db6445
to
84702e7
Compare
a8af10d
to
bda73f3
Compare
</Modal> | ||
); | ||
} else { | ||
return <span />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null?
b2467cb
to
088741e
Compare
|
||
@computed | ||
get tableColumns() { | ||
return _.reduce(this.props.columns, (acc, column) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use map
@@ -768,6 +769,18 @@ export class StudyViewPageStore { | |||
}, [] as MutationGeneFilter[]); | |||
} | |||
|
|||
if (_.isArray(filters.fusionGenes) && filters.fusionGenes.length > 0) { | |||
this._fusionGeneFilter = _.reduce(filters.fusionGenes, (acc, next) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can see that this logic follows pattern of existing blocks in use of _.reduce, but worth noting that these reduces are really mapping operations. would be more semantic to use map. reduce should only be used if there's a conditional inclusion (filter would also work) or if we're producing a map from an array. also, we can now use native reduce, map, filter methods of array object. lodash unnecessary in these cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alisman Won't the map alter the original array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it was for another scenario. In this case, it will not. Will update. Thanks.
|
||
@autobind | ||
@action | ||
removeFusionGeneFilter(toBeRemoved: number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toBeRemoved = entrezIdToBeRemoved
@@ -2397,6 +2470,18 @@ export class StudyViewPageStore { | |||
}; | |||
} | |||
|
|||
if (!_.isEmpty(this.mutationProfiles.result)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just want to double check that this is the right condition for including fusion table? (mutationProfiles not empty which is used by MUTATED_GENES_TABLE as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alisman , that is only way but not a right way, I totally agree. We do not have a dedicate profiling type for fusions at the moment, since fusions are currently treated as one type of mutations and recorded in the mutation table. This will eventually be fixed once we move fusions out from the mutation table and stored in the structure variants table. Fusions are indeed a type of structure variants, when two genes fussed and formed a new gene. Hope this makes sense.
@@ -2602,6 +2689,8 @@ export class StudyViewPageStore { | |||
|
|||
if (chartUserSettings.chartType === UniqueKey.MUTATED_GENES_TABLE) { | |||
this._filterMutatedGenesTableByCancerGenes = chartUserSettings.filterByCancerGenes === undefined ? true : chartUserSettings.filterByCancerGenes; | |||
} else if (chartUserSettings.chartType === UniqueKey.FUSION_GENES_TABLE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like this if else if else structure should really be a switch statement.
let mutatedGenes = await internalClient.fetchMutatedGenesUsingPOST({ | ||
studyViewFilter: this.filters | ||
}); | ||
return mutatedGenes.map(item => { | ||
return { | ||
...item, | ||
uniqueKey: getMutationUniqueKey(item.entrezGeneId, item.hugoGeneSymbol), | ||
oncokbAnnotated: this.oncokbCancerGeneFilterEnabled ? this.oncokbAnnotatedGeneEntrezGeneIds.result.includes(item.entrezGeneId) : false, | ||
oncokbOncogene: this.oncokbCancerGeneFilterEnabled ? this.oncokbOncogeneEntrezGeneIds.result.includes(item.entrezGeneId) : false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if these values are boolean, i think the names should reflect it. e.g. isOncoKBOncogene
@@ -3023,19 +3148,19 @@ export class StudyViewPageStore { | |||
default: [] | |||
}); | |||
|
|||
readonly cnaGeneData = remoteData<CopyNumberCountByGeneWithCancerGene[]>({ | |||
readonly cnaGeneData = remoteData<GeneTableRow[]>({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a TableRow in the sense of a database row or a table row? If the latter, i think name of the promise (cnaGeneData) should reflect that. "cnaGeneTableRowData"
src/pages/studyView/TableUtils.tsx
Outdated
/> | ||
</span> | ||
); | ||
|
||
function getCellContent() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinda strange pattern here. uses style variable from closure. i would rather just see this inside of the markup as it was
@@ -40,7 +40,7 @@ export interface IChartHeaderProps { | |||
chartControls? : ChartControls; | |||
changeChartType : (chartType: ChartType) => void; | |||
getSVG? : ()=>Promise<SVGElement | null>; | |||
getData? : (dataType?:DataType)=>Promise<string | null>; | |||
getData? : ((dataType?:DataType)=>Promise<string | null>) | ((dataType?:DataType)=>string); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm curious why? seems like code will now have to check whether it's a promise or not, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what's the best way here. There are some getData methods don't require a promise to produce the data. If we don't provide the second type, then these methods have to attach an async tag.
</Modal.Footer> | ||
</Modal> | ||
); | ||
if (this.props.genePanelCache) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems more natural to do this outside of the modal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update. I guess the original implementer was trying to avoid additional checks which have been used in three components. But now we merge these three together, so we should do the check at the place where initialize the component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments
b72676d
to
1e63aec
Compare
d42bd12
to
069aa63
Compare
…s table to study view address code review comments Include fusion filter in the UserSelection & minor changes - Assign priority 85 to Fusion Genes table - Fusion Genes table does not need to show panel info Add a test to cover the fusion filter Include CNA cancer gene toggle in session service Add gene panel tooltip for fusions table & Save fusion cancer gene filter in user setting Consolidate three tables to one component which share most of the functionality Signed-off-by: Hongxin Zhang <hongxin@cbio.mskcc.org> Fetch genes info when the filter from url that not in the cache
069aa63
to
62f1bf5
Compare
The two coexpression tests on master env just impossible to finish. Need to double check before merging back to master |
Genie fusion issue 5613
What? Why?
Fix #
Decouple fusions from mutations should fix the issue.
Changes proposed in this pull request:
Checks
can be automatically added by git if you run the
git-commit
command withthe
-s
option)Any screenshots or GIFs?
If this is a new visual feature please add a before/after screenshot or gif
here with e.g. GifGrabber.
Notify reviewers
Read our Pull request merging
policy. If you are part of the
cBioPortal organization, notify the approprate team (remove inappropriate):
@cBioPortal/frontend
If you are not part of the cBioPortal organization look at who worked on the
file before you. Please use
git blame <filename>
to determine thatand notify them here: