-
-
Save satta/4f247c1fe4b1ec674222 to your computer and use it in GitHub Desktop.
Test pipeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nextflow | |
statuslog = Channel.create() | |
genome_file = file(params.inseq) | |
ncrna_models = file(params.ncrna_models) | |
genome_chunk = Channel.fromPath(params.inseq).splitFasta( by: 3) | |
process predict_tRNA { | |
input: | |
file genome_file | |
output: | |
file 'aragorn.gff3' into trnas | |
stdout into statuslog | |
statuslog.bind("tRNA detection started") | |
""" | |
${params.ARAGORN_DIR}/aragorn -t ${genome_file} | grep -E -C2 '(nucleotides|Sequence)' > 1 | |
aragorn_to_gff3.lua < 1 > 2 | |
${params.GT_DIR}/bin/gt gff3 -sort -tidy -retainids 2 > aragorn.gff3 2> /dev/null | |
echo "tRNA finished" | |
""" | |
} | |
process cmpress { | |
input: | |
file ncrna_models | |
output: | |
file ncrna_models into pressed_model | |
""" | |
echo ${ncrna_models} | |
cmpress -F ${ncrna_models} | |
""" | |
} | |
process predict_ncRNA { | |
input: | |
file genome_chunk | |
file 'models.cm' from pressed_model | |
output: | |
file 'cmtblouts' into cmtblouts | |
stdout into statuslog | |
statuslog.bind("ncRNA detection started") | |
""" | |
cmsearch --tblout cmtblouts --cut_ga models.cm ${genome_chunk} > /dev/null | |
echo "ncRNA finished" | |
""" | |
} | |
cmtblout = cmtblouts.collectFile() | |
process merge_ncrnas { | |
input: | |
file cmtblout | |
output: | |
file 'ncrna.gff3' into ncrnafile | |
""" | |
infernal_to_gff3.lua < ${cmtblout} > 1 | |
${params.GT_DIR}/bin/gt gff3 -sort -tidy -retainids 1 > ncrna.gff3 | |
""" | |
} | |
process report { | |
input: | |
file 'ncrna.gff3' from ncrnafile | |
file 'trna.gff3' from trnas | |
output: | |
stdout into result | |
""" | |
ls -Al ncrna.gff3 trna.gff3 | |
""" | |
} | |
result.subscribe { | |
println it | |
} | |
statuslog.subscribe { | |
println "log: " + it | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment