Skip to content

Commit 4e69601

Browse files
authored
Merge pull request #400 from LabKey/fb_merge_25.7_to_develop
Merge 25.7 to develop
2 parents dbdca95 + f668cfb commit 4e69601

File tree

12 files changed

+159
-19
lines changed

12 files changed

+159
-19
lines changed

SequenceAnalysis/pipeline_code/extra_tools_install.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,20 @@ then
333333
else
334334
echo "Already installed"
335335
fi
336+
337+
338+
if [[ ! -e ${LKTOOLS_DIR}/primer3_core || ! -z $FORCE_REINSTALL ]];
339+
then
340+
echo "Cleaning up previous installs"
341+
rm -Rf $LKTOOLS_DIR/primer3_core*
342+
rm -Rf primer3*
343+
rm -Rf v2.6.1.tar.gz
344+
345+
wget https://github.com/primer3-org/primer3/archive/refs/tags/v2.6.1.tar.gz
346+
tar -xf v2.6.1.tar.gz
347+
cd primer3-2.6.1/src
348+
make
349+
install primer3_core $LKTOOLS_DIR/
350+
else
351+
echo "Already installed"
352+
fi

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/preprocessing/TagPcrSummaryStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public Provider()
7272
put("checked", true);
7373
}}, true),
7474
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.create("--insert-name"), "insertType", "Insert Type", "The type of insert to detect.", "ldk-simplecombo", new JSONObject(){{
75-
put("storeValues", "PiggyBac;Lentivirus;PREDICT");
75+
put("storeValues", "PiggyBac;Lentivirus;PREDICT;BxBI_attP");
7676
put("allowBlank", false);
7777
}}, null),
7878
ToolParameterDescriptor.create(DESIGN_PRIMERS, "Design Primers", "If selected, Primer3 will be used to design primers to flank integration sites", "checkbox", new JSONObject(){{
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<customView xmlns="http://labkey.org/data/xml/queryCustomView" hidden="false" canOverride="false">
2+
<columns>
3+
<column name="rowId"/>
4+
<column name="studyId"/>
5+
<column name="studyId/description">
6+
<properties>
7+
<property name="columnTitle" value="Study Description"/>
8+
</properties>
9+
</column>
10+
<column name="cohortName"/>
11+
<column name="label"/>
12+
<column name="category"/>
13+
<column name="description"/>
14+
<column name="isControlGroup"/>
15+
<column name="sortOrder"/>
16+
</columns>
17+
<sorts>
18+
<sort column="studyId/studyName" descending="false"/>
19+
<sort column="sortOrder" descending="false"/>
20+
<sort column="cohortName" descending="false"/>
21+
</sorts>
22+
</customView>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE studies.subjectAnchorDates ADD COLUMN sourceRecord varchar(1000);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE studies.subjectAnchorDates ADD sourceRecord varchar(1000);

Studies/resources/schemas/studies.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,10 @@
526526
<fkDisplayColumnName>label</fkDisplayColumnName>
527527
</fk>
528528
</column>
529+
<column columnName="sourceRecord">
530+
<columnTitle>Source Record</columnTitle>
531+
<isHidden>true</isHidden>
532+
</column>
529533
<column columnName="dataSource">
530534
<columnTitle>Data Source</columnTitle>
531535
</column>

Studies/src/org/labkey/studies/StudiesModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public String getName()
3434
@Override
3535
public @Nullable Double getSchemaVersion()
3636
{
37-
return 23.005;
37+
return 23.006;
3838
}
3939

4040
@Override

Studies/src/org/labkey/studies/query/StudiesTriggerFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ private void possiblyResolveStudyOrCohort(String tableToQuery, @Nullable Map<Str
9393
return;
9494
}
9595

96+
if (row.get(sourceProperty) instanceof Integer)
97+
{
98+
return;
99+
}
100+
96101
if (row.get(sourceProperty) != null & row.get(sourceProperty) instanceof String & !String.valueOf(row.get(sourceProperty)).isEmpty())
97102
{
98103
if (!NumberUtils.isCreatable(row.get(sourceProperty).toString()))

singlecell/resources/chunks/StudyMetadata.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ for (datasetId in names(seuratObjects)) {
3232
seuratObj <- Rdiscvr::ApplyEC_Metadata(seuratObj, errorIfUnknownIdsFound = errorIfUnknownIdsFound)
3333
} else if (studyName == 'PPG_Stims') {
3434
seuratObj <- Rdiscvr::ApplyPPG_Stim_Metadata(seuratObj, errorIfUnknownIdsFound = errorIfUnknownIdsFound)
35-
] else if (studyName == 'IMPAC_TB_Human') {
35+
} else if (studyName == 'IMPAC_TB_Human') {
3636
seuratObj <- Rdiscvr::ApplyIMPAC_TB_Human_Metadata(seuratObj, errorIfUnknownIdsFound = errorIfUnknownIdsFound)
3737
} else {
3838
stop(paste0('Unknown study: ', studyName))

singlecell/src/org/labkey/singlecell/run/CellRangerGexCountStep.java

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.apache.commons.io.FileUtils;
66
import org.apache.commons.lang3.StringUtils;
77
import org.apache.commons.lang3.tuple.Pair;
8+
import org.apache.logging.log4j.Logger;
89
import org.jetbrains.annotations.Nullable;
910
import org.json.JSONObject;
1011
import org.labkey.api.collections.CaseInsensitiveHashMap;
@@ -47,15 +48,19 @@
4748
import org.labkey.api.writer.PrintWriters;
4849
import org.labkey.singlecell.SingleCellSchema;
4950

51+
import java.io.BufferedReader;
5052
import java.io.File;
5153
import java.io.IOException;
54+
import java.nio.file.Files;
5255
import java.util.ArrayList;
5356
import java.util.Arrays;
5457
import java.util.Collection;
5558
import java.util.Date;
5659
import java.util.HashMap;
5760
import java.util.List;
5861
import java.util.Map;
62+
import java.util.regex.Matcher;
63+
import java.util.regex.Pattern;
5964

6065
public class CellRangerGexCountStep extends AbstractAlignmentPipelineStep<CellRangerWrapper> implements AlignmentStep
6166
{
@@ -613,4 +618,88 @@ public void complete(SequenceAnalysisJobSupport support, AnalysisModel model, Co
613618
}
614619
}
615620
}
621+
622+
public enum Chemistry
623+
{
624+
// See: https://kb.10xgenomics.com/s/article/115004506263-What-is-a-barcode-inclusion-list-formerly-barcode-whitelist
625+
// cellranger-x.y.z/lib/python/cellranger/barcodes/
626+
FivePE_V3("Single Cell 5' PE v3", "3M-5pgex-jan-2023.txt.gz"),
627+
FivePE_V2("Single Cell 5' PE v2", "737k-august-2016.txt");
628+
629+
final String _label;
630+
final String _inclusionListFile;
631+
632+
Chemistry(String label, String inclusionListFile)
633+
{
634+
_label = label;
635+
_inclusionListFile = inclusionListFile;
636+
}
637+
638+
public File getInclusionListFile(Logger logger) throws PipelineJobException
639+
{
640+
File exe = new CellRangerWrapper(logger).getExe();
641+
if (Files.isSymbolicLink(exe.toPath()))
642+
{
643+
try
644+
{
645+
exe = Files.readSymbolicLink(exe.toPath()).toFile();
646+
}
647+
catch (IOException e)
648+
{
649+
throw new PipelineJobException(e);
650+
}
651+
}
652+
653+
File il = new File(exe.getParentFile(), "lib/python/cellranger/barcodes/" + _inclusionListFile);
654+
if (!il.exists())
655+
{
656+
throw new PipelineJobException("Unable to find file: " + il.getPath());
657+
}
658+
659+
return il;
660+
}
661+
662+
public static Chemistry getByLabel(String label)
663+
{
664+
for (Chemistry c : Chemistry.values())
665+
{
666+
if (c._label.equals(label))
667+
{
668+
return c;
669+
}
670+
}
671+
672+
throw new IllegalArgumentException("Unknown chemistry: " + label);
673+
}
674+
}
675+
676+
public static Chemistry inferChemistry(File cloupeFile) throws PipelineJobException
677+
{
678+
File html = new File(cloupeFile.getPath().replaceAll("_cloupe.cloupe$", "_web_summary.html"));
679+
if (!html.exists())
680+
{
681+
throw new IllegalArgumentException("Missing file: " + html.getPath());
682+
}
683+
684+
final Pattern pattern = Pattern.compile("\\[\"Chemistry\",\"(.*?)\"],");
685+
try (BufferedReader reader = Readers.getReader(html))
686+
{
687+
String line;
688+
while ((line = reader.readLine()) != null)
689+
{
690+
Matcher m = pattern.matcher(line);
691+
if (m.find())
692+
{
693+
String chem = m.group(1);
694+
return Chemistry.getByLabel(chem);
695+
}
696+
}
697+
}
698+
catch (IOException e)
699+
{
700+
throw new PipelineJobException(e);
701+
}
702+
703+
throw new IllegalArgumentException("Unable to infer chemistry for file: " + html.getPath());
704+
}
616705
}

0 commit comments

Comments
 (0)