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
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>