[Biojava-l] Multiple sequence alignment in BioJava

Alastair Kilpatrick alastair.m.kilpatrick at googlemail.com
Wed Apr 6 16:40:26 UTC 2011


Thanks - I had just downloaded the BioJava jars manually so that's
fixed the CookBook code. However, I've made some changes in order to
align DNA sequences instead and am running into more errors - this
code:

	public static void main(String[] args) {
		String[] seqs = {"GATTACATTT", "CGATTACATG", "ATGGATTACA"};
		List<DNASequence> lst = new ArrayList<DNASequence>();
		for(String seq : seqs) {
			lst.add(new DNASequence(seq));
		}
		Profile<DNASequence, NucleotideCompound> profile =
Alignments.getMultipleSequenceAlignment(lst); //**
		System.out.println(profile);
		ConcurrencyTools.shutdown();
	}

gives:
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
	at java.util.concurrent.FutureTask.get(Unknown Source)
	at org.biojava3.alignment.Alignments.getListFromFutures(Alignments.java:282)
	at org.biojava3.alignment.Alignments.runPairwiseScorers(Alignments.java:602)
	at org.biojava3.alignment.Alignments.getMultipleSequenceAlignment(Alignments.java:173)
	at CookbookMSA.main(CookbookMSA.java:49)

at the 'alignment' line (**) - not sure what the problem is here, I
see that getMultipleSequenceAlignment() has an extra argument(s) in
the Javadoc but these weren't required in the example?
Final question (hopefully!) - once I have the alignments I require I'd
like to create a sequence logo - is there a way of doing this in
BioJava3? From a google search I've seen references to
DistributionTools.distOverAlignment() and similar, but can't find
anything like that in the new api.

Thanks again, sorry everyone for all the questions!

Alastair


On 6 April 2011 12:09, Scooter Willis <willishf at gmail.com> wrote:
>
> You need to use the forester.jar file from the biojava3 code check out. If you are using maven this should be automatic.
>
> On Apr 6, 2011 5:07 AM, "Alastair Kilpatrick" <alastair.m.kilpatrick at googlemail.com> wrote:
>
> Dear all,
> I'm pretty new to BioJava so I may be missing something - I've checked
> through the list archives without much luck.
> I've been trying to do some multiple sequence alignments but I've been
> running into strange errors. To try and find where the problem is,
> I've just copied the code straight from
> http://biojava.org/wiki/BioJava:CookBook3:MSA and tried to run it, but
> I'm still getting an error:
>
> Caused by: java.lang.ClassNotFoundException:
> org.forester.phylogenyinference.DistanceMatrix
>
> It would seem that this is something to do with forester.jar, which I
> had to download separately (from http://code.google.com/p/forester/)
> as per http://biojava.org/wiki/BioJava:CookBook#biojava3-alignment -
> when I look through the jar in Eclipse, there isn't anything named
> 'phylogenyinference', although there is 'phylogeny', 'phylogeny.data',
> 'phylogeny.factories' and 'phylogeny.iterators'. Is there something
> I'm doing wrong, or is it the case that either one of BioJava or
> forester has been updated and things have broken somewhere (I see the
> CookBook page was updated in July 2010 but forester was updated just
> last month)? Either way, any ideas would be much appreciated!
>
> Many thanks,
> Alastair Kilpatrick
>
> PhD candidate,
> School of Informatics, University of Edinburgh
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l
>




More information about the Biojava-l mailing list