zoark0

Hmmsearch

Mar 9th, 2023
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. #!/user/bin/nextflow
  2. nextflow.enable.dsl=2
  3.  
  4.  
  5. /// INPUTS
  6. DIR_input = "/mnt/scgc_nfs/lab/ggavelis/sandbox/nf_tests/hmmer"
  7. SUFFIX_of_input_files = ".faa"
  8.  
  9. // OUTPUT
  10. DIR_output = "results"
  11.  
  12. /// HMM to search against
  13. PATH_hmm = "/mnt/scgc_nfs/ref/kofamscan/profiles/K19868.hmm"
  14.  
  15.  
  16.  
  17. /// DEV MODE STUFF
  18. 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)
  19. params.num_inputs = 2
  20.  
  21.  
  22. workflow {
  23. CH_sample_id_AND_faa = channel
  24. .fromPath("$DIR_input/*$SUFFIX_of_input_files", checkIfExists:true) // --> path(faa)
  25. .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)
  26. //.view()
  27. HMMER_v3_3_2( CH_sample_id_AND_faa.take( params.dev ? params.num_inputs : -1) ) //.take(params.dev ? params.num_inputs : -1)
  28. }
  29.  
  30. process HMMER_v3_3_2 {
  31. container='docker://quay.io/biocontainers/hmmer:3.3.2--h87f3376_2'
  32. publishDir DIR_output
  33. cpu=2
  34. tag "${sample_id}"
  35.  
  36. input: tuple val(sample_id), path(faa)
  37.  
  38. output: tuple val(sample_id), path("${sample_id}_hmm_tbl.txt")
  39.  
  40. "hmmsearch -E 0.00001 --tblout ${sample_id}_hmm_tbl.txt ${PATH_hmm} ${faa} &> /dev/null"
  41. }
Advertisement
Add Comment
Please, Sign In to add comment