[Biojava-l] Undeclared/uncaught exception in Fasta Parser

Hannes Brandstätter-Müller biojava at hannes.oib.com
Thu Oct 20 12:29:14 UTC 2011


If you feed the fasta parser (code from cookbook) with an empty file, you get a
java.lang.ArrayIndexOutOfBoundsException: 0
        at org.biojava3.core.sequence.io.GenericFastaHeaderParser.parseHeader(GenericFastaHeaderParser.java:111)
        at org.biojava3.core.sequence.io.GenericFastaHeaderParser.parseHeader(GenericFastaHeaderParser.java:60)
        at org.biojava3.core.sequence.io.FastaReader.process(FastaReader.java:136)


Code:

FileInputStream inStream = new FileInputStream(inputFileName);
       FastaReader<DNASequence, NucleotideCompound> fastaReader =
               new FastaReader<DNASequence, NucleotideCompound>(
               inStream,
               new GenericFastaHeaderParser<DNASequence, NucleotideCompound>(),
               new DNASequenceCreator(DNACompoundSet.getDNACompoundSet()));
       LinkedHashMap<String, DNASequence> originalSeqs =
fastaReader.process(); //boom!

I believe this exception should either be caught and converted to an
IOException or declared.

Hannes

ps: I also ran into an OutOfMemoryError, I tried MSA with approx.
1000+ sequences :D even though I gave java 4000M - are there any
metrics I can use before starting the MSA to determine If it can work?

java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError:
GC overhead limit exceeded
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at org.biojava3.alignment.Alignments.getProgressiveAlignment(Alignments.java:560)
        at org.biojava3.alignment.Alignments.getMultipleSequenceAlignment(Alignments.java:187)
        at ...
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.lang.Integer.valueOf(Integer.java:601)
        at org.biojava3.core.sequence.location.SimplePoint.getPosition(SimplePoint.java:55)
        at org.biojava3.alignment.SimpleAlignedSequence.isGap(SimpleAlignedSequence.java:231)
        at org.biojava3.alignment.SimpleAlignedSequence.getSequenceIndexAt(SimpleAlignedSequence.java:205)
        at org.biojava3.alignment.SimpleAlignedSequence.getCompoundAt(SimpleAlignedSequence.java:270)
        at org.biojava3.alignment.SimpleProfile.getCompoundsAt(SimpleProfile.java:231)
        at org.biojava3.alignment.SimpleProfile.getCompoundCountsAt(SimpleProfile.java:217)
        at org.biojava3.alignment.SimpleProfile.getCompoundWeightsAt(SimpleProfile.java:249)
        at org.biojava3.alignment.template.AbstractProfileProfileAligner.reset(AbstractProfileProfileAligner.java:235)
        at org.biojava3.alignment.template.AbstractProfileProfileAligner.isReady(AbstractProfileProfileAligner.java:215)
        at org.biojava3.alignment.template.AbstractMatrixAligner.align(AbstractMatrixAligner.java:270)
        at org.biojava3.alignment.template.AbstractProfileProfileAligner.getPair(AbstractProfileProfileAligner.java:158)
        at org.biojava3.alignment.template.CallableProfileProfileAligner.call(CallableProfileProfileAligner.java:54)
        at org.biojava3.alignment.template.CallableProfileProfileAligner.call(CallableProfileProfileAligner.java:38)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError:
GC overhead limit exceeded
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at org.biojava3.alignment.template.AbstractProfileProfileAligner.isReady(AbstractProfileProfileAligner.java:210)
        at org.biojava3.alignment.template.AbstractMatrixAligner.align(AbstractMatrixAligner.java:270)
        at org.biojava3.alignment.template.AbstractProfileProfileAligner.getPair(AbstractProfileProfileAligner.java:158)
        at org.biojava3.alignment.template.CallableProfileProfileAligner.call(CallableProfileProfileAligner.java:54)
        at org.biojava3.alignment.template.CallableProfileProfileAligner.call(CallableProfileProfileAligner.java:38)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.lang.Integer.valueOf(Integer.java:601)
        at org.biojava3.core.sequence.location.SimplePoint.getPosition(SimplePoint.java:55)
        at org.biojava3.alignment.SimpleAlignedSequence.isGap(SimpleAlignedSequence.java:231)
        at org.biojava3.alignment.SimpleAlignedSequence.getSequenceIndexAt(SimpleAlignedSequence.java:205)
        at org.biojava3.alignment.SimpleAlignedSequence.getCompoundAt(SimpleAlignedSequence.java:270)
        at org.biojava3.alignment.SimpleProfile.getCompoundsAt(SimpleProfile.java:231)
        at org.biojava3.alignment.SimpleProfile.getCompoundCountsAt(SimpleProfile.java:217)
        at org.biojava3.alignment.SimpleProfile.getCompoundWeightsAt(SimpleProfile.java:249)
        at org.biojava3.alignment.template.AbstractProfileProfileAligner.reset(AbstractProfileProfileAligner.java:235)
        at org.biojava3.alignment.template.AbstractProfileProfileAligner.isReady(AbstractProfileProfileAligner.java:215)
        ... 9 more



More information about the Biojava-l mailing list