This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BioJava - Problems with creating DNASequence objects

Hi!

I've just started working with BioJava4. I need to construct MSA object with my predefined DNA sequences.

To do so, I want to create DNASequence objects from strings. Based on the cookbook and javadocs, I try to do it the following way:

String a = "ACTTG";
DNASequence haplo_1 = new DNASequence(a);

Then I get an error that I should throw an CompoundNotFoundException, so I surround it with try-catch clause as follows:

try {
        DNASequence haplo_1 = new DNASequence(a);
    } catch (CompoundNotFoundException e1) {
        e1.printStackTrace();
    }

When I run this code, I get neither the error nor object - any outcome, any exception, nothing... I tried to catch standard Exception but the result is exactly the same - no result at all.

Have you ever encountered such problem and can give me a hint to solve it?

software-error biojava sequence

1 answer

There is nothing wrong with your code. Try doing something with the sequence object...

Log in to answer this question.