This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Trimmomatic Error : java.lang.ArrayIndexOutOfBoundsException: 1

Hello,

I am getting the following error when trying to use trimmomatic. I cannot figure out what is wrong. I have reformatted my adapter fasta to be similar to theirs. I couldn't find any strange spaces in my arguments. Any help would be appreciated.

Here is my command:

java -jar path/to/trimmomatic-0.36.jar SE -phred33 in.fq.gz out.fq.gz ILLUMINACLIP:/path/to/adapter.fasta
TrimmomaticSE: Started with arguments:
 -phred33 in.fq.gz out.fq.gz ILLUMINACLIP:/path/to/adapter.fasta 
Automatically using 1 threads
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
    at org.usadellab.trimmomatic.trim.IlluminaClippingTrimmer.makeIlluminaClippingTrimmer(IlluminaClippingTrimmer.java:54)
    at org.usadellab.trimmomatic.trim.TrimmerFactory.makeTrimmer(TrimmerFactory.java:32)
    at org.usadellab.trimmomatic.Trimmomatic.createTrimmers(Trimmomatic.java:59)
    at org.usadellab.trimmomatic.TrimmomaticSE.run(TrimmomaticSE.java:303)
    at org.usadellab.trimmomatic.Trimmomatic.main(Trimmomatic.java:85)

My adapter file:

>adapter_SE
NNNNTGGAATTCTCGGGTGCCAAGG

Thanks

qc trimmomatic

Remove the Ns at the beginning of your adapter sequence, rerun the command, and see if that solves your problem.

1 answer

there error is here: https://github.com/timflutre/trimmomatic/blob/3694641a92d4dd9311267fed85b05c7a11141e7c/src/org/usadellab/trimmomatic/trim/IlluminaClippingTrimmer.java#L54

I don't know trimmomatic but i imagine that this argument is not valid

ILLUMINACLIP:/path/to/adapter.fasta

syntax looks like this:

        String arg[] = args.split(":");

        File seqs=new File(arg[0]);

        int seedMaxMiss = Integer.parseInt(arg[1]);
        int minPalindromeLikelihood = Integer.parseInt(arg[2]);
int minSequenceLikelihood = Integer.parseInt(arg[3]);

... aaaaannd looking in the manual: http://www.usadellab.org/cms/?page=trimmomatic

 ILLUMINACLIP:<fastaWithAdaptersEtc>:<seed mismatches>:<palindrome clip threshold>:<simple clip threshold> 

Thanks thats right!. Just found that too. I kept overlooking it in the docs.

Log in to answer this question.