This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to read Online sequence from NCBI/Uniprot?

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

0 answers

No answers yet.

Log in to answer this question.