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

Demo rfc80 poc mutation data count specific gene parameter #10975

Conversation

fuzhaoyuan
Copy link
Contributor

@fuzhaoyuan fuzhaoyuan commented Sep 4, 2024

Fix cBioPortal/rfc80-team#38 and cBioPortal/rfc80-team#43

Describe changes proposed in this pull request:

  • Add basic unit tests
  • Overload mutatedGenes and populateAlterationCounts related methods to provide a way to query limited list of genes, thus fasten the speed of endpoint 'mutation-data-count'

@@ -27,7 +27,7 @@ public interface StudyViewRepository {

List<ClinicalData> getPatientClinicalData(StudyViewFilterContext studyViewFilterContext, List<String> attributeIds);

List<AlterationCountByGene> getMutatedGenes(StudyViewFilterContext studyViewFilterContext);
List<AlterationCountByGene> getMutatedGenes(StudyViewFilterContext studyViewFilterContext, String specificHugoGeneSymbol);
Copy link
Contributor

Choose a reason for hiding this comment

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

@haynescd @fuzhaoyuan is there a way to indicate that this is optional rather than forcing people to pass null? I think that's called overloading at method, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I think maybe just "hugoGeneSymbol" is enough. specificHugGeneSymbol seems redundant. There should be a comment explaining that we pass in a genesymbol if we only want counts for that gene. i also wonder whether we should just make it an array since it seems inevitable that we'll want to target multiple genes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would honestly create a new method called getMutatedGene that would reuse the sql in the mapper file for getMutatedGenes...

Kinda doesn't make sense to have getMutatedGenes that returns one gene

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I'll look into it

Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe two methods (they could be overloaded )
getMutatedGenes
getMutatedGenes(StudyViewFilter, String... geneToQuery)

@@ -27,7 +27,7 @@ public interface StudyViewRepository {

List<ClinicalData> getPatientClinicalData(StudyViewFilterContext studyViewFilterContext, List<String> attributeIds);

List<AlterationCountByGene> getMutatedGenes(StudyViewFilterContext studyViewFilterContext);
List<AlterationCountByGene> getMutatedGenes(StudyViewFilterContext studyViewFilterContext, String specificHugoGeneSymbol);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would honestly create a new method called getMutatedGene that would reuse the sql in the mapper file for getMutatedGenes...

Kinda doesn't make sense to have getMutatedGenes that returns one gene

@@ -42,11 +42,11 @@ public interface StudyViewRepository {

List<CaseListDataCount> getCaseListDataCountsPerStudy(StudyViewFilterContext studyViewFilterContext);

Map<String, Integer> getTotalProfiledCounts(StudyViewFilterContext studyViewFilterContext, String alterationType);
Map<String, Integer> getTotalProfiledCounts(StudyViewFilterContext studyViewFilterContext, String alterationType, String specificHugoGeneSymbol);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above. We are overloading something that returns multiples to return a single

@@ -27,7 +27,7 @@ public interface StudyViewRepository {

List<ClinicalData> getPatientClinicalData(StudyViewFilterContext studyViewFilterContext, List<String> attributeIds);

List<AlterationCountByGene> getMutatedGenes(StudyViewFilterContext studyViewFilterContext);
List<AlterationCountByGene> getMutatedGenes(StudyViewFilterContext studyViewFilterContext, String specificHugoGeneSymbol);
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe two methods (they could be overloaded )
getMutatedGenes
getMutatedGenes(StudyViewFilter, String... geneToQuery)



public interface StudyViewMapper {
List<Sample> getFilteredSamples(@Param("studyViewFilterHelper") StudyViewFilterHelper studyViewFilterHelper);

List<GenomicDataCount> getMolecularProfileSampleCounts(@Param("studyViewFilterHelper") StudyViewFilterHelper studyViewFilterHelper);

List<AlterationCountByGene> getMutatedGenes(StudyViewFilterHelper studyViewFilterHelper, AlterationFilterHelper alterationFilterHelper);
List<AlterationCountByGene> getMutatedGenes(StudyViewFilterHelper studyViewFilterHelper, AlterationFilterHelper alterationFilterHelper, String specificHugoGeneSymbol);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you just overload the Repository layer.. you could just keep this the same except pass a list or null then you could just reuse the sql as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Think I got it. Thanks!

final int profiledCountWithoutGenePanelData = studyViewRepository.getTotalProfiledCountsByAlterationType(studyViewFilterContext, alterationType.toString());
var profiledCountsMap = studyViewRepository.getTotalProfiledCounts(studyViewFilterContext, alterationType.toString());
final var matchingGenePanelIdsMap = studyViewRepository.getMatchingGenePanelIds(studyViewFilterContext, alterationType.toString());
var profiledCountsMap = studyViewRepository.getTotalProfiledCounts(studyViewFilterContext, alterationType.toString(), specificHugoGeneSymbol);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@haynescd Do you think I should change it to list or overload? Same applies to the one below.

@fuzhaoyuan fuzhaoyuan force-pushed the demo-rfc80-poc-mutation_data_count-specific-gene branch from a73857b to 72a5175 Compare September 5, 2024 22:21
Copy link
Collaborator

@haynescd haynescd left a comment

Choose a reason for hiding this comment

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

Changed to use vararg to make it easier

List<GenomicDataCountItem> getMutationCountsByType(StudyViewFilterHelper studyViewFilterHelper, List<GenomicDataFilter> genomicDataFilters);

AlterationCountByGene getMutatedGene(StudyViewFilterHelper studyViewFilterHelper, AlterationFilterHelper alterationFilterHelper, String specificHugoGeneSymbol);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Am I missing this? I don't see it defined in the xml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh sorry I must forgot to remove it



public interface StudyViewMapper {
List<Sample> getFilteredSamples(@Param("studyViewFilterHelper") StudyViewFilterHelper studyViewFilterHelper);

List<GenomicDataCount> getMolecularProfileSampleCounts(@Param("studyViewFilterHelper") StudyViewFilterHelper studyViewFilterHelper);

List<AlterationCountByGene> getMutatedGenes(StudyViewFilterHelper studyViewFilterHelper, AlterationFilterHelper alterationFilterHelper);
List<AlterationCountByGene> getMutatedGenes(StudyViewFilterHelper studyViewFilterHelper, AlterationFilterHelper alterationFilterHelper, List<String> hugoGeneSymbols);
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 better variable name is genesToQuery?

@@ -29,6 +29,8 @@ public interface StudyViewRepository {

List<AlterationCountByGene> getMutatedGenes(StudyViewFilterContext studyViewFilterContext);

List<AlterationCountByGene> getMutatedGenes(StudyViewFilterContext studyViewFilterContext, List<String> hugoGeneSymbols);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
List<AlterationCountByGene> getMutatedGenes(StudyViewFilterContext studyViewFilterContext, List<String> hugoGeneSymbols);
Map<String, Integer> getTotalProfiledCounts(StudyViewFilterContext studyViewFilterContext, String alterationType, String... genesToQuery);

This is what I want. So when calling the function you can do the following...

        studyViewRepository.getTotalProfiledCounts(studyViewFilter, alterationType, "TP53", "GENEA");
        //or
studyViewRepository.getTotalProfiledCountsByAlterationType(studyViewFilterContext, alterationType.toString());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh wow that's cool

@@ -43,11 +45,15 @@ public interface StudyViewRepository {
List<CaseListDataCount> getCaseListDataCountsPerStudy(StudyViewFilterContext studyViewFilterContext);

Map<String, Integer> getTotalProfiledCounts(StudyViewFilterContext studyViewFilterContext, String alterationType);

Map<String, Integer> getTotalProfiledCounts(StudyViewFilterContext studyViewFilterContext, String alterationType, List<String> hugoGeneSymbols);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change the variable name to genesToQuery

Copy link

sonarcloud bot commented Sep 6, 2024

@fuzhaoyuan fuzhaoyuan closed this Sep 9, 2024
@fuzhaoyuan fuzhaoyuan deleted the demo-rfc80-poc-mutation_data_count-specific-gene branch September 9, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mutation data count service not returning "Not Profiled" count Slight mutation count discrepancy on genie
3 participants