SHARE
TWEET

Untitled

a guest Jun 2nd, 2017 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fastq_path = params.fastq_path
  2. bam_path = params.bam_path
  3. vcf_path = params.vcf_path
  4.  
  5. process fastQC{
  6.     input:
  7.       set val(prefix), file(fastq_file) from fastq_files
  8.  
  9.     output:
  10.     set file("*.zip"), file("*.html") into fastqc_output
  11.  
  12.     when: fastq_path
  13.  
  14.     script:
  15.     """
  16.    fastqc -t ${task.cpus} ${fastq_file}
  17.    """
  18. }
  19.  
  20. process PicardToolsMarkDuplicates{
  21.     input:
  22.     set val(prefix), file(bam_file) from bam_files1
  23.  
  24.     output:
  25.     file("${prefix}_marked_dup_metrics.txt") into marked_dup_output
  26.  
  27.     when: bam_path
  28.  
  29.     """
  30.    java -Xmx${task.memory.toGiga()}g \
  31.    -jar \$PICARD_HOME \
  32.    MarkDuplicates \
  33.    I=${bam_file} \
  34.    O=${prefix}_duplicates.bam \
  35.    M=${prefix}_marked_dup_metrics.txt
  36.    """
  37. }
  38.  
  39. process PicardToolsCollectInsertSizeMetrics{
  40.     input:
  41.     set val(prefix), file(bam_file) from bam_files2
  42.  
  43.     output:
  44.     file("${prefix}_insert_size_metrics.txt") into insert_size_metrics_output
  45.  
  46.     when: bam_path
  47.  
  48.     """
  49.    java -Xmx${task.memory.toGiga()}g \
  50.    -jar \$PICARD_HOME \
  51.    CollectInsertSizeMetrics \
  52.    I=${bam_file} \
  53.    O=${prefix}_insert_size_metrics.txt \
  54.    H=${prefix}_insert_size_histogram.pdf
  55.    """
  56. }
  57.  
  58. process BcfToolsStats{
  59.     input:
  60.     set val(prefix), file(vcf_file) from vcf_files1
  61.  
  62.     output:
  63.     file("${prefix}_bcftools.stats") into bcftools_stats_output
  64.  
  65.     when: vcf_path
  66.  
  67.     script:
  68.     """
  69.    bcftools stats ${vcf_file} > ${prefix}_bcftools.stats
  70.    """
  71. }
  72.  
  73. process SnpEff {
  74.     input:
  75.     set val(prefix), file(vcf_file) from vcf_files2
  76.  
  77.     output:
  78.     set file("*.csv"), file("${prefix}_snpeff.vcf") into snpeff_vcf_output
  79.  
  80.     when: vcf_path
  81.  
  82.     script:
  83.     """
  84.    java -Xmx${task.memory.toGiga()}g \
  85.    -jar \$SNPEFF_HOME \
  86.    -csvStats ${prefix}.csv \
  87.    GRCh37.75 \
  88.    ${vcf_file} > ${prefix}_snpeff.vcf
  89.    """
  90. }
  91.  
  92. reportsForMultiQC = Channel.empty()
  93.   .mix(
  94.     bcftools_stats_output,
  95.     fastqc_output,
  96.     gatk_variant_eval_output,
  97.     insert_size_metrics_output,
  98.     marked_dup_output,
  99.     snpeff_vcf_output
  100.   ).collect()
  101.  
  102. process MultiQC {
  103.   input: file ('') from reportsForMultiQC
  104.  
  105. output:
  106.   file "*multiqc_report.html"
  107.   file "*multiqc_data"
  108.  
  109.   script:
  110.   """
  111.  multiqc -f ${results_outdir}
  112.  """
  113. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top