Skip to content
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

Merged
merged 1 commit into from
Oct 12, 2019

Conversation

khzhu
Copy link

@khzhu khzhu commented May 13, 2019

What? Why?

Fix #

Decouple fusions from mutations should fix the issue.

Changes proposed in this pull request:

  • add a new Fusion table without Frequency column in the study view to show all fusions currently recorded in the mutation database table.

Checks

  • Is this PR adding logic based on one or more clinical attributes? If yes, please make sure validation for this attribute is also present in the data validation / data loading layers (in backend repo) and documented in File-Formats Clinical data section!
  • Follows 7 rules of great commit messages. For most PRs a single commit should suffice, in some cases multiple topical commits can be useful. During review it is ok to see tiny commits (e.g. Fix reviewer comments), but right before the code gets merged to master or rc branch, any such commits should be squashed since they are useless to the other developers. Definitely avoid merge commits, use rebase instead.
  • Follows the Airbnb React/JSX Style guide.
  • Make sure your commit messages end with a Signed-off-by string (this line
    can be automatically added by git if you run the git-commit command with
    the -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 that
and notify them here:

@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch from 3da8ed2 to e30419a Compare May 13, 2019 19:49
@khzhu khzhu requested review from zhx828 and alisman May 13, 2019 19:52
@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch from e30419a to 470665b Compare May 14, 2019 21:21
@@ -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 &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets revert this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do.

Copy link
Author

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();
Copy link
Collaborator

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?

Copy link
Author

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.

Copy link
Author

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.

Copy link
Member

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!)) {
Copy link
Collaborator

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).

Copy link
Author

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 !.

Copy link
Author

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
Copy link
Collaborator

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

Copy link
Author

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.

Copy link
Member

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khzhu @zhx828 Just for discusion but do you think there's opportunity for reusing more code (super class?) between these different table types? i would say we should do it only if it's obvious that we're copying and pasting a lot. Or if there are going to be a lot more table types.

Copy link
Author

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.
Screen Shot 2019-08-19 at 5 42 39 PM

Copy link
Member

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, @JJ.
I vote for having FusionGenesTable by its own for the future so we could easily add partner genes and possible remove Freq coloumn(do not think is useful). What do you think @alisman?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here are three tables side by side
Screen Shot 2019-08-20 at 11 54 06 AM

Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

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() {
Copy link
Collaborator

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer use updateCellMargin().

@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch from 470665b to 8bd80f8 Compare July 23, 2019 21:09
@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch 5 times, most recently from 9ccc847 to 19d0ab8 Compare August 25, 2019 05:25
@khzhu khzhu force-pushed the GENIE-fusion-issue-5613 branch from 19d0ab8 to 8b5e6bd Compare August 27, 2019 19:26
@zhx828 zhx828 requested review from kalletlak and alisman and removed request for zhx828 August 28, 2019 15:34
@@ -2743,13 +2829,40 @@ export class StudyViewPageStore {
default: []
});

// @ts-ignore
Copy link
Member

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',
Copy link
Member

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

Copy link
Member

@zhx828 zhx828 Oct 2, 2019

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();
Copy link
Member

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();
Copy link
Member

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

<Else>
<DefaultTooltip
placement="right"
disabled={type === 'fusion'}
Copy link
Member

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'

}

export function rowIsChecked(entrezGeneId:number, preSelectedRows:AlteredGenesTableUserSelectionWithIndex[], selectedRows:AlteredGenesTableUserSelectionWithIndex[]) {
const record = _.find(
Copy link
Member

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?

}

export function rowIsDisabled(entrezGeneId: number, selectedRows:AlteredGenesTableUserSelectionWithIndex[]) {
return !_.isUndefined(
Copy link
Member

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(

@zhx828 zhx828 force-pushed the GENIE-fusion-issue-5613 branch 3 times, most recently from 3db6445 to 84702e7 Compare October 2, 2019 15:56
@zhx828 zhx828 requested a review from kalletlak October 3, 2019 19:51
@zhx828 zhx828 force-pushed the GENIE-fusion-issue-5613 branch from a8af10d to bda73f3 Compare October 3, 2019 19:56
</Modal>
);
} else {
return <span />;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null?

@zhx828 zhx828 force-pushed the GENIE-fusion-issue-5613 branch 2 times, most recently from b2467cb to 088741e Compare October 7, 2019 17:23

@computed
get tableColumns() {
return _.reduce(this.props.columns, (acc, column) => {
Copy link
Member

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) => {
Copy link
Collaborator

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.

Copy link
Member

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?

Copy link
Member

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) {
Copy link
Collaborator

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)) {
Copy link
Collaborator

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)

Copy link
Author

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) {
Copy link
Collaborator

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,
Copy link
Collaborator

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[]>({
Copy link
Collaborator

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"

/>
</span>
);

function getCellContent() {
Copy link
Collaborator

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);
Copy link
Collaborator

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?

Copy link
Member

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) {
Copy link
Collaborator

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.

Copy link
Member

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.

Copy link
Collaborator

@alisman alisman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments

@zhx828 zhx828 force-pushed the GENIE-fusion-issue-5613 branch 3 times, most recently from b72676d to 1e63aec Compare October 11, 2019 22:39
@zhx828 zhx828 changed the base branch from master to release-3.1.1 October 11, 2019 22:40
@zhx828 zhx828 force-pushed the GENIE-fusion-issue-5613 branch 5 times, most recently from d42bd12 to 069aa63 Compare October 12, 2019 14:16
…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
@zhx828 zhx828 force-pushed the GENIE-fusion-issue-5613 branch from 069aa63 to 62f1bf5 Compare October 12, 2019 15:55
@zhx828
Copy link
Member

zhx828 commented Oct 12, 2019

The two coexpression tests on master env just impossible to finish. Need to double check before merging back to master

@zhx828 zhx828 merged commit 03cff68 into cBioPortal:release-3.1.1 Oct 12, 2019
@jagnathan jagnathan deleted the GENIE-fusion-issue-5613 branch June 2, 2021 16:51
jagnathan pushed a commit to pughlab/cbioportal-frontend that referenced this pull request Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants