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
1 change: 1 addition & 0 deletions mcc/resources/etls/mcc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<column>usage_future</column>
<column>date_of_observations</column>
<column>colony</column>
<column>source</column>
<column>dam</column>
<column>sire</column>
<column>objectid</column>
Expand Down
4 changes: 2 additions & 2 deletions mcc/resources/queries/study/demographicsLittermates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ SELECT
d1.Id,
d1.litterId,

(SELECT GROUP_CONCAT(distinct d2.Id, ',') as litterMates FROM study.Demographics d2 WHERE d2.qcstate.publicdata = true AND d1.litterId = d2.litterId AND d1.id != d2.id) as litterMates
(SELECT GROUP_CONCAT(distinct d2.Id, ',') as litterMates FROM study.Demographics d2 WHERE d2.qcstate.publicdata = true AND d2.litterId IS NOT NULL AND d1.litterId = d2.litterId AND d1.id != d2.id) as litterMates

FROM study.Demographics d1

WHERE d1.qcstate.publicdata = true
WHERE d1.qcstate.publicdata = true AND d1.litterId IS NOT NULL
29 changes: 29 additions & 0 deletions mcc/resources/queries/study/demographicsMccTransfer.query.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="demographicsMccTransfer" tableDbType="NOT_IN_DB">
<tableTitle>MCC Transfers</tableTitle>
<description>Summary of MCC Transfers</description>
<columns>
<column columnName="Id">
<isKeyField>true</isKeyField>
<isHidden>true</isHidden>
</column>
<column columnName="mccRequestId">
<columnTitle>MCC Request ID</columnTitle>
</column>
<column columnName="piLastName">
<columnTitle>PI Last Name</columnTitle>
</column>
<column columnName="piFirstName">
<columnTitle>PI First Name</columnTitle>
</column>
<column columnName="piInstitution">
<columnTitle>PI Institution</columnTitle>
</column>
</columns>
<titleColumn>mccRequestId</titleColumn>
</table>
</tables>
</metadata>
</query>
9 changes: 9 additions & 0 deletions mcc/resources/queries/study/demographicsMccTransfer.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SELECT
d.Id,
GROUP_CONCAT(DISTINCT d.mccRequestId.rowId, ', ') as mccRequestId,
GROUP_CONCAT(DISTINCT d.mccRequestId.lastName, char(10)) as piLastName,
GROUP_CONCAT(DISTINCT d.mccRequestId.firstName, char(10)) as piFirstName,
GROUP_CONCAT(DISTINCT d.mccRequestId.institutionname, char(10)) as piInstitution
FROM study.departure d
WHERE d.qcstate.publicdata = true AND d.mccRequestId IS NOT NULL
GROUP BY d.Id
12 changes: 10 additions & 2 deletions mcc/src/org/labkey/mcc/etl/ProjectAssignmentTransform.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class ProjectAssignmentTransform extends ColumnTransform
private static final String U24_BREEDER = "U24 breeder";
private static final String U24_OFFSPRING = "U24 offspring";
private static final String U24_OTHER = "Other";
private static final String U24_INACTIVE = "U24 marmoset breeding- INACTIVE -";

@Override
protected Object doTransform(Object inputValue)
Expand All @@ -42,6 +43,10 @@ protected Object doTransform(Object inputValue)
{
return getOrCreateFlag(U24_TITLE);
}
else if (U24_INACTIVE.equalsIgnoreCase(String.valueOf(inputValue)))
{
return getOrCreateFlag(U24_INACTIVE);
}
// SNPRC:
else if (U24_BREEDER.equalsIgnoreCase(String.valueOf(inputValue)))
{
Expand All @@ -51,8 +56,11 @@ else if (U24_OFFSPRING.equalsIgnoreCase(String.valueOf(inputValue)))
{
return getOrCreateFlag(U24_OFFSPRING);
}

return inputValue;
else
{
_log.error("Unknown flag value: " + inputValue + ", in folder: " + getContainerUser().getContainer().getPath());
return null;
}
}

private String getOrCreateFlag(String type)
Expand Down
36 changes: 35 additions & 1 deletion mcc/src/org/labkey/mcc/query/MccEhrCustomizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
import org.labkey.api.query.FieldKey;
import org.labkey.api.query.LookupForeignKey;
import org.labkey.api.query.QueryForeignKey;
import org.labkey.api.query.QueryService;
import org.labkey.api.query.UserSchema;
import org.labkey.api.security.User;
import org.labkey.mcc.MccManager;
import org.labkey.mcc.MccSchema;
import org.labkey.mcc.security.MccRequestAdminPermission;

public class MccEhrCustomizer extends AbstractTableCustomizer
{
Expand Down Expand Up @@ -141,6 +142,39 @@ private void customizeAnimalTable(AbstractTableInfo ti)
col.setDescription("Summary of genomic data");
ti.addColumn(col);
}

// Only allow this for authorized users:
possiblyAddRequestSummary(ti);
}

private void possiblyAddRequestSummary(AbstractTableInfo ti)
{
if (ti.getColumn("mccTransfers") != null)
{
return;
}

Container animalDataContainer = MccManager.get().getMCCContainer(ti.getUserSchema().getContainer());
if (animalDataContainer == null)
{
return;
}

if (!animalDataContainer.equals(ti.getUserSchema().getContainer()))
{
return;
}

User u = ti.getUserSchema().getUser();
if (!animalDataContainer.hasPermission(u, MccRequestAdminPermission.class))
{
return;
}

var col = getWrappedIdCol(ti.getUserSchema(), ti, "mccTransfers", "demographicsMccTransfer");
col.setLabel("MCC Transfers");
col.setDescription("Summarizes MCC Transfer Information");
ti.addColumn(col);
}

private BaseColumnInfo getWrappedIdCol(UserSchema us, AbstractTableInfo ds, String name, String queryName)
Expand Down
26 changes: 0 additions & 26 deletions tcrdb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,12 @@ repositories {
mavenCentral()
}

configurations.all {
resolutionStrategy {
// Related to: https://nvd.nist.gov/vuln/detail/CVE-2025-12183
dependencySubstitution {
substitute module('org.lz4:lz4-java') using module("at.yawk.lz4:lz4-java:${lz4Version}")
}
}
}

dependencies {
BuildUtils.addLabKeyDependency(project: project, config: "implementation", depProjectPath: ":server:modules:DiscvrLabKeyModules:singlecell", depProjectConfig: "apiJarFile")
BuildUtils.addLabKeyDependency(project: project, config: "implementation", depProjectPath: ":server:modules:DiscvrLabKeyModules:SequenceAnalysis", depProjectConfig: "apiJarFile")
BuildUtils.addLabKeyDependency(project: project, config: "implementation", depProjectPath: ":server:modules:LabDevKitModules:laboratory", depProjectConfig: "apiJarFile")
BuildUtils.addLabKeyDependency(project: project, config: "implementation", depProjectPath: ":server:modules:LabDevKitModules:LDK", depProjectConfig: "apiJarFile")
BuildUtils.addLabKeyDependency(project: project, config: "implementation", depProjectPath: BuildUtils.getPlatformModuleProjectPath(project.gradle, "assay"), depProjectConfig: "apiJarFile")
BuildUtils.addExternalDependency(
project,
new ExternalDependency(
"io.repseq:repseqio:${repseqVersion}",
"repseqio",
"repseqio",
"https://github.com/repseqio/repseqio",
ExternalDependency.APACHE_2_LICENSE_NAME,
ExternalDependency.APACHE_2_LICENSE_URL,
"TCR Analysis"
),
{
// exclude logback to prevent excessive logging
exclude group: "ch.qos.logback", module :"logback-classic"
exclude group: "ch.qos.logback", module :"logback-core"
}
)
implementation "com.github.samtools:htsjdk:${htsjdkVersion}"
implementation "net.sf.opencsv:opencsv:${opencsvVersion}"

Expand Down
2 changes: 0 additions & 2 deletions tcrdb/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
lz4Version=1.10.1
repseqVersion=1.7.0
3 changes: 0 additions & 3 deletions tcrdb/resources/assay/TCRdb/queries/Data.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@
<item text="View Alignments">
<onClick>TCRdb.window.ExportDataWindow.viewAlignmentHandler(dataRegionName, arguments[0] ? arguments[0].ownerCt : null);</onClick>
</item>
<item text="Download Clone Materials">
<onClick>TCRdb.window.DownloadCloneWindow.buttonHandler(dataRegionName);</onClick>
</item>
<item text="Download Clone Sequence">
<onClick>TCRdb.window.DownloadCloneWindow.downloadSequenceHandler(dataRegionName);</onClick>
</item>
Expand Down
4 changes: 0 additions & 4 deletions tcrdb/resources/web/tcrdb/window/DownloadCloneWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ Ext4.define('TCRdb.window.DownloadCloneWindow', {
extend: 'Ext.window.Window',

statics: {
buttonHandler: function(dataRegionName) {
TCRdb.window.DownloadCloneWindow.showWindow(dataRegionName, 'downloadCloneMaterials', 'The goal of this is to download a ZIP with any extracted clone/read data for the selected sample(s), along with the reference sequence for the segments used. These files can be imported into Geneious or a similar program to de novo assemble to construct the FL clone. Note: per sample, it will export all reads overlapping any TCR segments. This at minimum will tend to include both chains (i.e. 2 different CDR3s), and might include reads that either match a defunct TCR or other noise.');
},

downloadSequenceHandler: function(dataRegionName){
TCRdb.window.DownloadCloneWindow.showWindow(dataRegionName, 'downloadSequence', 'This will download the full sequence (if available) for the selected rows, along with the reference segments.');
},
Expand Down
Loading