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

Show namespace columns in MAF file in Mutation Table component #4163

Merged
merged 5 commits into from
Feb 3, 2022

Conversation

pvannierop
Copy link
Contributor

This is a redo from PR #4159. There were breaking bugs in this and it was reverted. Here regression tests are added for mutation table filtering.

Description

This PR will show custom columns in the MAF file imported with the namespace import mechanism in Mutation Table components of Results View, Patient View and Standalone Mutation Mapper.

Comment

Video

Peek 2021-12-02 13-35

Tests

  • e2e-localdb tests are included for namespace feature.
  • e2e-remote test is included for filter functionality for mutation tables.

@pvannierop pvannierop self-assigned this Feb 2, 2022
@pvannierop pvannierop force-pushed the namespacecolumns_in_mutationtable branch 2 times, most recently from 02d9c70 to 1a7132f Compare February 2, 2022 14:21
this.props.columns &&
!this.props.columns.includes(columnName)
) {
this.props.columns.push(columnName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

looks like we are mutating a prop here? that's antipattern. lets discuss.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

]![
columnName
] = createCategoricalFilter((d: Mutation) =>
CategoricalNamespaceColumnFormatter.download(
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe a comment explaining why we are using download? i mean, the problem is perhaps that the "download" is too specific

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Download here means the value formatted for download. I just copied this from other implementations.

@@ -173,6 +176,24 @@ export default class ResultsViewMutationTable extends MutationTable<
};
}

// generate namespace columns
const namespaceColumns = createNamespaceColumns(
Copy link
Collaborator

Choose a reason for hiding this comment

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

again it seems odd that we accept a prop of namespace columns only the mutate the columns prop. seems like we should be doing this where the columns prop is prepared?

return {};
}
const namespaceConfig: NamespaceColumnConfig = {};
const nameSpaces = _.flatMap(mutations, m => _.keys(m.namespaceColumns));
Copy link
Collaborator

Choose a reason for hiding this comment

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

it seems strange here that something of type Mutation[] would have something called "namespaceColumns" on it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not see why that would be strange. Maybe namespaceValues would be better. But would we go through the motions in the frontend and backend to update this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Again not necessary to address in this PR but what I object to is A) having something called "column" on Mutation type. And "namespace". Shouldn't this be more generic? Like, customValues or something. The fact that they belong to namespaces seems like a property of the individual values themselves. Again, I know this is very late to the game and I am not suggesting we make a change, but worth bringing up. Adding @inodb here. Is this THE one and only way we allow people to extend the Mutation data?

@pvannierop pvannierop force-pushed the namespacecolumns_in_mutationtable branch from 1a7132f to 681b3e0 Compare February 3, 2022 10:32
@@ -222,6 +226,31 @@ export default class ResultsViewMutationMapperStore extends MutationMapperStore
}
});

// Add numerical namespace column definitions.
Copy link
Collaborator

Choose a reason for hiding this comment

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

not necessary for this PR but this great example of something that should be in utility function and not bloating store

@alisman alisman merged commit b19fbed into master Feb 3, 2022
@alisman alisman deleted the namespacecolumns_in_mutationtable branch February 3, 2022 21:25
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.

2 participants