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

Refactor sort/search/pagination for ClinicalData table endpoint #10407

Merged
merged 8 commits into from May 7, 2024

Conversation

pvannierop
Copy link
Contributor

@pvannierop pvannierop commented Sep 28, 2023

⚠️ This PR breaks the API. Should be merged together with the corresponding cbioportal-frontend PR.

Background

  • The current code used for paginated download of clinical data used by the Clinical Data tab on study view does not work correctly.
  • Numerical sort is not supported at present. All data is handled as string.
  • Data structure returned for clinical data is separated between sample and patient level clinical attributes. The frontend needs to integrate this at the sample level to generate the table.

Solution

  • The MyBatis SQL code was updated. This logic handles pagination, sorting and searching. Test were added to confirm correct function.
  • Conversion of Clinical Data to numeric type was included in SQL in order to perform correct sorting.
  • Logic was moved from Controller to Service layer.
  • Clinical Data is corrected in the SampleClinicalDataCollection class where the data is keyed by the uniqueSampleKey (base64 encoded concatenation of sample and study identifier).

Remarks

  • The pagination that is requested by the controller, is not handled in persistence layer (SQL), but in the application layer (StudyViewServiceImpl.java). The reason for this is that the query should also return the total amount of results w/o pagination. Handling the pagination in the application layer prevents duplicate database queries.
  • base64 encoder was moved to utils module for reuse in service and web modules.
  • OffsetCalculator was renamed to PaginationCalculator to provide other calculations.

@sonarcloud
Copy link

sonarcloud bot commented Sep 28, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@dippindots dippindots added the api label Oct 17, 2023
Copy link
Member

@dippindots dippindots left a comment

Choose a reason for hiding this comment

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

LGTM, just added some comments about the new model created

@dippindots
Copy link
Member

@pvannierop Could you link the related frontend pr and rebase this pr? Thanks!

Copy link

sonarcloud bot commented Nov 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.21) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@pvannierop
Copy link
Contributor Author

I have addressed your remarks. The branch has been rebased. I could not reference the frontend PR because @alisman still has to make this.

Copy link
Member

@dippindots dippindots left a comment

Choose a reason for hiding this comment

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

@pvannierop Thanks for addressing my comments! It looks good to me. I guess we just need to wait for two more things:

  • wait for @alisman make the frontend pr
  • wait for RFC72 (spring-boot refactoring)
    Then we can merge this one.

Copy link

sonarcloud bot commented Jan 30, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

6 New issues
0 Security Hotspots
89.2% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Collaborator

@JREastonMarks JREastonMarks left a comment

Choose a reason for hiding this comment

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

A couple of issues to address mentioned here.
I would also look at SonarCube Analysis for other minor issues after you resolve the conflicts.

@fuzhaoyuan fuzhaoyuan closed this Apr 2, 2024
@fuzhaoyuan fuzhaoyuan reopened this Apr 2, 2024
Copy link
Collaborator

@JREastonMarks JREastonMarks left a comment

Choose a reason for hiding this comment

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

lgtm

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.

lgtm

@dippindots dippindots force-pushed the demo-fix-clinical-table-sorting branch from 7c3e6a0 to 0726e4c Compare May 6, 2024 19:54
Copy link

sonarcloud bot commented May 6, 2024

@dippindots dippindots merged commit 166c955 into master May 7, 2024
19 of 20 checks passed
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.

None yet

6 participants