[BioPython] Pairwise BLASTS

Iddo Friedberg idoerg at burnham.org
Tue Jan 31 12:08:38 EST 2006


Attached is a little script I wrote a while ago.

Usage example:

./all_bl2seq   *.fasta


HTH,

Iddo


ajoyner at ucsd.edu wrote:

>Hi,
>Does anyone know of a program that I can use to run Pairwise BLASTS in a batch 
>fashion? This would be as opposed to an online GUI.
>Thanks!
>
>_______________________________________________
>BioPython mailing list  -  BioPython at biopython.org
>http://biopython.org/mailman/listinfo/biopython
>
>
>  
>


-- 
Iddo Friedberg, Ph.D.
Burnham Institute for Medical Research
10901 N. Torrey Pines Rd.
La Jolla, CA 92037 USA
Tel: +1 (858) 646 3100 x3516
Fax: +1 (858) 713 9949
http://iddo-friedberg.org
http://BioFunctionPrediction.org

-------------- next part --------------
#!/usr/bin/python
import sys
import glob
import os
TMP_BLAST_OUT = 'tmp_blast_out'
BLAST_OUT = 'blast_out.blast'

def all_bl2seq(file_list):
	# accepts a file list, does an all-vs-all pairwise BLAST. Must have NCBI tools installed
	for seq1 in file_list:
		print '.',
		for seq2 in file_list[file_list.index(seq1)+1:]:
			os.system('bl2seq -p blastp -i %s -D 1 -j %s -o %s' % (seq1, seq2,  TMP_BLAST_OUT))
			os.system('cat %s >> %s' % (TMP_BLAST_OUT, BLAST_OUT))

if __name__ == "__main__":
	try:
		all_bl2seq(sys.argv[1:])
	except:
		print "usage: all_bl2seq <file-list>"


More information about the BioPython mailing list