def find_homologs(query_file, subject_genome, e_value, max_hits, working_dir, blast_mat_root, wordsize, percent_aligned, extra_params={}, require_hit=False, DEBUG=True):
 start_time = time()
 raw_blast_output = []
 seqs = open(query_file, 'U').readlines()
 if DEBUG:
  print ('BLASTING %s vs. %s' % (query_file, subject_genome))
 blast_db = subject_genome
 raw_output_data = blast_genome(seqs, blast_db, e_value, max_hits, wordsize, working_dir, blast_mat_root, extra_params, DEBUG=DEBUG)
 if DEBUG:
  print 'Length of raw BLAST results:', len(raw_output_data)
 curr_blast_result = BlastResult(raw_output_data)
 align_filter = make_percent_align_filter(percent_aligned)
 (filtered_ids, removed_ids) = query_ids_from_blast_result(curr_blast_result, align_filter, DEBUG=DEBUG)
 return (raw_output_data, filtered_ids, removed_ids)

def find_homologs ( query_file , subject_genome , e_value , max_hits , working_dir , blast_mat_root , wordsize , percent_aligned , extra_params = { } , require_hit = False , DEBUG = True ) : start_time = time ( ) raw_blast_output = [ ] seqs = open ( query_file , 'U' ) . readlines ( ) if DEBUG : print ( 'BLASTING %s vs. %s' % ( query_file , subject_genome ) ) blast_db = subject_genome raw_output_data = blast_genome ( seqs , blast_db , e_value , max_hits , wordsize , working_dir , blast_mat_root , extra_params , DEBUG = DEBUG ) if DEBUG : print 'Length of raw BLAST results:' , len ( raw_output_data ) curr_blast_result = BlastResult ( raw_output_data ) align_filter = make_percent_align_filter ( percent_aligned ) ( filtered_ids , removed_ids ) = query_ids_from_blast_result ( curr_blast_result , align_filter , DEBUG = DEBUG ) return ( raw_output_data , filtered_ids , removed_ids )
blast query_file against subject_genome query_file -- .