Error In Fetching Data from STRING EMBL File

1 view
Skip to first unread message

jitesh dundas

unread,
Dec 18, 2009, 12:02:41 PM12/18/09
to javaposse
Dear Sir/Madam,

I am trying to fetch data from EMBL STRING Database (http://string.embl.de/) for a list of protein interactors. The file is attached with this email.

On executing the code, it gives me a "version number" error.  The same code is working fine when I fetch data from NCBI databases. Thus, I am trying to know what is going wrong here.

I request your reply. Please let me know if you need anything else from my side.

Regards,
Jitesh Dundas


ImportGet.jsp

Thasso Griebel

unread,
Dec 18, 2009, 1:17:39 PM12/18/09
to java...@googlegroups.com
Hi,

uh yeah...bioinformatics...sort of :)

In general I think you have to be a bit more precise about the error
you get and you might want to append a stacktrace or something.
"Version number" error sounds like a "class version number" ? But I
have no idea, could be anything.

I can confirm though that the data URL is fine http://string-db.org/api/tsv/resolve?identifier=ADD&species=9606
. Here is the method I used to fetch the data:

public static void write2File(URL url, File file) throws IOException {
FileOutputStream out = null;
InputStream in = null;
try {
in = url.openStream();
out = new FileOutputStream(file);
byte[] buff = new byte[4096];
int len = 0;
while (-1 != (len = in.read(buff))) {
out.write(buff, 0, len);
}
} finally{
if(out != null)out.close();
if(in != null) in.close();
}
}


with this and your URL a simple

write2File(new URL("http://string-db.org/api/tsv/resolve?identifier=ADD&species=9606
"), new File("/tmp/test.embl"));

works as expected.

On the other hand, please note that the String-DB guys explicitly state:

"Please note that we currently discourage robot access, due to the
heavy load on our server. If you require a large portion of the
interaction data which is contained in STRING, please contact one of
the authors"
(http://string.embl.de/newstring_cgi/show_robot_regulations.pl)

So if you want to integrate this in some sort of service/agent/robot
thingy, a local copy of the database might be a good idea !

cheers,
-thasso

> --
>
> You received this message because you are subscribed to the Google
> Groups "The Java Posse" group.
> To post to this group, send email to java...@googlegroups.com.
> To unsubscribe from this group, send email to javaposse+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/javaposse?hl=en
> .
> <ImportGet.jsp>

--
Dipl. Inf. Thasso Griebel-------------------Lehrstuhl fuer Bioinformatik
Office 3426--http://bio.informatik.uni-jena.de--Institut fuer Informatik
Phone +49 (0)3641 9-46454-----------Friedrich-Schiller-Universitaet Jena
Fax +49 (0)3641 9-46452----------Ernst-Abbe-Platz 2, 07743 Jena, Germany

jitesh dundas

unread,
Dec 18, 2009, 3:10:40 PM12/18/09
to java...@googlegroups.com
Dear Sir,

Many  thanks for your reply. However, your code does not seem to work on my machine. I will try that again.

Meanwhile, I have attached a snapshot of the error that I am facing. Again, once I did get an output file, which seems to return some HTML code (saying-> You have not entered any input)
 
I request your reply.
 
Regards,
Jitesh Dundas
version_number_image.doc

jitesh dundas

unread,
Dec 18, 2009, 4:00:52 PM12/18/09
to java...@googlegroups.com
Dear Dr. Thasso Griebel ,

Finally I have got the output!  It was a simple mistake from my side.

The program needed was for just to read from the URL and not POST to the URL.

I have attached the working code now.

Now the problem is that I dont understand what that means. How to I understand what part is the list of protein interactors for the given term.

Can some one help me in this ? All this is new to me.

Regards,
Jitesh

On Fri, Dec 18, 2009 at 11:47 PM, Thasso Griebel <thasso....@googlemail.com> wrote:
output_File.txt
import.jsp

Thasso Griebel

unread,
Dec 21, 2009, 6:54:47 AM12/21/09
to java...@googlegroups.com
Hi,

probably the wrong place to discuss such things, but your file looks
like you forgot to reappend the newline characters after you read your
line. When you write out the line, append a "\n". This results in a
file similar to this:

stringId ncbiTaxonId taxonName preferredName annotation
9606.ENSP00000333813 9606 Homo sapiens ALG12 Dolichyl-P-Man:Man(7)...
...

So String-DB seems to report in some tab delimited format. I don't
know String-DB and can only guess what sort of information is
provided, but for me, this simply maps the String-ID to an NCBI Taxons
(and its preferred name) and reports the prefered name (ALG12 in this
example) of the mapped protien and its String-DB annotation.

cheers,
-thasso

> <output_File.txt><import.jsp>

jitesh dundas

unread,
Dec 21, 2009, 10:35:01 AM12/21/09
to java...@googlegroups.com
Dear Sir,

Thank you for the information. That was very helpful.

Regards,
Jitesh Dundas
Reply all
Reply to author
Forward
0 new messages