This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BBDuk returned java.lang.AssertionError

I downloaded all the experiments for SRP332503

esearch -db sra -query SRP332503 | efetch -format runinfo | cut -d ',' -f 1 | grep SRR | xargs -n 1 -P 6000 ./../sratoolkit.3.0.0-ubuntu64/bin/fasterq-dump 

and also the adapters.fa file:

wget github.com/BioInfoTools/BBMap/blob/master/resources/adapters.fa

Now, I want to use bbduk to trim the adapters. I used the following code:

for f in `ls -1 *_1.fastq | sed 's/_1.fastq//’`;
do ./../../bbmap/bbduk.sh -Xmx1g in1=$f\_1.fastq in2=$f\_2.fastq out1=$f\_clean_1.fq out2=$f\_clean_2.fq ref=./../../bbmap/adapters.fa;
Done

Traceback:

java.lang.AssertionError: Improperly formatted fasta file; expecting '>' symbol.
0, 16384, 10,

        at stream.FastaReadInputStream.nextHeader(FastaReadInputStream.java:302)
        at stream.FastaReadInputStream.fillList(FastaReadInputStream.java:176)
        at stream.FastaReadInputStream.hasMore(FastaReadInputStream.java:109)
        at stream.ConcurrentGenericReadInputStream$ReadThread.readLists(ConcurrentGenericReadInputStream.java:668)
        at stream.ConcurrentGenericReadInputStream$ReadThread.run(ConcurrentGenericReadInputStream.java:657)
java -ea -Xmx1g -Xms1g -cp /home-3/mchua4@jhu.edu/bbmap/current/ jgi.BBDuk -Xmx1g in1=SRR18765904_1.fastq in2=SRR18765904_2.fastq out1=SRR18765904_clean_1.fq out2=SRR18765904_clean_2.fq ref=./../../bbmap/adapters.fa
Executing jgi.BBDuk [-Xmx1g, in1=SRR18765904_1.fastq, in2=SRR18765904_2.fastq, out1=SRR18765904_clean_1.fq, out2=SRR18765904_clean_2.fq, ref=./../../bbmap/adapters.fa]
fasta bbduk fastq ngs

github.com/BioInfoTools

This is NOT the official repository for BBTools. BBTools are available via SourceForge. That will get you correct/latest BBTools. adapters.fa file is included in resources folder when you download BBTools from SF.

1 answer

The error already tells you everything you need to know: the adapter file is not in proper format. Did you actually open the adapters.fa file to make sure it looks correct?

GitHub doesn't download files in correct format from the same pages that are used for viewing. Instead, you need the "Raw" link, so I suggest you try it like this:

wget https://github.com/BioInfoTools/BBMap/raw/master/resources/adapters.fa

Log in to answer this question.