Mercurial > repos > artbio > lumpy_sv
comparison extractSplitReads_BwaMem.py @ 6:48e97429a749 draft default tip
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy_sv commit 37c0f0938a5cad74c954a89827a6a08bbbb81cb0
author | artbio |
---|---|
date | Mon, 08 Jul 2024 22:23:10 +0000 |
parents | 1ed8619a5611 |
children |
comparison
equal
deleted
inserted
replaced
5:6ae3a402b9af | 6:48e97429a749 |
---|---|
19 sam = SAM(samList) | 19 sam = SAM(samList) |
20 if includeDups == 0 and (1024 & sam.flag) == 1024: | 20 if includeDups == 0 and (1024 & sam.flag) == 1024: |
21 continue | 21 continue |
22 for el in sam.tags: | 22 for el in sam.tags: |
23 if "SA:" in el: | 23 if "SA:" in el: |
24 if(len(el.split(";"))) <= numSplits: | 24 if (len(el.split(";"))) <= numSplits: |
25 split = 1 | 25 split = 1 |
26 mate = el.split(",") | 26 mate = el.split(",") |
27 mateCigar = mate[3] | 27 mateCigar = mate[3] |
28 mateFlag = int(0) | 28 mateFlag = int(0) |
29 if mate[2] == "-": | 29 if mate[2] == "-": |
101 elif (flag & 0x0010): | 101 elif (flag & 0x0010): |
102 cigarOpStrings = cigarSearch.findall(cigar) | 102 cigarOpStrings = cigarSearch.findall(cigar) |
103 cigarOps = [] | 103 cigarOps = [] |
104 for opString in cigarOpStrings: | 104 for opString in cigarOpStrings: |
105 cigarOpList = atomicCigarSearch.findall(opString) | 105 cigarOpList = atomicCigarSearch.findall(opString) |
106 # print cigarOpList | |
107 # "struct" for the op and it's length | 106 # "struct" for the op and it's length |
108 cigar = cigarOp(cigarOpList[0][0], cigarOpList[0][1]) | 107 cigar = cigarOp(cigarOpList[0][0], cigarOpList[0][1]) |
109 # add to the list of cigarOps | 108 # add to the list of cigarOps |
110 cigarOps.append(cigar) | 109 cigarOps.append(cigar) |
111 cigarOps = cigarOps | 110 cigarOps = cigarOps |
118 cigarOpList = atomicCigarSearch.findall(opString) | 117 cigarOpList = atomicCigarSearch.findall(opString) |
119 # "struct" for the op and it's length | 118 # "struct" for the op and it's length |
120 cigar = cigarOp(cigarOpList[0][0], cigarOpList[0][1]) | 119 cigar = cigarOp(cigarOpList[0][0], cigarOpList[0][1]) |
121 # add to the list of cigarOps | 120 # add to the list of cigarOps |
122 cigarOps.append(cigar) | 121 cigarOps.append(cigar) |
123 # cigarOps = cigarOps | 122 return cigarOps |
124 return(cigarOps) | |
125 | 123 |
126 | 124 |
127 def calcQueryPosFromCigar(cigarOps): | 125 def calcQueryPosFromCigar(cigarOps): |
128 qsPos = 0 | 126 qsPos = 0 |
129 qePos = 0 | 127 qePos = 0 |
200 parser.add_option("-d", "--includeDups", dest="includeDups", | 198 parser.add_option("-d", "--includeDups", dest="includeDups", |
201 action="store_true", default=0, | 199 action="store_true", default=0, |
202 help='''Include alignments marked as duplicates. | 200 help='''Include alignments marked as duplicates. |
203 Default=False''') | 201 Default=False''') |
204 parser.add_option("-m", "--minNonOverlap", dest="minNonOverlap", | 202 parser.add_option("-m", "--minNonOverlap", dest="minNonOverlap", |
205 default=20, type="int", help='''minimum non-overlap between | 203 default=20, type="int", |
204 help='''minimum non-overlap between | |
206 split alignments on the query (default=20)''', | 205 split alignments on the query (default=20)''', |
207 metavar="INT") | 206 metavar="INT") |
208 (opts, args) = parser.parse_args() | 207 (opts, args) = parser.parse_args() |
209 if opts.inFile is None: | 208 if opts.inFile is None: |
210 parser.print_help() | 209 parser.print_help() |