Skip to content
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
9 changes: 9 additions & 0 deletions resources/etls/LoadApplication.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@
</settings>
</taskref>
</transform>
<transform id="PopulateBCRsequence" type="TaskrefTransformStep">
<taskref ref="org.labkey.cds.data.steps.PopulateDatasetTask">
<settings>
<setting name="sourceSchema" value="cds"/>
<setting name="sourceQuery" value="ds_bcr_sequence_study"/>
<setting name="targetDataset" value="BCR_sequence" />
</settings>
</taskref>
</transform>
<transform id="PopulateAssay" type="TaskrefTransformStep">
<taskref ref="org.labkey.cds.data.steps.PopulateAssayTask">
</taskref>
Expand Down
30 changes: 30 additions & 0 deletions resources/queries/cds/ds_bcr_sequence_study.sql
Original file line number Diff line number Diff line change
@@ -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
10 changes: 6 additions & 4 deletions resources/schemas/cds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2241,24 +2241,26 @@
<column columnName="container"/>
</columns>
</table>
<table tableName="pab_sequence" tableDbType="TABLE">
<table tableName="bcr_sequence" tableDbType="TABLE">
<columns>
<column columnName="pab_id"/>
<column columnName="bcr_study_seq_id"/>
<column columnName="sequence_id"/>
<column columnName="container"/>
</columns>
</table>
<table tableName="pab_sequence_study" tableDbType="TABLE">
<table tableName="import_bcr_sequence_study" tableDbType="TABLE">
<columns>
<column columnName="row_id"/>
<column columnName="prot"/>
<column columnName="subject_id"/>
<column columnName="study_day"/>
<column columnName="specimen_type"/>
<column columnName="pab_id"/>
<column columnName="bcr_study_seq_id"/>
<column columnName="lab_code"/>
<column columnName="seq_method"/>
<column columnName="assay_identifier"/>
<column columnName="plate"/>
<column columnName="well"/>
<column columnName="container"/>
</columns>
</table>
Expand Down
19 changes: 19 additions & 0 deletions resources/schemas/dbscripts/postgresql/cds-25.000-25.001.sql
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions src/org/labkey/cds/CDSManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/org/labkey/cds/CDSModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public String getName()
@Override
public @Nullable Double getSchemaVersion()
{
return 25.000;
return 25.001;
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/org/labkey/cds/data/steps/CDSImportTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
<dataset name="PKMAb" id="5008" type="Standard">
<tags/>
</dataset>
<dataset name="BCR_Sequence" id="5009" type="Standard">
<tags/>
</dataset>
</datasets>
</datasets>
Original file line number Diff line number Diff line change
Expand Up @@ -1781,4 +1781,95 @@
</columns>
<tableTitle>PK MAb</tableTitle>
</table>
<table tableName="BCR_Sequence" tableDbType="TABLE">
<description>Contains up to one row of BCR Sequence data for each Subject/VisitTime combination.</description>
<columns>
<column columnName="SubjectId">
<datatype>varchar</datatype>
<columnTitle>Subject Id</columnTitle>
<description>Unique ID assigned to a subject for a given study.</description>
<propertyURI>http://cpas.labkey.com/Study#ParticipantId</propertyURI>
<nullable>false</nullable>
<importAliases>
<importAlias>ptid</importAlias>
</importAliases>
<fk>
<fkDbSchema>study</fkDbSchema>
<fkTable>Subject</fkTable>
<fkColumnName>SubjectId</fkColumnName>
</fk>
</column>
<column columnName="SequenceNum">
<datatype>double</datatype>
<columnTitle>Sequence Num</columnTitle>
<propertyURI>http://cpas.labkey.com/Study#SequenceNum</propertyURI>
<nullable>false</nullable>
<importAliases>
<importAlias>visit</importAlias>
<importAlias>visitid</importAlias>
</importAliases>
</column>
<column columnName="date">
<datatype>timestamp</datatype>
<columnTitle>Date</columnTitle>
<propertyURI>http://cpas.labkey.com/Study#VisitDate</propertyURI>
</column>
<column columnName="visit_day">
<datatype>integer</datatype>
<columnTitle>Visit Day</columnTitle>
<rangeURI>http://www.w3.org/2001/XMLSchema#int</rangeURI>
<description>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.</description>
<measure>false</measure>
</column>
<column columnName="third_key">
<datatype>integer</datatype>
<columnTitle>Third Key</columnTitle>
<rangeURI>http://www.w3.org/2001/XMLSchema#int</rangeURI>
<isHidden>true</isHidden>
<isKeyField>true</isKeyField>
<isAutoInc>true</isAutoInc>
</column>
<column columnName="study_prot">
<datatype>varchar</datatype>
<columnTitle>Study Protocol</columnTitle>
<description>Study protocol</description>
<rangeURI>http://www.w3.org/2001/XMLSchema#string</rangeURI>
<dimension>true</dimension>
</column>
<column columnName="specimen_type">
<datatype>varchar</datatype>
<columnTitle>Specimen type</columnTitle>
<rangeURI>http://www.w3.org/2001/XMLSchema#string</rangeURI>
<dimension>true</dimension>
</column>
<column columnName="bcr_study_seq_id">
<datatype>varchar</datatype>
<rangeURI>http://www.w3.org/2001/XMLSchema#string</rangeURI>
</column>
<column columnName="lab_code">
<datatype>varchar</datatype>
<rangeURI>http://www.w3.org/2001/XMLSchema#string</rangeURI>
</column>
<column columnName="seq_method">
<datatype>varchar</datatype>
<rangeURI>http://www.w3.org/2001/XMLSchema#string</rangeURI>
</column>
<column columnName="assay_identifier">
<datatype>varchar</datatype>
<columnTitle>Assay identifier</columnTitle>
<description>Name identifying assay</description>
<rangeURI>http://www.w3.org/2001/XMLSchema#string</rangeURI>
<dimension>true</dimension>
</column>
<column columnName="plate">
<datatype>varchar</datatype>
<rangeURI>http://www.w3.org/2001/XMLSchema#string</rangeURI>
</column>
<column columnName="well">
<datatype>varchar</datatype>
<rangeURI>http://www.w3.org/2001/XMLSchema#string</rangeURI>
</column>
</columns>
<tableTitle>BCR Sequence</tableTitle>
</table>
</tables>
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Loading