Skip to content

Commit 9558a1d

Browse files
authored
Merge pull request #253 from LabKey/fb_merge_23.11_to_develop
Merge discvr-23.11 to develop
2 parents dca3469 + 199ca4a commit 9558a1d

File tree

95 files changed

+982
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+982
-314
lines changed

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/SequenceOutputFile.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import com.fasterxml.jackson.annotation.JsonIgnore;
1919
import org.json.JSONObject;
20+
import org.labkey.api.data.Container;
21+
import org.labkey.api.data.ContainerManager;
2022
import org.labkey.api.data.DbSchema;
2123
import org.labkey.api.data.TableSelector;
2224
import org.labkey.api.exp.api.ExpData;
@@ -159,6 +161,11 @@ public String getContainer()
159161
return _container;
160162
}
161163

164+
public Container getContainerObj()
165+
{
166+
return ContainerManager.getForId(_container);
167+
}
168+
162169
public void setContainer(String container)
163170
{
164171
_container = container;

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/pipeline/ReferenceGenomeManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void cacheGenomeLocally(ReferenceGenome genome, Logger log) throws Pipeli
105105
File localCacheDir = SequencePipelineService.get().getRemoteGenomeCacheDirectory();
106106
if (isUpToDate(genome))
107107
{
108-
log.debug("Genome up-to-date, will not repeat rsync");
108+
log.debug("Genome up-to-date, will not repeat rsync: " + genome.getGenomeId());
109109
genome.setWorkingFasta(new File(new File(localCacheDir, genome.getGenomeId().toString()), genome.getSourceFastaFile().getName()));
110110

111111
return;

SequenceAnalysis/pipeline_code/sequence_tools_install.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -510,17 +510,19 @@ then
510510
rm -Rf bcftools*
511511
rm -Rf $LKTOOLS_DIR/bcftools
512512

513-
wget $WGET_OPTS https://github.com/samtools/bcftools/releases/download/1.16/bcftools-1.16.tar.bz2
514-
bunzip2 bcftools-1.16.tar.bz2
515-
tar -xf bcftools-1.16.tar
516-
echo "Compressing TAR"
517-
bzip2 bcftools-1.16.tar
518-
chmod 755 bcftools-1.16
519-
cd bcftools-1.16
520-
./configure
513+
wget $WGET_OPTS https://github.com/samtools/bcftools/releases/download/1.18/bcftools-1.18.tar.bz2
514+
tar xjvf bcftools-1.18.tar.bz2
515+
bzip2 bcftools-1.18.tar
516+
chmod 755 bcftools-1.18
517+
cd bcftools-1.18
518+
rm -f plugins/liftover.c
519+
wget $WGET_OPTS -P plugins https://raw.githubusercontent.com/freeseek/score/master/liftover.c
520+
521+
./configure CFLAGS="-g -Wall -O2 -std=c99"
521522
make
522523

523524
install ./bcftools $LKTOOLS_DIR
525+
install ./plugins/liftover.so $LKTOOLS_DIR
524526
else
525527
echo "Already installed"
526528
fi

SequenceAnalysis/resources/queries/pipeline/Job/Sequence Jobs Without Data.qview.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</columns>
1010
<filters>
1111
<filter column="sequenceJobWithoutData" operator="eq" value="true"/>
12+
<filter column="JobParent" operator="isblank" value=""/>
1213
</filters>
1314
<sorts>
1415
<sort column="Created" descending="true"/>

SequenceAnalysis/resources/web/SequenceAnalysis/field/SequenceOutputFileSelectorField.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Ext4.define('SequenceAnalysis.field.SequenceOutputFileSelectorField', {
44

55
genomeId: -1,
66
performGenomeFilter: true,
7+
valueField: 'dataid',
78

89
initComponent: function(){
910
Ext4.apply(this, {
1011
forceSelection: true,
1112
displayField: 'name',
12-
valueField: 'dataid',
1313
listConfig: {
14-
innerTpl: ['{name} ({[values["rowid"]]})']
14+
innerTpl: ['{name} ({[values["' + this.valueField + '"]]})']
1515
},
1616
store: {
1717
type: 'labkey-store',
@@ -21,7 +21,7 @@ Ext4.define('SequenceAnalysis.field.SequenceOutputFileSelectorField', {
2121
autoLoad: true,
2222
filterArray: this.getFilterArray(),
2323
sort: 'name',
24-
columns: 'library_id,name,dataid,category'
24+
columns: 'rowid,library_id,name,dataid,category'
2525
}
2626
});
2727

SequenceAnalysis/resources/web/SequenceAnalysis/panel/VariantProcessingPanel.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,12 @@ Ext4.define('SequenceAnalysis.panel.VariantProcessingPanel', {
268268
label: 'Intervals to Exclude',
269269
description: 'A BED or similar file with intervals to skip',
270270
defaultValue: null
271+
},{
272+
fieldXtype: 'ldk-expdatafield',
273+
name: 'skipExcessHetAndInbreeding',
274+
label: 'Skip Excess Het And Inbreeding',
275+
description: 'If checked, the ExcessHet and InbreedingCoeff annotations will be skipped, which can be important when using force-output-intervals',
276+
defaultValue: null
271277
},{
272278
fieldXtype: 'checkbox',
273279
name: 'doCopyInputs',

SequenceAnalysis/src/org/labkey/sequenceanalysis/analysis/GenotypeGVCFHandler.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,11 +636,14 @@ private void processOneInput(JobContext ctx, PipelineJob job, ReferenceGenome ge
636636
}
637637

638638
// NOTE: added to side-step https://github.com/broadinstitute/gatk/issues/7938
639-
toolParams.add("-AX");
640-
toolParams.add("InbreedingCoeff");
639+
if (ctx.getParams().optBoolean("variantCalling.GenotypeGVCFs.skipExcessHetAndInbreeding"))
640+
{
641+
toolParams.add("-AX");
642+
toolParams.add("InbreedingCoeff");
641643

642-
toolParams.add("-AX");
643-
toolParams.add("ExcessHet");
644+
toolParams.add("-AX");
645+
toolParams.add("ExcessHet");
646+
}
644647

645648
if (!ctx.getParams().isNull("variantCalling.GenotypeGVCFs.maxGenotypeCount"))
646649
{

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public Provider()
4949
}}, null),
5050
ToolParameterDescriptor.create("impact", "IMPACT", "If selected, the Impact annotation will run, which parses the SnpEff ANN field into multiple discrete INFO fields.", "checkbox", new JSONObject(){{
5151
put("checked", false);
52+
}}, null),
53+
ToolParameterDescriptor.create("excessHet", "ExcessHet", "If selected, the ExcessHet annotation will run.", "checkbox", new JSONObject(){{
54+
put("checked", false);
5255
}}, null)
5356
), null, "");
5457
}
@@ -106,6 +109,12 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno
106109
options.add("Impact");
107110
}
108111

112+
if (getProvider().getParameterByName("excessHet").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Boolean.class, false))
113+
{
114+
options.add("-A");
115+
options.add("ExcessHet");
116+
}
117+
109118
if (intervals != null)
110119
{
111120
intervals.forEach(interval -> {

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

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.labkey.sequenceanalysis.run.variant;
22

33
import htsjdk.samtools.util.Interval;
4+
import org.apache.commons.io.FileUtils;
45
import org.json.JSONObject;
56
import org.labkey.api.pipeline.PipelineJobException;
67
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStep;
@@ -16,8 +17,8 @@
1617

1718
import javax.annotation.Nullable;
1819
import java.io.File;
20+
import java.io.IOException;
1921
import java.util.ArrayList;
20-
import java.util.Arrays;
2122
import java.util.List;
2223

2324
/**
@@ -40,7 +41,10 @@ public Provider()
4041
ToolParameterDescriptor.create("writeJson", "Write Raw Data", "If selected, both an HTML report and a text file with the raw data will be created.", "checkbox", new JSONObject()
4142
{{
4243
put("checked", true);
43-
}}, true)
44+
}}, true),
45+
ToolParameterDescriptor.create("doCopyLocal", "Copy Input To Working Directory", "If selected, the input VCF will always be copied to the working directory, if it is not already present.", "checkbox", new JSONObject(){{
46+
put("checked", false);
47+
}}, false)
4448
), null, "https://bimberlab.github.io/DISCVRSeq/");
4549
}
4650

@@ -56,6 +60,39 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno
5660
{
5761
VariantProcessingStepOutputImpl output = new VariantProcessingStepOutputImpl();
5862

63+
boolean doCopyLocal = getProvider().getParameterByName("doCopyLocal").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), boolean.class, false);
64+
if (doCopyLocal)
65+
{
66+
File local = new File(outputDirectory, inputVCF.getName());
67+
File localIdx = new File(local.getPath() + ".tbi");
68+
if (!inputVCF.equals(local))
69+
{
70+
getPipelineCtx().getLogger().debug("Making local copy of VCF:");
71+
if (local.exists())
72+
{
73+
local.delete();
74+
}
75+
76+
if (localIdx.exists())
77+
{
78+
localIdx.delete();
79+
}
80+
81+
try
82+
{
83+
FileUtils.copyFile(inputVCF, local);
84+
FileUtils.copyFile(new File(inputVCF.getPath() + ".tbi"), localIdx);
85+
output.addIntermediateFile(local);
86+
output.addIntermediateFile(localIdx);
87+
inputVCF = local;
88+
}
89+
catch (IOException e)
90+
{
91+
throw new PipelineJobException(e);
92+
}
93+
}
94+
}
95+
5996
List<String> options = new ArrayList<>();
6097

6198
File pedFile = ProcessVariantsHandler.getPedigreeFile(getPipelineCtx().getSourceDirectory(true));

jbrowse/api-src/org/labkey/api/jbrowse/JBrowseService.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
import org.labkey.api.pipeline.PipelineJobException;
88
import org.labkey.api.pipeline.PipelineValidationException;
99
import org.labkey.api.security.User;
10+
import org.labkey.api.sequenceanalysis.SequenceOutputFile;
1011

12+
import java.io.File;
1113
import java.io.IOException;
14+
import java.util.List;
1215

1316
/**
1417
* Created by bimber on 11/3/2016.
@@ -38,4 +41,17 @@ static public void setInstance(JBrowseService instance)
3841
abstract public void registerGroupsProvider(GroupsProvider provider);
3942

4043
abstract public void registerFieldCustomizer(JBrowseFieldCustomizer customizer);
44+
45+
abstract public void prepareLuceneIndex(File vcf, File indexDir, Logger log, List<String> infoFieldsForFullTextSearch, boolean allowLenientLuceneProcessing) throws PipelineJobException;
46+
47+
abstract public SequenceOutputFile findMatchingLuceneIndex(SequenceOutputFile vcfFile, List<String> infoFieldsToIndex, User u, @Nullable Logger log) throws PipelineJobException;
48+
49+
abstract public void registerLuceneIndexDetector(LuceneIndexDetector detector);
50+
51+
public interface LuceneIndexDetector
52+
{
53+
SequenceOutputFile findMatchingLuceneIndex(SequenceOutputFile vcfFile, List<String> infoFieldsToIndex, User u, @Nullable Logger log) throws PipelineJobException;
54+
55+
boolean isAvailable(Container c);
56+
}
4157
}

0 commit comments

Comments
 (0)