diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc5005e184869f680bbd484de55ce76cb5a24268..ff78339ae1e3030b33e2dcdbc1f91b2f76ebb9aa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -77,6 +77,13 @@ makeBigWig: - singularity run 'docker://bicf/deeptools3.3:2.0.0' bamCoverage -p `nproc` -b ./test_data/bam/small/Q-Y5JA_1M.se.sorted.deduped.bam -o Q-Y5JA_1M.se.bw - pytest -m makeBigWig +makeFeatureCounts: + stage: unit + script: + - singularity run 'docker://bicf/bicf/subread2:2.0.0' featureCounts -R SAM -p -G /project/BICF/BICF_Core/shared/gudmap/references/GRCh38.p12.v31/genome.fna -T `nproc` -a /project/BICF/BICF_Core/shared/gudmap/references/GRCh38.p12.v31/genome.gtf -o Q-Y5JA_1M.se.featureCounts ./test_data/bam/small/Q-Y5JA_1M.se.sorted.deduped.bam + - singularity run 'docker://bicf/bicf/subread2:2.0.0' Rscript calculateTPM.R --count Q-Y5JA_1M.se.featureCounts + - pytest -m makeFeatureCounts + fastqc: stage: unit script: diff --git a/workflow/rna-seq.nf b/workflow/rna-seq.nf index e252ec3730958cced1d5d7413434016b4fba0f4f..2f21f7f0e07906d3baa62bd587b2ee3603e5c453 100755 --- a/workflow/rna-seq.nf +++ b/workflow/rna-seq.nf @@ -362,31 +362,7 @@ process dedupData { } /* - *fastqc: run fastqc on untrimmed fastq's -*/ -process fastqc { - tag "${repRID}" - publishDir "${outDir}/fastqc", mode: 'copy', pattern: "*_fastqc.zip" - publishDir "${logsDir}", mode: 'copy', pattern: "*.fastq.err" - - input: - path (fastq) from fastqs_fastqc - - output: - path ("*_fastqc.zip") into fastqc - - script: - """ - hostname >${repRID}.fastqc.err - ulimit -a >>${repRID}.fastqc.err - - # run fastqc - fastqc *.fastq.gz -o . >>${repRID}.fastqc.err - """ -} - -/* - *Make BigWig files for later processes + *makeBigWig: make bigwig file */ process makeBigWig { tag "${repRID}" @@ -405,7 +381,7 @@ process makeBigWig { } /* - *Run featureCounts and get the counts, tpm, and fpkm + *Run featureCounts and get the counts, tpm */ process makeFeatureCounts { tag "${repRID}" @@ -426,3 +402,28 @@ process makeFeatureCounts { Rscript calculateTPM.R --count "${repRID}.featureCounts" """ } + + +/* + *fastqc: run fastqc on untrimmed fastq's +*/ +process fastqc { + tag "${repRID}" + publishDir "${outDir}/fastqc", mode: 'copy', pattern: "*_fastqc.zip" + publishDir "${logsDir}", mode: 'copy', pattern: "*.fastq.err" + + input: + path (fastq) from fastqs_fastqc + + output: + path ("*_fastqc.zip") into fastqc + + script: + """ + hostname >${repRID}.fastqc.err + ulimit -a >>${repRID}.fastqc.err + + # run fastqc + fastqc *.fastq.gz -o . >>${repRID}.fastqc.err + """ +} diff --git a/workflow/tests/test_makeFeatureCounts.py b/workflow/tests/test_makeFeatureCounts.py new file mode 100644 index 0000000000000000000000000000000000000000..f86fe1b522e082aaa62a0854af3abeaf37f105e7 --- /dev/null +++ b/workflow/tests/test_makeFeatureCounts.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import pytest +import pandas as pd +import os +import utils + +data_output_path = os.path.dirname(os.path.abspath(__file__)) + \ + '/../../' + + +@pytest.mark.makeFeatureCounts +def test_makeFeatureCounts(): + assert os.path.exists(os.path.join(data_output_path, 'Q-Y5JA_1M.se.featureCounts')) + assert os.path.exists(os.path.join(data_output_path, 'Q-Y5JA_1M.se.countTable.csv'))