Question: CookbookMSA Multiple Sequence Alignement error in biojava demo
0
gravatar for ewa_kania-15
4.6 years ago by
United Kingdom
ewa_kania-150 wrote:

Hello I'm trying to run the Multiple Sequence Alignement 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("http://www.uniprot.org/uniprot/%s.fasta", 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

ADD COMMENTlink modified 4.6 years ago by andreas.prlic290 • written 4.6 years ago by ewa_kania-150
0
gravatar for andreas.prlic
4.6 years ago by
andreas.prlic290
San Diego
andreas.prlic290 wrote:

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 COMMENTlink modified 4.6 years ago • written 4.6 years ago by andreas.prlic290

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 REPLYlink written 4.6 years ago by ewa_kania-150

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

ADD REPLYlink written 4.6 years ago by andreas.prlic290
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1872 users visited in the last hour