Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/user/bin/nextflow
- nextflow.enable.dsl=2
- /// INPUTS
- DIR_input = "/mnt/scgc_nfs/lab/ggavelis/sandbox/nf_tests/hmmer"
- SUFFIX_of_input_files = ".faa"
- // OUTPUT
- DIR_output = "results"
- /// HMM to search against
- PATH_hmm = "/mnt/scgc_nfs/ref/kofamscan/profiles/K19868.hmm"
- /// DEV MODE STUFF
- params.dev = false // Lets user testrun nextflow command (by adding flag '--dev') which will have this pipeline run on JUST ONE SAG (again, as a test)
- params.num_inputs = 2
- workflow {
- CH_sample_id_AND_faa = channel
- .fromPath("$DIR_input/*$SUFFIX_of_input_files", checkIfExists:true) // --> path(faa)
- .map { it -> tuple(it.getBaseName(), it) } // --> tuple( val(sample_id), path(faa)) # 1. Extracts sample_id using .getBaseName(), then stores it in a tuple (with the inputfile path)
- //.view()
- HMMER_v3_3_2( CH_sample_id_AND_faa.take( params.dev ? params.num_inputs : -1) ) //.take(params.dev ? params.num_inputs : -1)
- }
- process HMMER_v3_3_2 {
- container='docker://quay.io/biocontainers/hmmer:3.3.2--h87f3376_2'
- publishDir DIR_output
- cpu=2
- tag "${sample_id}"
- input: tuple val(sample_id), path(faa)
- output: tuple val(sample_id), path("${sample_id}_hmm_tbl.txt")
- "hmmsearch -E 0.00001 --tblout ${sample_id}_hmm_tbl.txt ${PATH_hmm} ${faa} &> /dev/null"
- }
Advertisement
Add Comment
Please, Sign In to add comment