CookbookMSA Multiple Sequence Alignement error in biojava demo
1
0
Entering edit mode
10.3 years ago

Hello I'm trying to run the Multiple Sequence Alignment using biojava and ready code recommended by biojava

public class CookbookMSA {

    public static void main(String[] args) {
        String[] ids = new String[] {"Q21691", "Q21495", "O48771"};
        try {
            multipleSequenceAlignment(ids);
        } catch (Exception e){
            e.printStackTrace();
        }
    }

    private static void multipleSequenceAlignment(String[] ids) throws Exception {
        List<ProteinSequence> lst = new ArrayList<ProteinSequence>();
        for (String id : ids) {
            lst.add(getSequenceForId(id));
        }
        Profile<ProteinSequence, AminoAcidCompound> profile = Alignments.getMultipleSequenceAlignment(lst);
        System.out.printf("Clustalw:%n%s%n", profile);
        ConcurrencyTools.shutdown();
    }

    private static ProteinSequence getSequenceForId(String uniProtId) throws Exception {
        URL uniprotFasta = new URL(String.format("<a href="http://www.uniprot.org/uniprot/%s.fasta">http://www.uniprot.org/uniprot/%s.fasta</a>", uniProtId));
        ProteinSequence seq = FastaReaderHelper.readFastaProteinSequence(uniprotFasta.openStream()).get(uniProtId);
        System.out.printf("id : %s %s%n%s%n", uniProtId, seq, seq.getOriginalHeader());
        return seq;
    }

}

But I got an error:

id : A3SA23 MKFTFFLMLGTSALALSAGVATAQDAVDLGEIIIQSEEDPTGPVVGYAAGTTASTKSGRSLLETPSSVTVVTTDQIEDTAANNLSEALGYAAGVVTEAYGADPRFDSISVRGADLQNQIYLNGLQFSRSTRPNYGAPSLDLYGMERVELLRGPNSVLYGAGSPAGLVNLIQKRAQSDGDTTELGLHADGNGSHYVFGDANRVVDDRFAYRIVGKAGNRVLGIDEYDNPGAYLGFAAKYQATDATTVEFLLSYQDDDPDSPSGVPNGLVGTRSDEDLRDFYFGNEALEYGDRKVLNLGAQVTHTFDNGWRLVSNTGVTKFDWSYSNLFVGGVTGTDVARTQLLQDEDVTSYATDLRLEGSALTGDVLHNLAFGIDASRFEETALSVFYYGQDSIDFAAPDYSPITPVRDGASWYANKNVTVEQVGIYASDEIEYGNWRAGLALRHDRNKSEGQSNTLYTVPGSGGTPGTVDLTRDDSATTGQASLGYVWDNGVSAYLSYGTSFQSFAEPGDTGTALDPTTGEQWEVGAKYLPATLDAYLSASVYQLEEKNRPVYVQNGAGVRAYDQVGKSRIRGLELEGRANLADGWSVTGGYSYTDSEIIGGDNNGNELGLTPKHTFKLWASKEIQGGPLAGLTVGAGARFIGERYAFNANANQLDSVTLLDAAVSYDFDDGTELQVNVTNLTDEAYVSSVGYFSTYYGDGRTISATLSKKW
tr|A3SA23|A3SA23_9RHOB TonB dependent, hydroxamate-type ferrisiderophore, outer membrane receptor OS=Sulfitobacter sp. EE-36 GN=EE36_08023 PE=3 SV=1
java.lang.ArrayIndexOutOfBoundsException: 0
 at org.biojava3.core.sequence.io.GenericFastaHeaderParser.parseHeader(GenericFastaHeaderParser.java:113)
 at org.biojava3.core.sequence.io.GenericFastaHeaderParser.parseHeader(GenericFastaHeaderParser.java:60)
 at org.biojava3.core.sequence.io.FastaReader.process(FastaReader.java:182)
 at org.biojava3.core.sequence.io.FastaReader.process(FastaReader.java:108)
 at org.biojava3.core.sequence.io.FastaReaderHelper.readFastaProteinSequence(FastaReaderHelper.java:100)
 at CookbookMSA.getSequenceForId(CookbookMSA.java:35)
 at CookbookMSA.multipleSequenceAlignment(CookbookMSA.java:26)
 at CookbookMSA.main(CookbookMSA.java:17)

what does it mean?

I use Windows, and Eclipse Luna

multiple-sequence-alignment biojava • 2.4k views
ADD COMMENT
0
Entering edit mode
10.3 years ago
andreas.prlic ▴ 290

One of the UniProt IDs in the example got deleted. http://www.uniprot.org/uniprot/Q21495. Try these UniProt accession codes instead: Q21691 A8WS47 O48771

ADD COMMENT
0
Entering edit mode

This is true. But I noticed that problem is with java. I have jre8, I dont know why but biojava works only with jre7

ADD REPLY
0
Entering edit mode

if you get the latest trunk code from github, it works also with Java 8.

ADD REPLY

Login before adding your answer.

Traffic: 1944 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6