Skip to content

Commit 04b9f46

Browse files
committed
Merge discvr-25.3 to discvr-25.7
2 parents 1178c3a + 34e803d commit 04b9f46

File tree

8 files changed

+95
-4
lines changed

8 files changed

+95
-4
lines changed

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/run/AbstractGatk4Wrapper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public List<String> getBaseArgs(@Nullable String toolName)
9191
args.add(SequencePipelineService.get().getJavaFilepath());
9292
args.addAll(SequencePipelineService.get().getJavaOpts(_maxRamOverride));
9393
args.add("-DGATK_STACKTRACE_ON_USER_EXCEPTION=true");
94+
args.add("-Dsamjdk.optimistic_vcf_4_4=true");
9495
args.add("-jar");
9596
args.add(getJAR().getPath());
9697

SequenceAnalysis/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ dependencies {
135135
BuildUtils.addExternalDependency(
136136
project,
137137
new ExternalDependency(
138-
"com.github.broadinstitute:picard:3.1.0",
138+
"com.github.broadinstitute:picard:3.4.0",
139139
"Picard Tools Lib",
140140
"PicardTools",
141141
"https://github.com/broadinstitute/picard",

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/util/FastqcRunner.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717

1818
import org.apache.commons.io.IOUtils;
1919
import org.apache.commons.lang3.StringUtils;
20-
import org.apache.logging.log4j.Logger;
2120
import org.apache.logging.log4j.LogManager;
21+
import org.apache.logging.log4j.Logger;
2222
import org.jetbrains.annotations.Nullable;
2323
import org.junit.Assert;
2424
import org.junit.Test;
2525
import org.labkey.api.module.Module;
2626
import org.labkey.api.module.ModuleLoader;
2727
import org.labkey.api.pipeline.PipelineJobService;
28-
import org.labkey.api.resource.FileResource;
2928
import org.labkey.api.resource.DirectoryResource;
29+
import org.labkey.api.resource.FileResource;
3030
import org.labkey.api.resource.Resource;
3131
import org.labkey.api.sequenceanalysis.pipeline.SequencePipelineService;
3232
import org.labkey.api.settings.AppProps;
@@ -366,7 +366,7 @@ private List<String> getBaseParams() throws FileNotFoundException
366366
throw new RuntimeException("Not found: " + jbzip2.getPath());
367367
}
368368

369-
File htsjdkJar = new File(libDir, "htsjdk-4.0.0.jar");
369+
File htsjdkJar = findJar(libDir, "htsjdk-");
370370
if (!htsjdkJar.exists())
371371
{
372372
throw new RuntimeException("Not found: " + htsjdkJar.getPath());
@@ -401,6 +401,27 @@ private List<String> getBaseParams() throws FileNotFoundException
401401
return params;
402402
}
403403

404+
private File findJar(final File libDir, final String prefix)
405+
{
406+
if (!libDir.exists())
407+
{
408+
throw new RuntimeException("Missing directory: " + libDir);
409+
}
410+
411+
List<String> jarNames = Arrays.stream(libDir.list()).filter(fn -> fn.startsWith(prefix)).sorted().toList();
412+
if (jarNames.isEmpty())
413+
{
414+
throw new RuntimeException("Unable to find JAR with prefix: " + prefix);
415+
}
416+
417+
if (jarNames.size() > 1)
418+
{
419+
_logger.info("More than one JAR found with prefix: " + prefix);
420+
}
421+
422+
return new File(libDir, jarNames.get(jarNames.size() - 1));
423+
}
424+
404425
private int getThreads()
405426
{
406427
return _threads;

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/variant/KingInferenceStep.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno
115115
plinkArgs.add("--max-alleles");
116116
plinkArgs.add("2");
117117

118+
// NOTE: tools like sawfish can report half-called genotypes, like 0/.. For now, be most conservative in PCA:
119+
plinkArgs.add("--vcf-half-call");
120+
plinkArgs.add("missing");
121+
118122
Integer threads = SequencePipelineService.get().getMaxThreads(getPipelineCtx().getLogger());
119123
if (threads != null)
120124
{

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/variant/PlinkPcaStep.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ private void runBatch(File inputVCF, File outputDirectory, VariantProcessingStep
227227
args.add(String.valueOf(maxRam));
228228
}
229229

230+
// NOTE: tools like sawfish can report half-called genotypes, like 0/.. For now, be most conservative in PCA:
231+
args.add("--vcf-half-call");
232+
args.add("missing");
233+
230234
args.addAll(getClientCommandArgs());
231235

232236
getWrapper().execute(args);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
netRc <- paste0(Sys.getenv('USER_HOME'), '/.netrc')
2+
if (!file.exists(netRc)) {
3+
print(list.files(Sys.getenv('USER_HOME')))
4+
stop(paste0('Unable to find file: ', netRc))
5+
}
6+
7+
invisible(Rlabkey::labkey.setCurlOptions(NETRC_FILE = netRc, connect-timeout = 10))
8+
Rdiscvr::SetLabKeyDefaults(baseUrl = serverBaseUrl, defaultFolder = defaultLabKeyFolder)
9+
10+
for (datasetId in names(seuratObjects)) {
11+
printName(datasetId)
12+
seuratObj <- readSeuratRDS(seuratObjects[[datasetId]])
13+
14+
seuratObj <- ApplyKnownClontypicData(seuratObj, groupFields = groupFields, addMetadata = addMetadata)
15+
saveData(seuratObj, datasetId)
16+
17+
# Cleanup
18+
rm(seuratObj)
19+
gc()
20+
}

singlecell/src/org/labkey/singlecell/SingleCellModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.labkey.singlecell.pipeline.singlecell.AppendNimble;
4343
import org.labkey.singlecell.pipeline.singlecell.AppendSaturation;
4444
import org.labkey.singlecell.pipeline.singlecell.AppendTcr;
45+
import org.labkey.singlecell.pipeline.singlecell.ApplyKnownClonotypicData;
4546
import org.labkey.singlecell.pipeline.singlecell.AvgExpression;
4647
import org.labkey.singlecell.pipeline.singlecell.CalculateGeneComponentScores;
4748
import org.labkey.singlecell.pipeline.singlecell.CalculateUCellScores;
@@ -299,6 +300,7 @@ public static void registerPipelineSteps()
299300
SequencePipelineService.get().registerPipelineStep(new PerformDefaultNimbleAppend.Provider());
300301
SequencePipelineService.get().registerPipelineStep(new PerformMhcDimRedux.Provider());
301302
SequencePipelineService.get().registerPipelineStep(new RunTricycle.Provider());
303+
SequencePipelineService.get().registerPipelineStep(new ApplyKnownClonotypicData.Provider());
302304

303305
SequenceAnalysisService.get().registerReadsetListener(new SingleCellReadsetListener());
304306
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package org.labkey.singlecell.pipeline.singlecell;
2+
3+
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStepProvider;
4+
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext;
5+
import org.labkey.api.singlecell.pipeline.SingleCellStep;
6+
7+
import java.util.List;
8+
9+
public class ApplyKnownClonotypicData extends AbstractRDiscvrStep
10+
{
11+
public ApplyKnownClonotypicData(PipelineContext ctx, ApplyKnownClonotypicData.Provider provider)
12+
{
13+
super(provider, ctx);
14+
}
15+
16+
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
17+
{
18+
public Provider()
19+
{
20+
super("ApplyKnownClonotypicData", "Append Known Clonotype/Antigen Data", "RDiscvr", "This will query the clone_responses table and append a column tagging each cell for matching antigens (based on clonotype)", List.of(
21+
22+
), null, null);
23+
}
24+
25+
26+
@Override
27+
public ApplyKnownClonotypicData create(PipelineContext ctx)
28+
{
29+
return new ApplyKnownClonotypicData(ctx, this);
30+
}
31+
}
32+
33+
@Override
34+
public String getFileSuffix()
35+
{
36+
return "ctd";
37+
}
38+
}
39+

0 commit comments

Comments
 (0)