zach charlop-powers

Remote Blast

Fri Jul 8, 2016

Somewhat amazingly I didn’t realize how easy/awesome blast’s -remote flag is. Heres a piece of the human beta globin gene blasted against NCBI’s nt db. This is an immensely useful feature; thank you NCBI.

#make a small fastafile
echo -e ">hemoglobinbeta\nTGTGTGCTTATTTGCATATTCATAATCTCCCTACTTTATTTTCTTTTATTTTT\n" > testseq.fna

#blast outfmt 6 is tabular
blastn -db nt -query testseq.fna -remote -outfmt 6

hemoglobinbeta	gi|1036032571|gb|AH001475.2|	100.00	57	0	0	1	57	2405	2461	3e-20	106
hemoglobinbeta	gi|970597825|gb|KU350152.1|	100.00	57	0	0	1	57	1269	1325	3e-20	106
hemoglobinbeta	gi|970597823|gb|KR028331.1|	100.00	57	0	0	1	57	1269	1325	3e-20	106
hemoglobinbeta	gi|730321889|gb|KM504957.1|	100.00	57	0	0	1	57	843	899	3e-20	106
hemoglobinbeta	gi|302313136|gb|GU324922.1|	100.00	57	0	0	1	57	2844	2900	3e-20	106
hemoglobinbeta	gi|288899267|gb|GU372416.1|	100.00	57	0	0	1	57	231	287	3e-20	106
...
...
...

#the default format includes alignments
blastn -db nt -query testseq.fna -remote


>gb|AH001475.2| Homo sapiens beta-globin gene, complete cds
Length=4355

 Score = 99.0 bits (53),  Expect = 4e-18
 Identities = 53/53 (100%), Gaps = 0/53 (0%)
 Strand=Plus/Plus

Query  1     TGTGTGCTTATTTGCATATTCATAATCTCCCTACTTTATTTTCTTTTATTTTT  53
             |||||||||||||||||||||||||||||||||||||||||||||||||||||
Sbjct  2405  TGTGTGCTTATTTGCATATTCATAATCTCCCTACTTTATTTTCTTTTATTTTT  2457

...
...
...


All content copyright 2014-2022 zach charlop-powers unless otherwise noted. Licensed under Creative Commons.

Find me on Twitter, GitHub, or drop me a line. Made with HUGO with inspiration from KH and DFM,