diff --git a/resources/etls/LoadApplication.xml b/resources/etls/LoadApplication.xml index 9892921e9..bbb1b4de7 100644 --- a/resources/etls/LoadApplication.xml +++ b/resources/etls/LoadApplication.xml @@ -106,6 +106,15 @@ + + + + + + + + + diff --git a/resources/queries/cds/ds_bcr_sequence_study.sql b/resources/queries/cds/ds_bcr_sequence_study.sql new file mode 100644 index 000000000..86ad79ca3 --- /dev/null +++ b/resources/queries/cds/ds_bcr_sequence_study.sql @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2015-2025 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +SELECT + subject_id AS participantid, + CAST(study_day AS DOUBLE) AS sequencenum, + study_day AS visit_day, + prot AS study_prot, + prot, + specimen_type, + bcr_study_seq_id, + lab_code, + seq_method, + assay_identifier, + plate, + well + +FROM cds.import_bcr_sequence_study \ No newline at end of file diff --git a/resources/schemas/cds.xml b/resources/schemas/cds.xml index d0fd8d99d..9d76e1074 100644 --- a/resources/schemas/cds.xml +++ b/resources/schemas/cds.xml @@ -2241,24 +2241,26 @@ - +
- +
- +
- + + +
diff --git a/resources/schemas/dbscripts/postgresql/cds-25.000-25.001.sql b/resources/schemas/dbscripts/postgresql/cds-25.000-25.001.sql new file mode 100644 index 000000000..b573b0153 --- /dev/null +++ b/resources/schemas/dbscripts/postgresql/cds-25.000-25.001.sql @@ -0,0 +1,19 @@ +-- drop constraints to cds.pab_sequence +ALTER TABLE cds.pab_sequence DROP CONSTRAINT PK_pab_sequence; +ALTER TABLE cds.pab_sequence DROP CONSTRAINT FK_pab_sequence_sequence_id; +DROP INDEX IF EXISTS cds.IX_pab_sequence_sequence_id; + +ALTER TABLE cds.pab_sequence RENAME COLUMN pab_id TO bcr_study_seq_id; +ALTER TABLE cds.pab_sequence RENAME TO bcr_sequence; + +-- re-add constraints +ALTER TABLE cds.bcr_sequence ADD CONSTRAINT PK_bcr_sequence PRIMARY KEY (bcr_study_seq_id, sequence_id, container); +ALTER TABLE cds.bcr_sequence ADD CONSTRAINT FK_bcr_sequence_sequence_id FOREIGN KEY (sequence_id) REFERENCES cds.sequence (sequence_id); +CREATE INDEX IX_bcr_sequence_sequence_id ON cds.bcr_sequence(sequence_id); + +-- rename cds.pab_sequence_study +ALTER TABLE cds.pab_sequence_study DROP CONSTRAINT UQ_prot_subject_study_specimen_pab; +ALTER TABLE cds.pab_sequence_study RENAME COLUMN pab_id TO bcr_study_seq_id; +ALTER TABLE cds.pab_sequence_study ADD COLUMN plate VARCHAR(100); +ALTER TABLE cds.pab_sequence_study ADD COLUMN well VARCHAR(100); +ALTER TABLE cds.pab_sequence_study RENAME TO import_bcr_sequence_study; \ No newline at end of file diff --git a/src/org/labkey/cds/CDSManager.java b/src/org/labkey/cds/CDSManager.java index 90b5e549b..a86ae7e48 100644 --- a/src/org/labkey/cds/CDSManager.java +++ b/src/org/labkey/cds/CDSManager.java @@ -219,9 +219,9 @@ public void cleanContainer(Container c) "import_virus_synonym", "import_virus_metadata_all", "import_assay_combined_antigen_metadata", + "import_bcr_sequence_study", - "pab_sequence", - "pab_sequence_study", + "bcr_sequence", "antibody_structure", "sequence_header", "sequence_germline", diff --git a/src/org/labkey/cds/CDSModule.java b/src/org/labkey/cds/CDSModule.java index 66dd75d66..e2b38e54e 100644 --- a/src/org/labkey/cds/CDSModule.java +++ b/src/org/labkey/cds/CDSModule.java @@ -106,7 +106,7 @@ public String getName() @Override public @Nullable Double getSchemaVersion() { - return 25.000; + return 25.001; } @Override diff --git a/src/org/labkey/cds/data/steps/CDSImportTask.java b/src/org/labkey/cds/data/steps/CDSImportTask.java index 434e0a39a..e6fcc6f21 100644 --- a/src/org/labkey/cds/data/steps/CDSImportTask.java +++ b/src/org/labkey/cds/data/steps/CDSImportTask.java @@ -31,8 +31,7 @@ public class CDSImportTask extends ImportTask new CDSImportCopyConfig("sequence_germline"), new CDSImportCopyConfig("preferred_allele"), new CDSImportCopyConfig("antibody_class"), - new CDSImportCopyConfig("pab_sequence"), - new CDSImportCopyConfig("pab_sequence_study"), + new CDSImportCopyConfig("bcr_sequence"), // Core Tables new CDSImportCopyConfig("import_Study", "Study"), @@ -93,6 +92,7 @@ public class CDSImportTask extends ImportTask new CDSImportCopyConfig("import_BAMA", "AssayBAMA"), new CDSImportCopyConfig("import_NABMAb", "AssayNABMAb"), new CDSImportCopyConfig("import_PKMAb", "AssayPKMAb"), + new CDSImportCopyConfig("import_bcr_sequence_study", "bcr_sequence_study"), // Virus data new CDSImportCopyConfig("import_Virus_Metadata_All", "Virus_Metadata_All"), diff --git a/test/sampledata/dataspace/MasterDataspace/study/datasets/datasets_manifest.xml b/test/sampledata/dataspace/MasterDataspace/study/datasets/datasets_manifest.xml index 733118835..a3878a546 100644 --- a/test/sampledata/dataspace/MasterDataspace/study/datasets/datasets_manifest.xml +++ b/test/sampledata/dataspace/MasterDataspace/study/datasets/datasets_manifest.xml @@ -22,5 +22,8 @@ + + + \ No newline at end of file diff --git a/test/sampledata/dataspace/MasterDataspace/study/datasets/datasets_metadata.xml b/test/sampledata/dataspace/MasterDataspace/study/datasets/datasets_metadata.xml index b4037df52..473d28aa8 100644 --- a/test/sampledata/dataspace/MasterDataspace/study/datasets/datasets_metadata.xml +++ b/test/sampledata/dataspace/MasterDataspace/study/datasets/datasets_metadata.xml @@ -1781,4 +1781,95 @@ PK MAb + + Contains up to one row of BCR Sequence data for each Subject/VisitTime combination. + + + varchar + Subject Id + Unique ID assigned to a subject for a given study. + http://cpas.labkey.com/Study#ParticipantId + false + + ptid + + + study + Subject + SubjectId + + + + double + Sequence Num + http://cpas.labkey.com/Study#SequenceNum + false + + visit + visitid + + + + timestamp + Date + http://cpas.labkey.com/Study#VisitDate + + + integer + Visit Day + http://www.w3.org/2001/XMLSchema#int + Target study day defined for a study visit. Study days are relative to Day 0, where Day 0 is typically defined as enrollment and/or first injection. + false + + + integer + Third Key + http://www.w3.org/2001/XMLSchema#int + true + true + true + + + varchar + Study Protocol + Study protocol + http://www.w3.org/2001/XMLSchema#string + true + + + varchar + Specimen type + http://www.w3.org/2001/XMLSchema#string + true + + + varchar + http://www.w3.org/2001/XMLSchema#string + + + varchar + http://www.w3.org/2001/XMLSchema#string + + + varchar + http://www.w3.org/2001/XMLSchema#string + + + varchar + Assay identifier + Name identifying assay + http://www.w3.org/2001/XMLSchema#string + true + + + varchar + http://www.w3.org/2001/XMLSchema#string + + + varchar + http://www.w3.org/2001/XMLSchema#string + + + BCR Sequence +
\ No newline at end of file diff --git a/test/sampledata/dataspace/cdsimport/pab_sequence.csv b/test/sampledata/dataspace/cdsimport/bcr_sequence.csv similarity index 80% rename from test/sampledata/dataspace/cdsimport/pab_sequence.csv rename to test/sampledata/dataspace/cdsimport/bcr_sequence.csv index 08affc7b4..203e9bb27 100644 --- a/test/sampledata/dataspace/cdsimport/pab_sequence.csv +++ b/test/sampledata/dataspace/cdsimport/bcr_sequence.csv @@ -1,4 +1,4 @@ -sequence_id,pab_id +sequence_id,bcr_study_seq_id cds_seq_1,pab_id-1 cds_seq_1,pab_id-2 cds_seq_10,pab_id-1 diff --git a/test/sampledata/dataspace/cdsimport/pab_sequence_study.csv b/test/sampledata/dataspace/cdsimport/bcr_sequence_study.csv similarity index 56% rename from test/sampledata/dataspace/cdsimport/pab_sequence_study.csv rename to test/sampledata/dataspace/cdsimport/bcr_sequence_study.csv index 277f59ee4..3b5b4e367 100644 --- a/test/sampledata/dataspace/cdsimport/pab_sequence_study.csv +++ b/test/sampledata/dataspace/cdsimport/bcr_sequence_study.csv @@ -1,4 +1,4 @@ -prot,subject_id,study_day,specimen_type,pab_id,lab_code,seq_method,assay_identifier +prot,subject_id,study_day,specimen_type,bcr_study_seq_id,lab_code,seq_method,assay_identifier q2,q2-044,1,human,pab_id_1,LC1,NA,AI-1 r1,r1-032,2,human,pab_id_2,LC2,NA,AI-1 z101,z101-041,3,human,pab_id_3,LC3,NA,AI-1 \ No newline at end of file