Trimmomatic adapter file not found when running using conda environment (Nextflow)
1
0
Entering edit mode
8 weeks ago
Eliveri ▴ 100

I have a nextflow script which uses trimmomatic, I am running the script using a conda environment from HPC server. Trimmomatic is able to run however it does now find the adapter TruSeq3-PE.fa that comes with the Trimmomatic package.

script:
"""
    trimmomatic \
        PE -phred33 \
        ${reads[0]} ${reads[1]} \
        "trimmed_${pair_id}_R1_paired.fastq.gz" "trimmed_${pair_id}_R1_unpaired.fastq.gz" \
        "trimmed_${pair_id}_R2_paired.fastq.gz" "trimmed_${pair_id}_R2_unpaired.fastq.gz" \
        ILLUMINACLIP:TruSeq3-PE.fa:2:30:10:2:True \
        LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36 -threads 12
"""

My current workaround is to store the TruSeq3-PE.fa file in the project directory and point to its path. Is there a better way to do this? I plan to eventually containerize the workflow.

params.adapter = "$projectDir/ref/TruSeq3-PE.fa"

    script:
    """
    trimmomatic \
        PE -phred33 \
        ${reads[0]} ${reads[1]} \
        "trimmed_${pair_id}_R1_paired.fastq.gz" "trimmed_${pair_id}_R1_unpaired.fastq.gz" \
        "trimmed_${pair_id}_R2_paired.fastq.gz" "trimmed_${pair_id}_R2_unpaired.fastq.gz" \
        ILLUMINACLIP:$adapter:2:30:10:2:True \
        LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36 -threads 12
    """
Conda Adapter Nextflow Trimmomatic environment • 268 views
ADD COMMENT
3
Entering edit mode
8 weeks ago

quick hack.

"""
cat << EOF > TruSeq3-PE.fa
>PrefixPE/1
TACACTCTTTCCCTACACGACGCTCTTCCGATCT
>PrefixPE/2
GTGACTGGAGTTCAGACGTGTGCTCTTCCGATCT
EOF

(...)
"""

or

"""
wget -O TruSeq3-PE.fa "https://raw.githubusercontent.com/usadellab/Trimmomatic/main/adapters/TruSeq3-PE.fa"

(...)
"""
ADD COMMENT

Login before adding your answer.

Traffic: 2377 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6