Trying to trim last bp of several samples with BBduk at once

Trying to trim last bp of several samples with BBduk at once



I am trying to use BBduk to trim back my 151bp sequences to 150bp. I tried to create a loop for this so I could do one entire pool at the time, but I do not get any output files. Or at least not where I thought I would get them. It is probably not a difficult problem, but Bioinformatics are quite new for me and I haven’t found a solution yet. (Btw, I work via an ssh connection on a university linux system). Can you help me? This is the script I used so far:


#SBATCH --ntasks=1
#SBATCH --partition=cpu-long
#SBATCH --output=output_%j.txt
#SBATCH --error=error_output_%j.txt
#SBATCH --job-name=trim_adapters_Pool1A
#SBATCH --mail-type=ALL
#SBATCH --mail-user=xxxxxx
#SBATCH --mem=100GB

#Trimmin 150bp Illumina reads back to 150bp

# Change to directory where is
cd /home/s1718118/BBTools/bbmap/

#Run bbduk for al files
for filename in /data/projects/pi-vissermcde/Julia/Pool_1A/*.fastq.gz;
do bash in=$filename out=/data/s1718118/BBdukoutput/Pool1A/ ftm=5;

And this is what i get in the error output file:

java -ea -Xmx42802m -Xms42802m -cp /home/s1718118/BBTools/bbmap/current/ jgi.BBDuk in=/data/projects/pi-vissermcde/Julia/Pool_1A/Li_1177_Julia-Pool-1_74322-8_GACCAAGTTAAATATGCCAG_L001_R1_001_AHG3JLDRXY.filt.fastq.gz out=/data/s1718118/BBdukoutput/Pool1A/ ftm=5
Executing jgi.BBDuk [in=/data/projects/pi-vissermcde/Julia/Pool_1A/Li_1177_Julia-Pool-1_74322-8_GACCAAGTTAAATATGCCAG_L001_R1_001_AHG3JLDRXY.filt.fastq.gz, out=/data/s1718118/BBdukoutput/Pool1A/, ftm=5]
Version 38.92

Unspecified format for output /data/s1718118/BBdukoutput/Pool1A/; defaulting to fastq.
0.028 seconds.
Memory: max=44895m, total=44895m, free=44857m, used=38m

Input is being processed as unpaired
Exception in thread "main" java.lang.RuntimeException: /data/s1718118/BBdukoutput/Pool1A (Is a directory)
    at fileIO.ReadWrite.getRawOutputStream(
    at fileIO.ReadWrite.getOutputStream(
    at fileIO.ReadWrite.getOutputStream(
    at stream.ReadStreamWriter.<init>(
    at stream.ReadStreamByteWriter.<init>(
    at stream.ConcurrentGenericReadOutputStream.<init>(
    at stream.ConcurrentReadOutputStream.getStream(
    at stream.ConcurrentReadOutputStream.getStream(
    at jgi.BBDuk.spawnProcessThreads(
    at jgi.BBDuk.process2(
    at jgi.BBDuk.process(
    at jgi.BBDuk.main(
Caused by: /data/s1718118/BBdukoutput/Pool1A (Is a directory)
    at java.base/ Method)
    at java.base/
    at java.base/<init>(
    at java.base/<init>(
    at fileIO.ReadWrite.getRawOutputStream(
    ... 11 more

Thankyou in advance!

Note: I redacted the email address in script






Read more here: Source link