Skip to content

Commit e295d10

Browse files
committed
More robust logic for liftover and intervals
1 parent f1d5379 commit e295d10

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ else if (!SequenceUtil.hasLineCount(unmappedOutput))
319319
public void liftOverVcf(JobContext ctx, ReferenceGenome targetGenome, ReferenceGenome sourceGenome, File chain, File input, File output, @Nullable File unmappedOutput, PipelineJob job, double pct, boolean dropGenotypes, boolean useBcfTools, @Nullable List<Interval> intervals) throws IOException, PipelineJobException
320320
{
321321
File currentVCF = input;
322-
if (dropGenotypes)
322+
if (dropGenotypes || intervals != null)
323323
{
324-
ctx.getLogger().info("creating VCF wihtout genotypes");
324+
ctx.getLogger().info("subsetting VCF");
325325
File outputFile = new File(output.getParentFile(), SequenceAnalysisService.get().getUnzippedBaseName(currentVCF.getName()) + ".noGenotypes.vcf.gz");
326326
if (new File(outputFile.getPath() + ".tbi").exists())
327327
{
@@ -330,7 +330,11 @@ public void liftOverVcf(JobContext ctx, ReferenceGenome targetGenome, ReferenceG
330330
else
331331
{
332332
List<String> extraArgs = new ArrayList<>();
333-
extraArgs.add("--sites-only-vcf-output");
333+
if (dropGenotypes)
334+
{
335+
extraArgs.add("--sites-only-vcf-output");
336+
}
337+
334338
if (intervals != null)
335339
{
336340
intervals.forEach(interval -> {

0 commit comments

Comments
 (0)