Bugfixed to script.
This commit is contained in:
parent
27ea6426a4
commit
974c2499cc
|
|
@ -23,7 +23,7 @@ class ChunkVCF extends QScript {
|
||||||
@Input(shortName="N",fullName="numEntriesInChunk",doc="The number of variants per chunk",required=true)
|
@Input(shortName="N",fullName="numEntriesInChunk",doc="The number of variants per chunk",required=true)
|
||||||
var numEntries : Int = _
|
var numEntries : Int = _
|
||||||
|
|
||||||
@Input(shortName="I",fullName="Intervals",doc="The SNP interval list to chunk. If not provided, one will be created for you to provide in a second run.")
|
@Input(shortName="I",fullName="Intervals",doc="The SNP interval list to chunk. If not provided, one will be created for you to provide in a second run.",required=false)
|
||||||
var intervals : File = _
|
var intervals : File = _
|
||||||
|
|
||||||
@Input(fullName="preserveChromosomes",doc="Restrict chunks to one chromosome (smaller chunk at end of chromosome)",required=false)
|
@Input(fullName="preserveChromosomes",doc="Restrict chunks to one chromosome (smaller chunk at end of chromosome)",required=false)
|
||||||
|
|
@ -40,8 +40,8 @@ class ChunkVCF extends QScript {
|
||||||
def script = {
|
def script = {
|
||||||
if ( intervals == null ) {
|
if ( intervals == null ) {
|
||||||
// create an interval list from the VCF
|
// create an interval list from the VCF
|
||||||
val ivals : File = swapExt(variants,".vcf",".intervals.list")
|
val ivals : File = swapExt(inVCF,".vcf",".intervals.list")
|
||||||
val extract : VCFExtractIntervals = new VCFExtractIntervals(variants,ivals,false)
|
val extract : VCFExtractIntervals = new VCFExtractIntervals(inVCF,ivals,false)
|
||||||
add(extract)
|
add(extract)
|
||||||
} else {
|
} else {
|
||||||
var chunkNum = 1
|
var chunkNum = 1
|
||||||
|
|
@ -54,11 +54,12 @@ class ChunkVCF extends QScript {
|
||||||
if ( ( preserve && ! int.split(":")(0).equals(chromosome) ) || numLinesInChunk > numEntries ) {
|
if ( ( preserve && ! int.split(":")(0).equals(chromosome) ) || numLinesInChunk > numEntries ) {
|
||||||
chunkWriter.close()
|
chunkWriter.close()
|
||||||
val chunkSelect : SelectVariants = new SelectVariants
|
val chunkSelect : SelectVariants = new SelectVariants
|
||||||
|
chunkSelect.variant = inVCF
|
||||||
chunkSelect.reference_sequence = ref
|
chunkSelect.reference_sequence = ref
|
||||||
chunkSelect.memoryLimit = 2
|
chunkSelect.memoryLimit = 2
|
||||||
chunkSelect.intervals :+= chunkFile
|
chunkSelect.intervals :+= chunkFile
|
||||||
if ( extractSamples != null )
|
if ( extractSamples != null )
|
||||||
chunkSelect.sample_file = extractSamples
|
chunkSelect.sample_file :+= extractSamples
|
||||||
chunkSelect.out = swapExt(inVCF,".vcf",".chunk%d.vcf".format(chunkNum))
|
chunkSelect.out = swapExt(inVCF,".vcf",".chunk%d.vcf".format(chunkNum))
|
||||||
add(chunkSelect)
|
add(chunkSelect)
|
||||||
chunkNum += 1
|
chunkNum += 1
|
||||||
|
|
@ -74,12 +75,13 @@ class ChunkVCF extends QScript {
|
||||||
if ( numLinesInChunk > 0 ) {
|
if ( numLinesInChunk > 0 ) {
|
||||||
// some work to do
|
// some work to do
|
||||||
val chunkSelect : SelectVariants = new SelectVariants
|
val chunkSelect : SelectVariants = new SelectVariants
|
||||||
|
chunkSelect.variant = inVCF
|
||||||
chunkSelect.reference_sequence = ref
|
chunkSelect.reference_sequence = ref
|
||||||
chunkSelect.memoryLimit = 2
|
chunkSelect.memoryLimit = 2
|
||||||
chunkSelect.intervals :+= chunkFile
|
chunkSelect.intervals :+= chunkFile
|
||||||
chunkWriter.close()
|
chunkWriter.close()
|
||||||
if ( extractSamples != null )
|
if ( extractSamples != null )
|
||||||
chunkSelect.sample_file = extractSamples
|
chunkSelect.sample_file :+= extractSamples
|
||||||
chunkSelect.out = swapExt(inVCF,".vcf",".chunk%d.vcf".format(chunkNum))
|
chunkSelect.out = swapExt(inVCF,".vcf",".chunk%d.vcf".format(chunkNum))
|
||||||
add(chunkSelect)
|
add(chunkSelect)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue