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

lengthen sample stable id field #9404

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions core/src/main/scripts/importer/validateData.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
# Global variable for the regex that checks hexadecimal colors
COLOR_REGEX = re.compile("^#[a-fA-F0-9]{6}$")

# global character limit on sample stable ids
MAX_SAMPLE_STABLE_ID_LENGTH = 63

# ----------------------------------------------------------------------------

VALIDATOR_IDS = {
Expand Down Expand Up @@ -2667,6 +2670,14 @@ def checkLine(self, data):
'column_number': col_index + 1,
'cause': value})
continue
if len(value.strip()) > MAX_SAMPLE_STABLE_ID_LENGTH:
Copy link
Member

Choose a reason for hiding this comment

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

Thank you! We've run into this a few times.

self.logger.error(
'SAMPLE_ID too long (%s character maximum)' % (MAX_SAMPLE_STABLE_ID_LENGTH),
extra={'line_number': self.line_number,
'column_number': col_index + 1,
'cause': value})
continue

if value in self.sample_id_lines:
if value.startswith('TCGA-'):
self.logger.warning(
Expand Down
4 changes: 2 additions & 2 deletions db-scripts/src/main/resources/cgds.sql
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ CREATE TABLE `patient` (
-- --------------------------------------------------------
CREATE TABLE `sample` (
`INTERNAL_ID` int(11) NOT NULL auto_increment,
`STABLE_ID` varchar(50) NOT NULL,
`STABLE_ID` varchar(63) NOT NULL,
`SAMPLE_TYPE` varchar(255) NOT NULL,
`PATIENT_ID` int(11) NOT NULL,
PRIMARY KEY (`INTERNAL_ID`),
Expand Down Expand Up @@ -757,4 +757,4 @@ CREATE TABLE `resource_study` (
);

-- THIS MUST BE KEPT IN SYNC WITH db.version PROPERTY IN pom.xml
INSERT INTO info VALUES ('2.12.12', NULL);
INSERT INTO info VALUES ('2.12.13', NULL);
2 changes: 1 addition & 1 deletion db-scripts/src/main/resources/gen-cgds-test-schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# author: ochoaa
# last update: 2019/02/13

CGDS_SCHEMA_FILE=$(find . -type f -name "*cgds.sql" | grep -v target)
CGDS_SCHEMA_FILE=$(find . -type f -name "cgds.sql" | grep -v target)
DIR=$(dirname $CGDS_SCHEMA_FILE)
CGDS_TEST_SCHEMA_FILE=$DIR/cgds-test.sql
grep -v "KEY_MUTATION_EVENT_DETAILS" $CGDS_SCHEMA_FILE > $CGDS_TEST_SCHEMA_FILE
Expand Down
4 changes: 4 additions & 0 deletions db-scripts/src/main/resources/migration.sql
Original file line number Diff line number Diff line change
Expand Up @@ -973,3 +973,7 @@ ALTER TABLE `reference_genome_gene` DROP COLUMN `EXONIC_LENGTH`;
-- changes for issue 9032
ALTER TABLE `genetic_entity` MODIFY COLUMN `STABLE_ID` VARCHAR(255) DEFAULT NULL;
UPDATE `info` SET `DB_SCHEMA_VERSION`="2.12.12";

##version: 2.12.13
ALTER TABLE `sample` MODIFY COLUMN `STABLE_ID` VARCHAR(63) NOT NULL;
UPDATE `info` SET `DB_SCHEMA_VERSION`="2.12.13";
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
<tomcat.session.timeout>720</tomcat.session.timeout>

<!-- THIS SHOULD BE KEPT IN SYNC TO VERSION IN CGDS.SQL -->
<db.version>2.12.12</db.version>
<db.version>2.12.13</db.version>
</properties>

<modules>
Expand Down