Mercurial > repos > fubar > microsatbed
comparison find_str.py @ 19:db5523378e5c draft
planemo upload for repository https://github.com/fubar2/microsatbed commit d952bc313f408735456747c3d33e09a3170c8f59-dirty
author | fubar |
---|---|
date | Wed, 17 Jul 2024 07:40:00 +0000 |
parents | 264d79548d19 |
children | 410144c7b2d6 |
comparison
equal
deleted
inserted
replaced
18:607620f93b4c | 19:db5523378e5c |
---|---|
21 specific = None | 21 specific = None |
22 if args.specific: | 22 if args.specific: |
23 specific = args.specific.upper().split(",") | 23 specific = args.specific.upper().split(",") |
24 fa = Fastx(args.fasta, uppercase=True) | 24 fa = Fastx(args.fasta, uppercase=True) |
25 for name, seq in fa: | 25 for name, seq in fa: |
26 if args.specific: | 26 for ssr in pytrf.STRFinder( |
27 ssrs = pytrf.STRFinder( | |
28 name, | 27 name, |
29 seq, | 28 seq, |
30 args.monomin, | 29 args.monomin, |
31 args.dimin, | 30 args.dimin, |
32 args.trimin, | 31 args.trimin, |
33 args.tetramin, | 32 args.tetramin, |
34 args.pentamin, | 33 args.pentamin, |
35 args.hexamin, | 34 args.hexamin, |
36 ) | 35 ): |
37 else: | |
38 ssrs = pytrf.STRFinder( | |
39 name, | |
40 seq, | |
41 args.monomin, | |
42 args.dimin, | |
43 args.trimin, | |
44 args.tetramin, | |
45 args.pentamin, | |
46 args.hexamin, | |
47 ) | |
48 for ssr in ssrs: | |
49 row = ( | 36 row = ( |
50 ssr.chrom, | 37 ssr.chrom, |
51 ssr.start - 1, | 38 ssr.start, |
52 ssr.end, | 39 ssr.end, |
53 ssr.motif, | 40 ssr.motif, |
54 ssr.repeat, | 41 ssr.repeat, |
55 ssr.length, | 42 ssr.length, |
56 ) | 43 ) |
57 # pytrf reports a 1 based start position so start-1 fixes the bed interval lengths | 44 # pytrf reports a 1 based start position so start-1 fixes the bed interval lengths |
58 if args.specific and ssr.motif in specific and ssr.repeat >= args.minreps: | 45 if args.specific and ssr.motif in specific: |
59 bed.append(row) | 46 bed.append(row) |
60 elif args.mono and len(ssr.motif) == 1: | 47 elif args.mono and len(ssr.motif) == 1: |
61 bed.append(row) | 48 bed.append(row) |
62 elif args.di and len(ssr.motif) == 2: | 49 elif args.di and len(ssr.motif) == 2: |
63 bed.append(row) | 50 bed.append(row) |