Skip to content

Commit feff0ec

Browse files
committed
Ensure lifted VCF is sorted and indexed
1 parent 2c1ec22 commit feff0ec

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

mGAP/src/org/labkey/mgap/pipeline/AnnotationStep.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.labkey.api.sequenceanalysis.pipeline.PipelineStepProvider;
2828
import org.labkey.api.sequenceanalysis.pipeline.ReferenceGenome;
2929
import org.labkey.api.sequenceanalysis.pipeline.SequenceAnalysisJobSupport;
30+
import org.labkey.api.sequenceanalysis.pipeline.SequencePipelineService;
3031
import org.labkey.api.sequenceanalysis.pipeline.ToolParameterDescriptor;
3132
import org.labkey.api.sequenceanalysis.pipeline.VariantProcessingStep;
3233
import org.labkey.api.sequenceanalysis.pipeline.VariantProcessingStepOutputImpl;
@@ -330,6 +331,18 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno
330331
{
331332
LiftoverBcfToolsWrapper liftoverVcfRunner = new LiftoverBcfToolsWrapper(getPipelineCtx().getLogger());
332333
liftoverVcfRunner.doLiftover(currentVcf, chainFile, genome.getWorkingFastaFile(), grch37Genome.getWorkingFastaFile(), liftoverRejects, liftedToGRCh37);
334+
335+
// NOTE: the resulting VCF is not necessarily in chromosome sort order:
336+
SequencePipelineService.get().sortVcf(liftedToGRCh37, null, genome.getSequenceDictionary(), getPipelineCtx().getLogger());
337+
338+
try
339+
{
340+
SequenceAnalysisService.get().ensureVcfIndex(liftedToGRCh37, getPipelineCtx().getLogger());
341+
}
342+
catch (IOException e)
343+
{
344+
throw new PipelineJobException(e);
345+
}
333346
}
334347
else
335348
{

0 commit comments

Comments
 (0)