comparison filter_by_fasta_ids.py @ 7:0a189243186d draft

planemo upload for repository https://github.com/TGAC/earlham-galaxytools/tree/master/tools/t_coffee commit 88e1592fa528db1941bce52c588d4347a69cc745
author earlhaminst
date Wed, 18 Sep 2019 06:37:40 -0400
parents fa59d6fea7f5
children
comparison
equal deleted inserted replaced
6:c67bd5acbae2 7:0a189243186d
33 return atarget 33 return atarget
34 return None 34 return None
35 35
36 36
37 def main(): 37 def main():
38 ''' the main function'''
39
40 used_sequences = set() 38 used_sequences = set()
41 work_summary = {'wanted': 0, 'found': 0, 'duplicates': 0} 39 work_summary = {'wanted': 0, 'found': 0, 'duplicates': 0}
42 targets = []
43 40
44 with open(sys.argv[1]) as f_target: 41 with open(sys.argv[1]) as f_target:
45 for line in f_target.readlines(): 42 targets = [">%s" % _.strip().upper() for _ in f_target]
46 targets.append(">%s" % line.strip().upper())
47 43
48 work_summary['wanted'] = len(targets) 44 work_summary['wanted'] = len(targets)
49 45
50 for entry in FASTAReader_gen(sys.argv[2]): 46 for entry in FASTAReader_gen(sys.argv[2]):
51 target_matched_results = target_match(targets, entry.header) 47 target_matched_results = target_match(targets, entry.header)