#!/usr/bin/env python3 import sys from Bio.Blast import NCBIWWW from Bio.Blast import NCBIXML def Blast_sonde(blastversion, collection, gi): result_handle = NCBIWWW.qblast(blastversion, collection, gi) blast_record = NCBIXML.read(result_handle) E_VALUE_THRESH = 0.04 for alignment in blast_record.alignments: for hsp in alignment.hsps: if hsp.expect < E_VALUE_THRESH: print("****Alignment****") print("sequence:", alignment.title) print("length:", alignment.length) print("e value:", hsp.expect) print(hsp.query[0:75] + "...") print(hsp.match[0:75] + "...") print(hsp.sbjct[0:75] + "...") blastversion = sys.argv[1] collection = sys.argv[2] gi = sys.argv[3] Blast_sonde(blastversion, collection, gi)