What is wrong in code?
public static void main(String[] args) throws Exception{
ArrayList<String> fileName = new ArrayList<String> ();
fileName.add("2M3T.fasta.txt");
fileName.add("3LWK.fasta.txt");
ArrayList<ProteinSequence> al = new ArrayList<ProteinSequence>();
ArrayList<ProteinSequence> all = new ArrayList<ProteinSequence>();
for (String fn : fileName)
{
al = getProteinSequenceFromFasta(fn);
all.add(al.get(0));
for (ProteinSequence s : al)
{
System.out.println(s);
}
}
Profile<ProteinSequence, AminoAcidCompound> profile = Alignments.getMultipleSequenceAlignment(all);
System.out.printf("Clustalw:%n%s%n", profile);
ConcurrencyTools.shutdown();
}
//for (int i=0;i<sequence.size();i++)
// System.out.println(sequence);
public static ArrayList<ProteinSequence> getProteinSequenceFromFasta(String file) throws Exception{
LinkedHashMap<String, ProteinSequence> a = FastaReaderHelper.readFastaProteinSequence(new File(file));
//sztuczne
ArrayList<ProteinSequence> sequence = new ArrayList<ProteinSequence>(a.values());
return sequence;
}
}
GSKTGTKITFYEDKNFQGRRYDCDCDCADFHTYLSRCNSIKVEGGTWAVYERPNFAGYMYILPQGEYPEYQRWMGLNDRLSSCRAVHLPSGGQYKIQIFEKGDFSGQMYETTEDCPSIMEQFHMREIHSCKVLEGVWIFYELPNYRGRQYLLDKKEYRKPIDWGAASPAVQSFRRIVE SMSAGPWKMVVWDEDGFQGRRHEFTAECPSVLELGFETVRSLKVLSGAWVGFEHAGFQGQQYILERGEYPSWDAWGGNTAYPAERLTSFRPAACANHRDSRLTIFEQENFLGKKGELSDDYPSLQAMGWEGNEVGSFHVHSGAWVCSQFPGYRGFQYVLECDHHSGDYKHFREWGSHAPTFQVQSIRRIQQ Exception in thread "main" java.lang.NoSuchMethodError: org.forester.phylogeny.PhylogenyNode.addAsChild(Lorg/forester/phylogeny/PhylogenyNode;)V at org.forester.evoinference.distance.NeighborJoining.execute(NeighborJoining.java:127) at org.biojava3.alignment.GuideTree.(GuideTree.java:88) at org.biojava3.alignment.Alignments.getMultipleSequenceAlignment(Alignments.java:183) at Fasta.main(Fasta.java:42)
The problem is you are using the wrong version of forester.
According to the Maven pom file, Biojava 3.08 depends on forester 1.005 while the latest version of forester on it's google code page is 1.028.
It's probably also better to get the jar from the Biojava maven repository to ensure the correct versions are used.
download the jar from this URL: