snakemake-workflows / rna-seq-star-deseq2

RNA-seq workflow using STAR and DESeq2
MIT License
327 stars 203 forks source link

Pipeline failing with cutadapt #65

Closed aryazand closed 1 year ago

aryazand commented 1 year ago

Hello,

When I set trimming to true in the config file, I get the following error

cutadapt: error: unrecognized arguments: pipe/cutadapt/1/lane1.fq1.fastq.gz pipe/cutadapt/1/lane1.fq2.fastq.gz

In looking through log files, it appears this error occurs with the following command (which is called by the cutadapt_pe recipe):

subprocess.CalledProcessError: Command 'set -euo pipefail; cutadapt --cores 8 nan -o results/trimmed/1_lane2_R1.fastq.gz -p results/trimmed/1_lane2_R2.fastq.gz pipe/cutadapt/1/lane2.fq1.fastq.gz pipe/cutadapt/1/lane2.fq2.fastq.gz > results/trimmed/1_lane2.paired.qc.txt 2> logs/cutadapt/1_lane2.log' returned non-zero exit status 2.

I haven't been able to figure out why there is this "unrecognized arguments" error, since commands seems to look good to me. Any help with this would be appreciated!

dlaehnemann commented 1 year ago

What I have just spotted is this:

--cores 8 nan

In the cutadapt-pe wrapper code, the place where nan appears is where usually an adapter sequence is inserted via whatever is specified in params: adapters=. In this workflow, this is pulled in from the units.tsv file (from a column called adapters):

https://github.com/snakemake-workflows/rna-seq-star-deseq2/blob/896007e18b72295fdc51961644b27477a2c8c54c/workflow/rules/trim.smk#L36

So I guess that you either have not specified an adapter sequence (including the cutadapt adapter type specification flag) to cut for this particular unit, or your units.tsv has some more subtle formatting problem that messes up columns (a whitespace as a separator instead of a tab somewhere, for example).

And cutadapt then only recognizes the

aryazand commented 1 year ago

Thank you, this fixed it!

dlaehnemann commented 1 year ago

Good to hear. I'll also amend the description for the snakemake workflow catalog accordingly in a pull request I am preparing. So hopefully, this will be clearer to future users of the workflow.

dlaehnemann commented 1 year ago

Just as a cross-reference, the info is now in #66, provided by these added comments in the config.yamls and a dedicated adapter trimming section in the reworked config/README.md that gets presented via the snakemake workflow catalog usage info.