Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddbj-repo/af6f2a4165385224de18cc5968568848 to your computer and use it in GitHub Desktop.
Save ddbj-repo/af6f2a4165385224de18cc5968568848 to your computer and use it in GitHub Desktop.
import java.util.LinkedHashMap;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.client.HttpClientErrorException;
import net.arnx.jsonic.JSON;
/*
* (中略)
*/
/*
* 覚えておいた Request ID を使って GET する。
*/
String requestId = "wabi_blast_1111-1111-1111-11-111-111111";
MultiValueMap<String, String> parts = new LinkedMultiValueMap<String, String>();
parts.add("info", "result");
parts.add("format", "bigfile");
try {
RestTemplate rest = new RestTemplate();
String response = rest.getForObject("http://ddbj.nig.ac.jp/wabi/blast/" + requestId, String.class, parts);
/*
---- response の例 (ここから) --------------------------------
BLASTN 2.2.25 [Feb-01-2011]
Reference: Altschul, Stephen F., Thomas L. Madden, Alejandro A. Schaffer,
Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997),
"Gapped BLAST and PSI-BLAST: a new generation of protein database search
programs", Nucleic Acids Res. 25:3389-3402.
Query= AB000095|AB000095.1 Homo sapiens mRNA for hepatocyte growth
factor activator inhibitor, complete cds.
(1740 letters)
Database: hum
572,091 sequences; 5,019,832,159 total letters
Searching..................................................done
Score E
Sequences producing significant alignments: (bits) Value
AB000095|AB000095.1 Homo sapiens mRNA for hepatocyte growth fact... 3449 0.0
BC018702|BC018702.1 Homo sapiens serine peptidase inhibitor, Kun... 3435 0.0
BC004140|BC004140.1 Homo sapiens serine peptidase inhibitor, Kun... 3190 0.0
BT007425|BT007425.1 Homo sapiens serine protease inhibitor, Kuni... 3053 0.0
AY358969|AY358969.1 Homo sapiens clone DNA35880 HAI-1 (UNQ223) m... 2145 0.0
AY296715|AY296715.1 Homo sapiens hepatocyte growth factor activa... 1984 0.0
---- response の例 (後略) ------------------------------------
*/
} catch (HttpClientErrorException e) {
/*
* 入力値エラー等。
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment