代码有什么问题?
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 线程“main”中的异常java.lang.NoSuchMethodError:org.forester.phylogeny.PhylogenyNode.addAsChild(Lorg / forester / phylogeny / PhylogenyNode;)V 在org.forester.evoinference.distance.NeighborJoining.execute(NeighborJoining.java:127) 在org.biojava3.alignment.GuideTree。(GuideTree.java:88) 在org.biojava3.alignment.Alignments.getMultipleSequenceAlignment(Alignments.java:183) 在Fasta.main(Fasta.java:42)
答案 0 :(得分:1)
问题是您使用的是错误版本的林务员。
根据Maven pom文件,Biojava 3.08依赖于forester 1.005,而它的谷歌代码页上最新版本的forester是1.028。
从Biojava maven存储库获取jar也可能更好,以确保使用正确的版本。
从此网址下载jar: