Hi Pierre, I will test this out and familiarize myself with the syntax and get back to you. Very much appreciated.
• 0 views
•
link
Is there a loop I could do that would generate a separate job for each 2Mb range based on chromosome sizes. This would mean a job for each 2Mb interval across each chromosome for each individual.
a nextfow workflow would look like this (not tested)
params.reference=""
params.bed=""
params.vcfs=""
Channel.fromPath(params.vcfs).
splitCsv(header:false,sep:'\t',strip:true).
set{each_vcf}
process makeWindows {
output:
path("windows.bed") into windows_bed
script:
"""
bedtools makewindows -g "${params.reference}.fai" -w 2000000 > windows.bed
"""
}
windows_bed.
splitCsv(header:false,sep:'\t',strip:true).
map{T->[T[0],1+(T[1] as Integer),T[2]]}. /* convert bed +0 to interval +1 */
set{each_interval}
process processVcf {
input:
tuple vcf,chrom,start,end from each_vcf.combine(windows_bed)
output:
path("ouput.txt") into vcf_out
script:
"""
yourtool -chromosome "${chrom}" -range ${start}-${end} ${vcf} > ouput.txt
"""
}
process zipIt {
input:
val L from vcf_out.collect()
output:
path("final.zip")
script:
"""
cat << EOF > tmp.list
${L.join("\n")}
EOF
zip -@ -9 final.zip < tmp.list
"""
}
Hi Pierre, I will test this out and familiarize myself with the syntax and get back to you. Very much appreciated.
Okay the following is what I was able to trim it down to, but I have some followup questions which are commented out:
params.reference="Sept22Assembly.fasta"
params.vcfs="vcf.list"
Channel.fromPath(params.vcfs).
splitCsv(header:false,sep:'\t',strip:true).
set{each_vcf}
process makeWindows {
output:
path("windows.bed") into windows_bed
script:
bedtools makewindows -g "${params.reference}.fai" -w 2000000 > windows.bed
}
windows_bed.
splitCsv(header:false,sep:'\t',strip:true).
map{T->[T[0],1+(T[1] as Integer),T[2]]}. /* convert bed +0 to interval +1 */
set{each_interval}
process processVcf {
input:
tuple vcf,chrom,start,end from each_vcf.combine(windows_bed)
output:
path("ouput.txt") into vcf_out
script:
./loimpute -i ${vcf} -ne 80000 -range ${start}-${end} -h refpanel.vcf.gz -o ??
}
Log in to answer this question.