Mercurial > repos > cpt > cpt_putative_isp
comparison generate-putative-isp.py @ 3:08499fbf8697 draft
planemo upload commit 96d9c038cdd9f83fcc55d2f20ab1057129d11589-dirty
author | cpt |
---|---|
date | Wed, 18 Sep 2024 04:02:06 +0000 |
parents | 4e02e6e9e77d |
children | bc16792ecfd2 |
comparison
equal
deleted
inserted
replaced
2:0a02ef22ce17 | 3:08499fbf8697 |
---|---|
3 ##### findSpanin.pl --> findSpanin.py | 3 ##### findSpanin.pl --> findSpanin.py |
4 ######### Incooperated from the findSpanin.pl script, but better and more snakey. | 4 ######### Incooperated from the findSpanin.pl script, but better and more snakey. |
5 | 5 |
6 import argparse | 6 import argparse |
7 from cpt import OrfFinder | 7 from cpt import OrfFinder |
8 from Bio import SeqIO | |
9 from Bio import Seq | |
10 import re | 8 import re |
11 from spaninFuncs import * | 9 from spaninFuncs import * |
12 import os | 10 |
13 | |
14 # if __name__ == '__main__': | |
15 # pass | |
16 ############################################################################### | |
17 | 11 |
18 if __name__ == "__main__": | 12 if __name__ == "__main__": |
19 | |
20 # Common parameters for both ISP / OSP portion of script | |
21 | 13 |
22 parser = argparse.ArgumentParser( | 14 parser = argparse.ArgumentParser( |
23 description="Get putative protein candidates for spanins" | 15 description="Get putative protein candidates for spanins" |
24 ) | 16 ) |
25 parser.add_argument( | 17 parser.add_argument( |
210 args.out_isp_prot.close() | 202 args.out_isp_prot.close() |
211 args.out_isp_prot = open(args.out_isp_prot.name, "r") | 203 args.out_isp_prot = open(args.out_isp_prot.name, "r") |
212 | 204 |
213 pairs = tuple_fasta(fasta_file=args.out_isp_prot) | 205 pairs = tuple_fasta(fasta_file=args.out_isp_prot) |
214 | 206 |
215 # print(pairs) | |
216 | |
217 have_tmd = [] # empty candidates list to be passed through the user input criteria | 207 have_tmd = [] # empty candidates list to be passed through the user input criteria |
218 | 208 |
219 for ( | 209 for each_pair in pairs: |
220 each_pair | |
221 ) in ( | |
222 pairs | |
223 ): # grab transmembrane domains from spaninFuncts (queries for lysin snorkels # and a range of hydrophobic regions that could be TMDs) | |
224 if len(each_pair[1]) <= args.max_isp: | 210 if len(each_pair[1]) <= args.max_isp: |
225 try: | 211 try: |
226 have_tmd += find_tmd( | 212 have_tmd += find_tmd( |
227 pair=each_pair, | 213 pair=each_pair, |
228 minimum=args.isp_min_dist, | 214 minimum=args.isp_min_dist, |