This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Getting gene sequence from ncbi BioJava

Hello. I've been dealing with sequence parsing lately and I can't seem to download a gene sequence from NCBI. My previous code returns me the gene name (for example TGFB1). So again, what I am trying to accomplish here is use java code to fetch gene sequence (I've been tying with geneRICH class in BioJava but it doesn't seem to have that option, only accession number and genbank id).

Thanks for any help.

identifiers biojava

1 answer

You need to find the sequences associated to this gene (e.g : refseq sequences) using NCBI utilities. e.g: Get Fasta File With Protein Sequences Given Entrez Gene Ids

Furthermore, Biojava is not really needed to fetch the sequence. You can use xjc to generate the classes

xjc -dtd "http://www.ncbi.nlm.nih.gov/dtd/NCBI_TSeq.dtd"
parsing a schema...
compiling a schema...
generated/ObjectFactory.java
generated/TSeq.java
generated/TSeqSeqtype.java
generated/TSeqSet.java

and use those classes to parse a ncbi EUtilities efetch URL

See http://plindenbaum.blogspot.fr/2006/12/java-16-mustang-jaxb-and.html (old!)

Wow, thanks for the thorough answer. I will look into those possibilities.

Log in to answer this question.