From c2b4510f1b89cf917ae6d7561175830265900d7c Mon Sep 17 00:00:00 2001 From: Saagar Arya Date: Thu, 1 May 2025 11:09:02 -0400 Subject: [PATCH 1/7] [genomic_browser] Update helptext and testplan --- .../genomic_browser/help/genomic_browser.md | 20 ++ modules/genomic_browser/test/TestPlan.md | 225 ++++++++---------- 2 files changed, 123 insertions(+), 122 deletions(-) create mode 100644 modules/genomic_browser/help/genomic_browser.md diff --git a/modules/genomic_browser/help/genomic_browser.md b/modules/genomic_browser/help/genomic_browser.md new file mode 100644 index 00000000000..87a911d919b --- /dev/null +++ b/modules/genomic_browser/help/genomic_browser.md @@ -0,0 +1,20 @@ +# Genomic Browser + +This module is intended to allow users to visualize the results of already analyzed genetic tests cross-linked with behavioral and imaging candidate data. + +The intended users are researchers and study personnel browsing and reviewing summary data. This module is a beta version which aims to present summary genomic data of several types so that researchers can usefully review and explore data available for study participants in a cross-modal context. SNP, CNV, and methylation (epigenomic) data are example types of data supported. + +Utilities are included for uploading and visualizing data, and these functions can be extended for additional data types. This module is not designed to replace existing databases designed for storing genomic data. + +### Usage +You can switch between the different tabs to view different types of genomic data. The tabs are: +- Profile, GWAS, SNP, CNV, Methylation and Files +- **Profiles**: This tab allows you to get a brief summary of the data available for each participant, including whether SNPs, CNVs and CPGs were found or not. +- **GWAS**: This tab allows you to visualize the results of a genome-wide association study (GWAS) for each participant. +- **SNP**: This tab allows you to visualize the results of a single nucleotide polymorphism (SNP) analysis for each participant. +- **CNV**: This tab allows you to visualize the results of a copy number variation (CNV) analysis for each participant. +- **Methylation**: This tab allows you to visualize the results of a methylation analysis for each participant. +- **Files**: This tab allows you to upload and download files related to the genomic data. + +### Uploading Data +To upload data, you can use the "Upload" button in the "Files" tab. This will allow you to select a file from your computer and upload it to the server. The file should be in a format that is compatible with the module, such as CSV. diff --git a/modules/genomic_browser/test/TestPlan.md b/modules/genomic_browser/test/TestPlan.md index 347bd98378c..5255d8f1ced 100644 --- a/modules/genomic_browser/test/TestPlan.md +++ b/modules/genomic_browser/test/TestPlan.md @@ -9,15 +9,14 @@ #### [Datatable](#datatable_link) #### [Download](#data_download_link) #### [Upload](#data_upload_link) -#### [Help content](#help_content_link) +#### [Help Content](#help_content_link)
- - + ## Permissions -The following permissions should be available in the database +The following permissions should be available in the database: | code | description | | :---: | --- | @@ -25,56 +24,59 @@ The following permissions should be available in the database | genomic_browser_view_allsites | View Genomic Browser data across all sites | | genomic_data_manager | Upload genomic files | - -#### For a user without neither genomic_browser_view_allsites nor genomic_browser_view_site +#### For a user with neither `genomic_browser_view_allsites` nor `genomic_browser_view_site`: - The Loris menu should not contain a *Genomic Browser* item. -- Accessing the http://your-base-url/genomic_browser/ should present the following error message: +- Accessing `http://your-base-url/genomic_browser/` should present the following error message: -> **You do not have access to this page.** +> **You do not have access to this page.** *** -#### For a user with genomic_browser_view_allsites only -- There should be a *Genomic Browser* item in the Loris Menu under tools. -- Accessing the http://your-base-url/genomic_browser/ should load the Genomic Browser Profile tab. +#### For a user with `genomic_browser_view_allsites` only: + +- There should be a *Genomic Browser* item in the Loris Menu under Tools. +- Accessing `http://your-base-url/genomic_browser/` should load the Genomic Browser Profile tab. *** -#### For a user with genomic_browser_view_site only -- There should be a *Genomic Browser* item in the Loris Menu under tools. -- Accessing the http://your-base-url/genomic_browser/ should load the Genomic Browser Profile tab. -- The Datatable that appears in the Profiles, CNV, SNP and Methylation tabs should only contain data having the same site(s) as this user's site(s). +#### For a user with `genomic_browser_view_site` only: + +- There should be a *Genomic Browser* item in the Loris Menu under Tools. +- Accessing `http://your-base-url/genomic_browser/` should load the Genomic Browser Profile tab. +- The datatable that appears in the Profiles, CNV, SNP, and Methylation tabs should only contain data from the same site(s) as the user. *** -#### For a user with genomic_data_manager and one of genomic_browser_view_site or genomic_browser_view_allsites -- In the File tab of the Genomic Browser, there should be a *Upload File* button. For users with permission genomic_data_manager, this button will allow a file to be uploaded. For users that do not have this permission, a message saying that the user does not have sufficient privileges is displayed when the button is clicked. +#### For a user with `genomic_data_manager` and one of `genomic_browser_view_site` or `genomic_browser_view_allsites`: -*** +- In the Files tab of the Genomic Browser, there should be an *Upload File* button. + - For users with the `genomic_data_manager` permission, this button allows file upload. + - For users without this permission, a message indicating insufficient privileges is shown when the button is clicked. - - +*** + + ## Page Navigation and Display -- There should be 6 tabs under the breadcrumbs: Profile, GWAS, SNP, CNV, Methylation and Files -- Clicking each tab should present it as active and the 5 other tabs should remain in the same order. +- There should be 6 tabs under the breadcrumbs: Profile, GWAS, SNP, CNV, Methylation, and Files. +- Clicking each tab should activate it, while the other 5 tabs remain in the same order. - - + -## Features +## Features *** - - + + ### Data Filtering #### Profile tab -- Filters should filter data presented in the Datatable according to the selected/entered values on the fly (i.e as values are selected or characters are typed). - - *Site* dropdown should present all sites for a user with the genomic_browser_view_allsites permission - - *Site* dropdown should present only the user's own site for a user with the genomic_browser_view_site permission + +- Filters should update data in the datatable on the fly (i.e., as values are selected or characters are typed). + - *Site* dropdown should list all sites for users with `genomic_browser_view_allsites`. + - *Site* dropdown should show only the user's site for users with `genomic_browser_view_site`. - The datatable should display the following columns: @@ -83,70 +85,70 @@ The following permissions should be available in the database | | | | | | | | | - Clicking the *Clear Form* button should reset the filter. -- Clicking on column headers should sort data in ascending order on the first click then descending order on the second click. - +- Clicking on column headers should sort data in ascending order on the first click and descending order on the second. -*** +*** #### GWAS tab -- Filters should filter data presented in the Datatable on the fly (i.e as values are selected or characters are typed). +- Filters should update data in the datatable on the fly. - Clicking the *Clear Form* button should reset the filters. -- Clicking on column headers should sort data in ascending order on the first click then descending order on the second click. +- Column headers should toggle sort order on click. -*** +*** #### SNP tab -- Filters should filter data presented in the Datatable on the fly (i.e as values are selected or characters are typed). - - Candidate filters - - *Site* dropdown should present all sites for a user with the genomic_browser_view_allsites permission - - *Site* dropdown should present only the user's own site for a user with the genomic_browser_view_site permission - - Genomic Range filters - - *Genomic Range* filter should filter SNP to present only SNP for which *StartLoc* is contained within the range (i.e. chr14:100000-200000 should present all the SNP on the chromosome 14 between position 1000000 and 2000000 inclusively. - - By entering only the chromosome name in the *Genomic Range*, all the SNP on that chromosome should appear. -- The datatable should display the following columns (Summary fields) +- Filters should update data in the datatable on the fly. + - Candidate filters: + - *Site* dropdown behavior follows the same rules as above. + - Genomic Range filters: + - *Genomic Range* filter should show SNPs whose *StartLoc* is within the specified range (e.g., `chr14:100000-200000` includes SNPs on chromosome 14 between 100000 and 200000 inclusive). + - Entering only a chromosome name should display all SNPs on that chromosome. + +- The datatable should display: -|No.|PSCID|Sex|Cohort|Build|Platform|Allele A|Allele B|Reference Base|Minor Allele|Function Prediction|Damaging|Genotype Quality| -| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---| +| No.|PSCID|Sex|Cohort|Build|Platform|Allele A|Allele B|Reference Base|Minor Allele|Function Prediction|Damaging|Genotype Quality| +| ---|---|---|---|---|---|---|---|---|---|---|---|--- | | | | | | | | | | | | | | | -- Clicking the *Clear Form* button should reset the filter. -- Clicking on column headers should sort data in ascending order on the first click then descending order on the second click. +- *Clear Form* resets filters. +- Column sorting works as above. -*** +*** #### CNV tab -- Filters should filter data presented in the Datatable on the fly (i.e as values are selected or characters are typed). - - *Site* dropdown should present all sites for a user with the genomic_browser_view_allsites permission - - *Site* dropdown should present only the user's own site for a user with the genomic_browser_view_site permission - - By entering only the chromosome name in the *Genomic Range*, all the SNP on that chromosome should appear. +- Filters should update data in the datatable on the fly. + - *Site* and *Genomic Range* filters behave as previously described. + - Entering only the chromosome name should display all CNVs on that chromosome. -- The datatable should display the following columns: +- Datatable columns: -|No.|PSCID|Sex|Cohort|Location|Type|Common|Characteristics|Inheritance|Platform| +| No.|PSCID|Sex|Cohort|Location|Type|Common|Characteristics|Inheritance|Platform | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | | | | | | | | | | | -- Clicking the *Clear Form* button should reset the filter. -- Clicking on column headers should sort data in ascending order on the first click then descending order on the second click. +- *Clear Form* resets filters. +- Sorting applies to column headers. -*** +*** #### Methylation tab -- Filters should filter data presented in the Datatable on the fly (i.e as values are selected or characters are typed). - - *Site* dropdown should present all sites for a user with the genomic_browser_view_allsites permission - - *Site* dropdown should present only the user's own site for a user with the genomic_browser_view_site permission - - *Genomic Range* filter should filter SNP to prensent only SNP that *StartLoc* is contain within the range (i.e. chr14:100000-200000 should prensent all the SNP on the chromosome 14 between position 1000000 and 2000000 inclusively. -- The datatable should display the following columns (Summary fields) +- Filters should update data in the datatable on the fly. + - *Site* and *Genomic Range* filters behave as previously described. + - *Genomic Range* filter should show SNPs with *StartLoc* within range (e.g., `chr14:100000-200000`). + +> Fixed typo: "prensent" → "present", "contain" → "contained" + +- Datatable columns: |No.|PSCID|Sex|Sample|Probe Seq A|Probe Loc B|Probe Seq B|Infinium Design|Color|Gene|Accession Number|Position|DMR|DHS| | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | -- Clicking the *Clear Form* button should reset the filter. +- *Clear Form* resets filters. - Clicking on column headers should sort data in ascending order on the first click then descending order on the second click. *** @@ -155,88 +157,67 @@ The following permissions should be available in the database - Filters should filter data presented in the Datatable on the fly (i.e as values are selected or characters are typed). -The following columns should be presented +Datatable columns: -|No.|GenomicFileID|FileName|Description|FileType|Date Inserted|InsertedByUserID|Caveat|Notes| +| No. | GenomicFileID | FileName | Description | FileType | Date Inserted | InsertedByUserID | Caveat | Notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | | | | | | | | | | -- Clicking the *Clear Form* button should reset the filters - -*** - -##### Across tab filters - +- *Clear Form* resets filters. *** - - + + ## Datatable - - For each of the 6 tabs, the Datatable should present the total of records found. - - For each of the 6 tabs, the Datatable should present the number of row displayed. - - For each of the 6 tabs, the Datatable should present a pagination if there is more records to display then the actual *row per page* value. - - Changing the *row per page* drop-down value should be reflected on the pagination and on the number of row displayed. +- Each tab should display: + - Total records found + - Number of rows displayed + - Pagination (if total records exceed *rows per page*) + - Changing *rows per page* should update pagination and visible rows -### Special formated columns +### Special formatted columns #### Profile tab - - The *PSCID* column should provide links to the timepoint_list module filtered to this candidate. - - If there is at least one file for a candidate, the *Files* column should provide links to the **viewGenomicFile** submenu filtered for all files concerning this candidate. There can be multiple files displayed. - - If there is at least one SNP for this candidate, the SNPs column should provide links to the SNP tab filtered for this candidate. - - If there is at least one CNV for this candidate, the CNVs column should provide links to the CNV tab filtered for this candidate. - - If there is at least one CPG for this candidate, the CPGs column should provide links to the Methylation tab filtered for this candidate. +- *PSCID* links to `timepoint_list` filtered to the candidate +- *Files*, *SNPs*, *CNVs*, *CPGs* columns link to corresponding filtered tabs #### GWAS tab - - None +- None + *** + #### SNP tab -- The *PSCID* column should provide links to the timepoint_list module filtered to this candidate. -- The *RsID* column should provide link to the [dbSNP](http://www.ncbi.nlm.nih.gov/SNP/) http://www.ncbi.nlm.nih.gov/SNP/ +- *PSCID* links to `timepoint_list` +- *RsID* links to [dbSNP](http://www.ncbi.nlm.nih.gov/SNP/) + *** + #### CNV tab -- The *PSCID* column should provide links to the timepoint_list module filtered to this candidate. +- *PSCID* links to `timepoint_list` + *** + #### Methylation tab -- The *PSCID* column should provide links to the timepoint_list module filtered to this candidate. -- The *Cpg Name* column should provide links to the [UCSC Genome Browser](https://genome.ucsc.edu/cgi-bin/hgTracks) https://genome.ucsc.edu/cgi-bin/hgTracks at the location centered on that cpg 1000bp wide. -- The *Gene* column should provide links to the [UCSC Genome Browser](https://genome.ucsc.edu/cgi-bin/hgTracks) https://genome.ucsc.edu/cgi-bin/hgTracks at the location centered on that gene. There can be many gene name. The links should open new window. -- The *Accession Number* column should provide links to the [UCSC Genome Browser](https://genome.ucsc.edu/cgi-bin/hgTracks) https://genome.ucsc.edu/cgi-bin/hgTracks at the location centered on that gene. There can be many gene name. The links should open new window. -- The *Island Loc* column should provide links to the [UCSC Genome Browser](https://genome.ucsc.edu/cgi-bin/hgTracks) https://genome.ucsc.edu/cgi-bin/hgTracks at the location centered on that cPG island. +- *PSCID* links to `timepoint_list` +- *Cpg Name*, *Gene*, *Accession Number*, *Island Loc* link to [UCSC Genome Browser](https://genome.ucsc.edu/cgi-bin/hgTracks) +- Multiple gene names should open in new tabs/windows + *** -#### Files tab -- The FileName column should provide links to the **viewGenomicFile** page showing this file only. +#### Files tab +- *FileName* links to **viewGenomicFile** page for that file only + - - +## Data Download -## Data Download ### CSV -- The 6 tab Datatables should provide a *Download as CSV* button. -- Clicking on the *Download as CSV* button should trigger a file download. -- The file content should follow the filtered values of the tab. +- All 6 tab datatables should provide a *Download as CSV* button +- Clicking it triggers file download +- Downloaded file should reflect current filtered values ### View Genomic File -- The "Files" tab (or Genomic File Uploader subpage) should provide a *Download* button for each file. -- Clicking on the *Download* button should trigger a file download. - - - - -## Data Upload - -Files may be uploaded under the Files tab (Genomic File Uploader subpage) IFF the Genomic Browser back-end is properly customized/configured and sample files of the appropriate format are available for upload testing. -. -Currently this will only work for methylation beta-values files formatted for the Illumina 450k platform, and only once certain probe metadata is already loaded into the database. - - - - -## Help section content - -- The help panel should appear when clicking on the question mark in the LORIS menu bar. -- The help text should be accurate at formatted properly. -- Help text should be appropriate to each subpage (tab) displayed, e.g SNP tab. +- The "Files" tab (or Genomic File Uploader subpage) should provide a *Download* button per file +- Clicking it triggers a download From 0e44cef1332d76788a45e229c5ddb7cb4cf41e82 Mon Sep 17 00:00:00 2001 From: Saagar Arya Date: Thu, 1 May 2025 11:15:14 -0400 Subject: [PATCH 2/7] Remove DoB from genomic_browser --- modules/genomic_browser/jsx/tabs_content/gwas.js | 3 +-- modules/genomic_browser/php/models/cnvdto.class.inc | 8 -------- .../genomic_browser/php/models/methylationdto.class.inc | 8 -------- modules/genomic_browser/php/models/profiledto.class.inc | 8 -------- modules/genomic_browser/php/models/snpdto.class.inc | 8 -------- .../php/provisioners/cnvprovisioner.class.inc | 1 - .../php/provisioners/methylationprovisioner.class.inc | 1 - .../php/provisioners/profileprovisioner.class.inc | 1 - .../php/provisioners/snpprovisioner.class.inc | 1 - 9 files changed, 1 insertion(+), 38 deletions(-) diff --git a/modules/genomic_browser/jsx/tabs_content/gwas.js b/modules/genomic_browser/jsx/tabs_content/gwas.js index ec4cf06e2c1..5dc65f6dc53 100644 --- a/modules/genomic_browser/jsx/tabs_content/gwas.js +++ b/modules/genomic_browser/jsx/tabs_content/gwas.js @@ -79,8 +79,7 @@ class GWAS extends Component { const hiddenHeaders = [ 'PSC', 'DCCID', - 'externalID', - 'DoB', + 'externalID' ]; let reactElement; if (-1 === hiddenHeaders.indexOf(column)) { diff --git a/modules/genomic_browser/php/models/cnvdto.class.inc b/modules/genomic_browser/php/models/cnvdto.class.inc index c564b521989..af20931d6be 100644 --- a/modules/genomic_browser/php/models/cnvdto.class.inc +++ b/modules/genomic_browser/php/models/cnvdto.class.inc @@ -71,13 +71,6 @@ class CnvDTO implements DataInstance, SiteHaver */ private $_Cohort = ""; - /** - * The DoB - * - * @var string - */ - private $_DoB = ""; - /** * The ExternalID * @@ -224,7 +217,6 @@ class CnvDTO implements DataInstance, SiteHaver 'PSCID' => $this->_PSCID, 'Sex' => $this->_Sex, 'Cohort' => $this->_Cohort, - 'DoB' => $this->_DoB, 'ExternalID' => $this->_ExternalID, 'Chromosome' => $this->_Chromosome, 'Strand' => $this->_Strand, diff --git a/modules/genomic_browser/php/models/methylationdto.class.inc b/modules/genomic_browser/php/models/methylationdto.class.inc index 4c2a175f061..1b5d329084b 100644 --- a/modules/genomic_browser/php/models/methylationdto.class.inc +++ b/modules/genomic_browser/php/models/methylationdto.class.inc @@ -71,13 +71,6 @@ class MethylationDTO implements DataInstance, SiteHaver */ private $_Cohort = ""; - /** - * The DoB - * - * @var string - */ - private $_DoB = ""; - /** * The Sample * @@ -280,7 +273,6 @@ class MethylationDTO implements DataInstance, SiteHaver 'PSCID' => $this->_PSCID, 'Sex' => $this->_Sex, 'Cohort' => $this->_Cohort, - 'DoB' => $this->_DoB, 'Sample' => $this->_Sample, 'cpg_name' => $this->_cpg_name, 'Beta_value' => $this->_Beta_value, diff --git a/modules/genomic_browser/php/models/profiledto.class.inc b/modules/genomic_browser/php/models/profiledto.class.inc index 5dee72564a1..b36c99ae24a 100644 --- a/modules/genomic_browser/php/models/profiledto.class.inc +++ b/modules/genomic_browser/php/models/profiledto.class.inc @@ -83,13 +83,6 @@ class ProfileDTO implements DataInstance, SiteHaver */ private $_Cohort = ""; - /** - * The DoB - * - * @var string - */ - private $_DoB = ""; - /** * The externalID * @@ -138,7 +131,6 @@ class ProfileDTO implements DataInstance, SiteHaver 'PSCID' => $this->_PSCID, 'Sex' => $this->_Sex, 'Cohort' => $this->_Cohort, - 'DoB' => $this->_DoB, 'externalID' => $this->_externalID, 'File' => $this->_File, 'SNP' => $this->_SNP, diff --git a/modules/genomic_browser/php/models/snpdto.class.inc b/modules/genomic_browser/php/models/snpdto.class.inc index 3a03ebcbd62..0bf8791fa00 100644 --- a/modules/genomic_browser/php/models/snpdto.class.inc +++ b/modules/genomic_browser/php/models/snpdto.class.inc @@ -82,13 +82,6 @@ class SnpDTO implements DataInstance, SiteHaver */ private $_Cohort = ""; - /** - * The DoB - * - * @var string - */ - private $_DoB = ""; - /** * The externalID * @@ -270,7 +263,6 @@ class SnpDTO implements DataInstance, SiteHaver 'PSCID' => $this->_PSCID, 'Sex' => $this->_Sex, 'Cohort' => $this->_Cohort, - 'DoB' => $this->_DoB, 'externalID' => $this->_externalID, 'Chromosome' => $this->_Chromosome, 'Strand' => $this->_Strand, diff --git a/modules/genomic_browser/php/provisioners/cnvprovisioner.class.inc b/modules/genomic_browser/php/provisioners/cnvprovisioner.class.inc index abad72b897e..68f8a05d7a2 100644 --- a/modules/genomic_browser/php/provisioners/cnvprovisioner.class.inc +++ b/modules/genomic_browser/php/provisioners/cnvprovisioner.class.inc @@ -29,7 +29,6 @@ class CnvProvisioner extends \LORIS\Data\Provisioners\DBObjectProvisioner candidate.PSCID AS _PSCID, candidate.Sex AS _Sex, cohort.CohortID AS _Cohort, - DATE_FORMAT(candidate.DoB, '%Y-%m-%d') AS _DoB, candidate.ExternalID AS _ExternalID, candidate.RegistrationCenterID as _centerID, candidate.RegistrationProjectID as _projectID, diff --git a/modules/genomic_browser/php/provisioners/methylationprovisioner.class.inc b/modules/genomic_browser/php/provisioners/methylationprovisioner.class.inc index b0d80207e76..e5a5e7b3bd1 100644 --- a/modules/genomic_browser/php/provisioners/methylationprovisioner.class.inc +++ b/modules/genomic_browser/php/provisioners/methylationprovisioner.class.inc @@ -31,7 +31,6 @@ class MethylationProvisioner extends \LORIS\Data\Provisioners\DBObjectProvisione candidate.RegistrationCenterID as _centerID, candidate.RegistrationProjectID as _projectID, cohort.CohortID AS _Cohort, - DATE_FORMAT(candidate.DoB, '%Y-%m-%d') AS _DoB, gscr.sample_label AS _Sample, cpg.cpg_name AS _cpg_name, cpg.beta_value AS _Beta_value, diff --git a/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc b/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc index 81453c5f6e9..eef04310324 100644 --- a/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc +++ b/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc @@ -29,7 +29,6 @@ class ProfileProvisioner extends \LORIS\Data\Provisioners\DBObjectProvisioner candidate.PSCID AS _PSCID, candidate.Sex AS _Sex, subproj.title AS _Cohort, - DATE_FORMAT(candidate.DoB, '%Y-%m-%d') AS _DoB, candidate.ExternalID AS _externalID, candidate.RegistrationCenterID as _centerID, candidate.RegistrationProjectID as _projectID, diff --git a/modules/genomic_browser/php/provisioners/snpprovisioner.class.inc b/modules/genomic_browser/php/provisioners/snpprovisioner.class.inc index 83a7876b16f..a3fd0cd7033 100644 --- a/modules/genomic_browser/php/provisioners/snpprovisioner.class.inc +++ b/modules/genomic_browser/php/provisioners/snpprovisioner.class.inc @@ -29,7 +29,6 @@ class SnpProvisioner extends \LORIS\Data\Provisioners\DBObjectProvisioner candidate.PSCID AS _PSCID, candidate.Sex AS _Sex, subproj.title AS _Cohort, - DATE_FORMAT(candidate.DoB, '%Y-%m-%d') AS _DoB, candidate.ExternalID AS _externalID, candidate.RegistrationCenterID as _centerID, candidate.RegistrationProjectID as _projectID, From 808bca32237702fc6b904b01f24743146ccbba73 Mon Sep 17 00:00:00 2001 From: Saagar Arya Date: Thu, 1 May 2025 15:54:08 -0400 Subject: [PATCH 3/7] Fix UploadFile Form --- .../tabs_content/filemanager/uploadForm.js | 7 ++-- .../genomic_browser/jsx/tabs_content/files.js | 34 +++++++------------ .../genomic_browser/php/filemanager.class.inc | 4 +-- .../php/uploading/genomicfile.class.inc | 16 +++++---- 4 files changed, 29 insertions(+), 32 deletions(-) diff --git a/modules/genomic_browser/jsx/tabs_content/filemanager/uploadForm.js b/modules/genomic_browser/jsx/tabs_content/filemanager/uploadForm.js index 326dbcb8b01..784c4e51249 100644 --- a/modules/genomic_browser/jsx/tabs_content/filemanager/uploadForm.js +++ b/modules/genomic_browser/jsx/tabs_content/filemanager/uploadForm.js @@ -10,6 +10,7 @@ import { SelectElement, ButtonElement, } from 'jsx/Form'; +import swal from 'sweetalert2'; /** * Genomic Upload Form @@ -200,7 +201,8 @@ class GenomicUploadForm extends Component { }, // reset form data after successful file upload uploadProgress: -1, }); - swal('Upload Successful!', '', 'success'); + swal.fire('Upload Successful!', '', 'success'); + this.props.closeFileUploadModal(); } ).catch((error) => { console.error(error); @@ -211,7 +213,7 @@ class GenomicUploadForm extends Component { errorMessage: msg, uploadProgress: -1, }); - swal(msg, '', 'error'); + swal.fire(msg, '', 'error'); }); } } @@ -219,6 +221,7 @@ GenomicUploadForm.propTypes = { action: PropTypes.string, permissions: PropTypes.object, baseURL: PropTypes.string.isRequired, + closeFileUploadModal: PropTypes.func.isRequired, }; export default GenomicUploadForm; diff --git a/modules/genomic_browser/jsx/tabs_content/files.js b/modules/genomic_browser/jsx/tabs_content/files.js index 4b5440cca9b..5e72d90beee 100644 --- a/modules/genomic_browser/jsx/tabs_content/files.js +++ b/modules/genomic_browser/jsx/tabs_content/files.js @@ -37,7 +37,6 @@ class Files extends Component { this.formatColumn = this.formatColumn.bind(this); this.openFileUploadModal = this.openFileUploadModal.bind(this); this.closeFileUploadModal = this.closeFileUploadModal.bind(this); - this.renderFileUploadForm = this.renderFileUploadForm.bind(this); this.setFileUploadFormData = this.setFileUploadFormData.bind(this); } @@ -116,26 +115,7 @@ class Files extends Component { }, showFileUploadModal: false, }); - } - - /** - * Render File Upload Form - * - * @return {JSX} react upload form modal - */ - renderFileUploadForm() { - return ( - - - - ); + this.fetchData(); } /** @@ -252,7 +232,17 @@ class Files extends Component { return ( - {this.renderFileUploadForm()} + + + getQueryParams(); // GET request for downloading file by ID. - if ($values['filename']) { + if ($values['filename'] ?? false) { $factory = \NDB_Factory::singleton(); $config = $factory->config(); $filesDir = \Utility::appendForwardSlash( @@ -129,7 +129,7 @@ class FileManager extends \NDB_Page implements ETagCalculator // handles upload process - returns status of file upload. $response = $genomicFile->setupUploading( $request->getAttribute('user'), // user - $_FILES, // file data + $request->getUploadedFiles(), // file data $values // post request values. ); diff --git a/modules/genomic_browser/php/uploading/genomicfile.class.inc b/modules/genomic_browser/php/uploading/genomicfile.class.inc index ee586880e78..830b1a95d3c 100644 --- a/modules/genomic_browser/php/uploading/genomicfile.class.inc +++ b/modules/genomic_browser/php/uploading/genomicfile.class.inc @@ -58,20 +58,24 @@ class Genomicfile */ function setupUploading($user, $files, $values) : array { + if (!isset($files['file']) + || empty($files['file']->getStream()->getMetadata('uri')) + ) { + return false; + } $this->_user = $user; - $this->_bytes = $files['file']['size']; + $this->_bytes = $files['file']->getSize(); $this->_values = $values; - $this->_fileToUpload = (object) [ - 'file_type' => $files['file']['type'], - 'file_name' => $files['file']['name'], - 'tmp_name' => $files['file']['tmp_name'], + 'file_type' => $files['file']->getClientMediaType(), + 'file_name' => $files['file']->getClientFilename(), + 'tmp_name' => $files['file']->getStream()->getMetadata('uri'), 'size' => round($this->_bytes / 1048576, 0), 'inserted_by' => $this->_user->getData('UserID'), 'genomic_file_type' => empty($this->_values['fileType']) ? null : str_replace('_', ' ', $this->_values['fileType']), - 'description' => $this->_values['fileDescription'], + 'description' => $this->_values['fileDescription'] ?? '', ]; $this->setFullPath($this->_fileToUpload); From 1312f6eb0321f231ccd6fe0ac84a86b05b3e92ae Mon Sep 17 00:00:00 2001 From: Saagar Arya Date: Thu, 1 May 2025 16:02:19 -0400 Subject: [PATCH 4/7] Make linter happy --- .../genomic_browser/php/uploading/genomicfile.class.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/genomic_browser/php/uploading/genomicfile.class.inc b/modules/genomic_browser/php/uploading/genomicfile.class.inc index 830b1a95d3c..5f5ff9e501c 100644 --- a/modules/genomic_browser/php/uploading/genomicfile.class.inc +++ b/modules/genomic_browser/php/uploading/genomicfile.class.inc @@ -63,14 +63,15 @@ class Genomicfile ) { return false; } - $this->_user = $user; - $this->_bytes = $files['file']->getSize(); - $this->_values = $values; + $this->_user = $user; + $this->_bytes = $files['file']->getSize(); + $this->_values = $values; $this->_fileToUpload = (object) [ 'file_type' => $files['file']->getClientMediaType(), 'file_name' => $files['file']->getClientFilename(), - 'tmp_name' => $files['file']->getStream()->getMetadata('uri'), + 'tmp_name' => $files['file'] + ->getStream()->getMetadata('uri'), 'size' => round($this->_bytes / 1048576, 0), 'inserted_by' => $this->_user->getData('UserID'), 'genomic_file_type' => empty($this->_values['fileType']) ? From e109d178bd7bd4a89d16bcbfc84b780fadcc04be Mon Sep 17 00:00:00 2001 From: Saagar Arya Date: Fri, 2 May 2025 11:11:29 -0400 Subject: [PATCH 5/7] Fix tests --- modules/genomic_browser/help/genomic_browser.md | 6 ++---- modules/genomic_browser/jsx/tabs_content/snp.js | 8 ++++---- .../genomic_browser/php/uploading/genomicfile.class.inc | 2 +- modules/genomic_browser/test/genomic_browserTest.php | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/genomic_browser/help/genomic_browser.md b/modules/genomic_browser/help/genomic_browser.md index 87a911d919b..8d8a9f860b5 100644 --- a/modules/genomic_browser/help/genomic_browser.md +++ b/modules/genomic_browser/help/genomic_browser.md @@ -1,10 +1,8 @@ # Genomic Browser -This module is intended to allow users to visualize the results of already analyzed genetic tests cross-linked with behavioral and imaging candidate data. +This module allows you to visualize the results of already analyzed genetic tests cross-linked with behavioral and imaging candidate data. -The intended users are researchers and study personnel browsing and reviewing summary data. This module is a beta version which aims to present summary genomic data of several types so that researchers can usefully review and explore data available for study participants in a cross-modal context. SNP, CNV, and methylation (epigenomic) data are example types of data supported. - -Utilities are included for uploading and visualizing data, and these functions can be extended for additional data types. This module is not designed to replace existing databases designed for storing genomic data. +It is designed for researchers and study personnel who are browsing and reviewing summary data. This module presents summary genomic data of several types, enabling you to review and explore data available for study participants in a cross-modal context. Supported data types include SNP, CNV, and methylation (epigenomic) data. ### Usage You can switch between the different tabs to view different types of genomic data. The tabs are: diff --git a/modules/genomic_browser/jsx/tabs_content/snp.js b/modules/genomic_browser/jsx/tabs_content/snp.js index 438d66ae602..1107d1d8202 100644 --- a/modules/genomic_browser/jsx/tabs_content/snp.js +++ b/modules/genomic_browser/jsx/tabs_content/snp.js @@ -198,10 +198,10 @@ class SNP extends Component { show: false, }, { - label: 'Name', + label: 'Gene Name', show: false, filter: { - name: 'Name', + name: 'Gene Name', type: 'text', }, }, @@ -223,10 +223,10 @@ class SNP extends Component { }, }, { - label: 'Name', + label: 'SNP Name', show: false, filter: { - name: 'Name', + name: 'SNP Name', type: 'text', }, }, diff --git a/modules/genomic_browser/php/uploading/genomicfile.class.inc b/modules/genomic_browser/php/uploading/genomicfile.class.inc index 5f5ff9e501c..30494e3f424 100644 --- a/modules/genomic_browser/php/uploading/genomicfile.class.inc +++ b/modules/genomic_browser/php/uploading/genomicfile.class.inc @@ -71,7 +71,7 @@ class Genomicfile 'file_type' => $files['file']->getClientMediaType(), 'file_name' => $files['file']->getClientFilename(), 'tmp_name' => $files['file'] - ->getStream()->getMetadata('uri'), + ->getStream()->getMetadata('uri'), 'size' => round($this->_bytes / 1048576, 0), 'inserted_by' => $this->_user->getData('UserID'), 'genomic_file_type' => empty($this->_values['fileType']) ? diff --git a/modules/genomic_browser/test/genomic_browserTest.php b/modules/genomic_browser/test/genomic_browserTest.php index db375340a59..6d8bb344f01 100644 --- a/modules/genomic_browser/test/genomic_browserTest.php +++ b/modules/genomic_browser/test/genomic_browserTest.php @@ -203,7 +203,7 @@ function testGenomicBrowserFiltersProfileTab() self::$display, self::$clear, 'No', - '5 rows' + 'displayed of 432' ); $this->_filterTest( From 2996338a7b8cecf8a874d800ef1cbfa01e413aae Mon Sep 17 00:00:00 2001 From: Saagar Arya Date: Fri, 2 May 2025 11:41:05 -0400 Subject: [PATCH 6/7] Try again --- modules/genomic_browser/jsx/tabs_content/profiles.js | 4 ---- .../php/provisioners/profileprovisioner.class.inc | 6 +++--- modules/genomic_browser/test/genomic_browserTest.php | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/genomic_browser/jsx/tabs_content/profiles.js b/modules/genomic_browser/jsx/tabs_content/profiles.js index 2b187ed0846..fd49d9f6a28 100644 --- a/modules/genomic_browser/jsx/tabs_content/profiles.js +++ b/modules/genomic_browser/jsx/tabs_content/profiles.js @@ -180,10 +180,6 @@ class Profiles extends Component { options: options.Cohorts, }, }, - { - label: 'Date of Birth', - show: false, - }, { label: 'External ID', show: false, diff --git a/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc b/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc index eef04310324..c71fb6a2d13 100644 --- a/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc +++ b/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc @@ -28,7 +28,7 @@ class ProfileProvisioner extends \LORIS\Data\Provisioners\DBObjectProvisioner LPAD(candidate.CandID, 10, '0') AS _DCCID, candidate.PSCID AS _PSCID, candidate.Sex AS _Sex, - subproj.title AS _Cohort, + cohort.title AS _Cohort, candidate.ExternalID AS _externalID, candidate.RegistrationCenterID as _centerID, candidate.RegistrationProjectID as _projectID, @@ -84,8 +84,8 @@ class ProfileProvisioner extends \LORIS\Data\Provisioners\DBObjectProvisioner JOIN candidate c ON c.ID=s.CandidateID GROUP BY c.CandID) AS cohort ON (cohort.CandID = candidate.CandID) - LEFT JOIN cohort AS subproj - ON (cohort.CohortID = subproj.CohortID) + LEFT JOIN cohort + ON (cohort.CohortID = cohort.CohortID) LEFT JOIN psc ON (psc.CenterID = candidate.RegistrationCenterID) WHERE candidate.Entity_type = 'Human' diff --git a/modules/genomic_browser/test/genomic_browserTest.php b/modules/genomic_browser/test/genomic_browserTest.php index 6d8bb344f01..db375340a59 100644 --- a/modules/genomic_browser/test/genomic_browserTest.php +++ b/modules/genomic_browser/test/genomic_browserTest.php @@ -203,7 +203,7 @@ function testGenomicBrowserFiltersProfileTab() self::$display, self::$clear, 'No', - 'displayed of 432' + '5 rows' ); $this->_filterTest( From 71b5b68911b0fde9d642d23794e11503725c85e4 Mon Sep 17 00:00:00 2001 From: Saagar Arya Date: Fri, 2 May 2025 12:18:45 -0400 Subject: [PATCH 7/7] Undo change to sql --- .../php/provisioners/profileprovisioner.class.inc | 6 +++--- .../php/provisioners/snpprovisioner.class.inc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc b/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc index c71fb6a2d13..eef04310324 100644 --- a/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc +++ b/modules/genomic_browser/php/provisioners/profileprovisioner.class.inc @@ -28,7 +28,7 @@ class ProfileProvisioner extends \LORIS\Data\Provisioners\DBObjectProvisioner LPAD(candidate.CandID, 10, '0') AS _DCCID, candidate.PSCID AS _PSCID, candidate.Sex AS _Sex, - cohort.title AS _Cohort, + subproj.title AS _Cohort, candidate.ExternalID AS _externalID, candidate.RegistrationCenterID as _centerID, candidate.RegistrationProjectID as _projectID, @@ -84,8 +84,8 @@ class ProfileProvisioner extends \LORIS\Data\Provisioners\DBObjectProvisioner JOIN candidate c ON c.ID=s.CandidateID GROUP BY c.CandID) AS cohort ON (cohort.CandID = candidate.CandID) - LEFT JOIN cohort - ON (cohort.CohortID = cohort.CohortID) + LEFT JOIN cohort AS subproj + ON (cohort.CohortID = subproj.CohortID) LEFT JOIN psc ON (psc.CenterID = candidate.RegistrationCenterID) WHERE candidate.Entity_type = 'Human' diff --git a/modules/genomic_browser/php/provisioners/snpprovisioner.class.inc b/modules/genomic_browser/php/provisioners/snpprovisioner.class.inc index a3fd0cd7033..7c53f760434 100644 --- a/modules/genomic_browser/php/provisioners/snpprovisioner.class.inc +++ b/modules/genomic_browser/php/provisioners/snpprovisioner.class.inc @@ -28,7 +28,7 @@ class SnpProvisioner extends \LORIS\Data\Provisioners\DBObjectProvisioner LPAD(candidate.CandID, 10, '0') AS _DCCID, candidate.PSCID AS _PSCID, candidate.Sex AS _Sex, - subproj.title AS _Cohort, + cohort.title AS _Cohort, candidate.ExternalID AS _externalID, candidate.RegistrationCenterID as _centerID, candidate.RegistrationProjectID as _projectID, @@ -65,8 +65,8 @@ class SnpProvisioner extends \LORIS\Data\Provisioners\DBObjectProvisioner JOIN candidate c ON c.ID=s.CandidateID GROUP BY c.CandID) AS cohort ON (cohort.CandID = candidate.CandID) - LEFT JOIN cohort AS subproj - ON (cohort.CohortID = subproj.CohortID) + LEFT JOIN cohort + ON (cohort.CohortID = CohortID) LEFT JOIN psc ON (psc.CenterID = candidate.RegistrationCenterID) JOIN SNP_candidate_rel ON (candidate.ID = SNP_candidate_rel.CandidateID)