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

Add clickhouse custom data endpoints #10963

Open
wants to merge 5 commits into
base: demo-rfc80-poc
Choose a base branch
from

Conversation

gblaih
Copy link
Contributor

@gblaih gblaih commented Aug 28, 2024

@gblaih gblaih force-pushed the demo-rfc80-poc-custom-data-counts branch from 33790dc to ef2ef4f Compare August 28, 2024 20:03
@alisman alisman added the RFC80 label Sep 5, 2024
Comment on lines 26 to 29
@Autowired
private StudyViewFilterUtil studyViewFilterUtil;
@Autowired
private CustomDataFilterUtil customDataFilterUtil;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bad practice to mix constructor injection and property injection

import org.cbioportal.web.parameter.MutationOption;
import org.cbioportal.web.parameter.Projection;
import org.cbioportal.web.parameter.StudyViewFilter;
import org.cbioportal.web.parameter.*;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update your settings in intellij to not replace with a wild card

Comment on lines 51 to 54
@Autowired
private StudyViewFilterUtil studyViewFilterUtil;
@Autowired
private CustomDataFilterUtil customDataFilterUtil;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update to just constructor injection

@@ -53,12 +40,12 @@ public StudyViewFilterUtil() {
geneService = null;
}

public void extractStudyAndSampleIds(
List<SampleIdentifier> sampleIdentifiers,
public <T extends SampleIdentifier> void extractStudyAndSampleIds(
Copy link
Collaborator

Choose a reason for hiding this comment

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

In practice this is not an easily readable method... Extract study and sample ids from what.
Clean code would return a new list instead of mutating the passed in list.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is accepted when its obvious which object is being mutated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's extracting from the sampleIdentifiers parameter. i think this method was done this way because they wanted to populate two lists with a single pass of sampleIdentifiers instead of two. i'm reluctant to change it if thats how it worked before and i would have to update several usages of this. let me know if you want me to still update this

Comment on lines 129 to 142
public List<ClinicalDataBin> fetchCustomDataBinCounts(
DataBinMethod dataBinMethod,
ClinicalDataBinCountFilter dataBinCountFilter,
boolean shouldRemoveSelfFromFilter
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably be better to utilize the GenericDataBinner

Copy link
Contributor Author

@gblaih gblaih Sep 23, 2024

Choose a reason for hiding this comment

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

do you mean move this method to DataBinner? i wanted to keep the clinical bin and custom bin methods together as the original clinical bin util did, also because fetching clinical bin and custom bins are very similar.

Copy link
Collaborator

Choose a reason for hiding this comment

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

import org.cbioportal.web.columnar.util.NewClinicalDataBinUtil;
import org.cbioportal.web.parameter.*;
import org.cbioportal.web.util.DataBinner;
import org.cbioportal.web.util.*;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update to remove wildcards

@haynescd
Copy link
Collaborator

Can you also address the sonar cloud issues

@gblaih gblaih force-pushed the demo-rfc80-poc-custom-data-counts branch from faa4828 to 490ae1a Compare September 24, 2024 16:25
Copy link

sonarcloud bot commented Sep 25, 2024

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.

3 participants