How to read Online sequence from NCBI/Uniprot?
0
0
Entering edit mode
8.2 years ago

I tried with these code for Uniprot but receved nothing inside my variable throws NullpointerException and I/O Exception each time . Please provide me the simple step by step demo if possible.

        // we will tell the UniProt proxy class that we are expecting a sequence that is an amino acid
                set = AminoAcidCompoundSet.getAminoAcidCompoundSet();
// now load the sequence from the UniProt website
                try {
                    uniprotSequence = new UniprotProxySequenceReader<AminoAcidCompound>(uniProtID,set);

                    Log.e("Check * *", String.valueOf(uniprotSequence.getLength()));
                } catch (CompoundNotFoundException e) {
                    e.printStackTrace();
                    Log.e("Check * *", "Compound Not Found Exception");
                } catch (IOException e) {
                    e.printStackTrace();
                    Log.e("Check * *", "I/O Exception");
                }
// and make a protein sequence out of it
                ProteinSequence seq = new ProteinSequence(uniprotSequence);
           // Log.e("Asynck * *",seq.toString());

Also from ncbi is not working

http://biojava.org/wiki/BioJava:CookBook:ExternalSources:NCBIFetch

Please help me to resolve this issue. do I need Buffered or Inputstream

sequence • 1.1k views
ADD COMMENT

Login before adding your answer.

Traffic: 2583 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