annotate extractSplitReads_BwaMem.py @ 0:796552c157de draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
author artbio
date Mon, 24 Jul 2017 08:03:17 -0400
parents
children 1ed8619a5611
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
1 #!/usr/bin/env python
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
2
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
3 import sys
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
4 import getopt
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
5 import string
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
6 from optparse import OptionParser
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
7 import re
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
8
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
9 def extractSplitsFromBwaMem(inFile,numSplits,includeDups,minNonOverlap):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
10 if inFile == "stdin":
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
11 data = sys.stdin
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
12 else:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
13 data = open(inFile, 'r')
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
14 for line in data:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
15 split = 0
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
16 if line[0] == '@':
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
17 print line.strip()
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
18 continue
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
19 samList = line.strip().split('\t')
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
20 sam = SAM(samList)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
21 if includeDups==0 and (1024 & sam.flag)==1024:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
22 continue
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
23 for el in sam.tags:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
24 if "SA:" in el:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
25 if(len(el.split(";")))<=numSplits:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
26 split = 1
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
27 mate = el.split(",")
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
28 mateCigar = mate[3]
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
29 mateFlag = int(0)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
30 if mate[2]=="-": mateFlag = int(16)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
31 if split:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
32 read1 = sam.flag & 64
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
33 if read1 == 64: tag = "_1"
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
34 else: tag="_2"
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
35 samList[0] = sam.query + tag
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
36 readCigar = sam.cigar
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
37 readCigarOps = extractCigarOps(readCigar,sam.flag)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
38 readQueryPos = calcQueryPosFromCigar(readCigarOps)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
39 mateCigarOps = extractCigarOps(mateCigar,mateFlag)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
40 mateQueryPos = calcQueryPosFromCigar(mateCigarOps)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
41 overlap = calcQueryOverlap(readQueryPos.qsPos,readQueryPos.qePos,mateQueryPos.qsPos,mateQueryPos.qePos)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
42 nonOverlap1 = 1 + readQueryPos.qePos - readQueryPos.qsPos - overlap
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
43 nonOverlap2 = 1 + mateQueryPos.qePos - mateQueryPos.qsPos - overlap
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
44 mno = min(nonOverlap1, nonOverlap2)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
45 if mno >= minNonOverlap:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
46 print "\t".join(samList)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
47
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
48 #--------------------------------------------------------------------------------------------------
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
49 # functions
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
50 #--------------------------------------------------------------------------------------------------
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
51
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
52 class SAM (object):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
53 """
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
54 __very__ basic class for SAM input.
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
55 """
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
56 def __init__(self, samList = []):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
57 if len(samList) > 0:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
58 self.query = samList[0]
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
59 self.flag = int(samList[1])
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
60 self.ref = samList[2]
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
61 self.pos = int(samList[3])
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
62 self.mapq = int(samList[4])
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
63 self.cigar = samList[5]
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
64 self.matRef = samList[6]
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
65 self.matePos = int(samList[7])
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
66 self.iSize = int(samList[8])
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
67 self.seq = samList[9]
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
68 self.qual = samList[10]
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
69 self.tags = samList[11:]#tags is a list of each tag:vtype:value sets
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
70 self.valid = 1
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
71 else:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
72 self.valid = 0
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
73 self.query = 'null'
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
74
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
75 def extractTagValue (self, tagID):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
76 for tag in self.tags:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
77 tagParts = tag.split(':', 2);
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
78 if (tagParts[0] == tagID):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
79 if (tagParts[1] == 'i'):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
80 return int(tagParts[2]);
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
81 elif (tagParts[1] == 'H'):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
82 return int(tagParts[2],16);
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
83 return tagParts[2];
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
84 return None;
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
85
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
86 #-----------------------------------------------
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
87 cigarPattern = '([0-9]+[MIDNSHP])'
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
88 cigarSearch = re.compile(cigarPattern)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
89 atomicCigarPattern = '([0-9]+)([MIDNSHP])'
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
90 atomicCigarSearch = re.compile(atomicCigarPattern)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
91
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
92 def extractCigarOps(cigar,flag):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
93 if (cigar == "*"):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
94 cigarOps = []
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
95 elif (flag & 0x0010):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
96 cigarOpStrings = cigarSearch.findall(cigar)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
97 cigarOps = []
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
98 for opString in cigarOpStrings:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
99 cigarOpList = atomicCigarSearch.findall(opString)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
100 # print cigarOpList
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
101 # "struct" for the op and it's length
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
102 cigar = cigarOp(cigarOpList[0][0], cigarOpList[0][1])
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
103 # add to the list of cigarOps
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
104 cigarOps.append(cigar)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
105 cigarOps = cigarOps
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
106 cigarOps.reverse()
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
107 ##do in reverse order because negative strand##
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
108 else:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
109 cigarOpStrings = cigarSearch.findall(cigar)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
110 cigarOps = []
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
111 for opString in cigarOpStrings:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
112 cigarOpList = atomicCigarSearch.findall(opString)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
113 # "struct" for the op and it's length
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
114 cigar = cigarOp(cigarOpList[0][0], cigarOpList[0][1])
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
115 # add to the list of cigarOps
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
116 cigarOps.append(cigar)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
117 # cigarOps = cigarOps
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
118 return(cigarOps)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
119
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
120 def calcQueryPosFromCigar(cigarOps):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
121 qsPos = 0
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
122 qePos = 0
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
123 qLen = 0
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
124 # if first op is a H, need to shift start position
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
125 # the opPosition counter sees if the for loop is looking at the first index of the cigar object
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
126 opPosition = 0
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
127 for cigar in cigarOps:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
128 if opPosition == 0 and (cigar.op == 'H' or cigar.op == 'S'):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
129 qsPos += cigar.length
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
130 qePos += cigar.length
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
131 qLen += cigar.length
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
132 elif opPosition > 0 and (cigar.op == 'H' or cigar.op == 'S'):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
133 qLen += cigar.length
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
134 elif cigar.op == 'M' or cigar.op == 'I':
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
135 qePos += cigar.length
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
136 qLen += cigar.length
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
137 opPosition += 1
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
138 d = queryPos(qsPos, qePos, qLen);
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
139 return d
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
140
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
141 class cigarOp (object):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
142 """
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
143 sturct to store a discrete CIGAR operations
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
144 """
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
145 def __init__(self, opLength, op):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
146 self.length = int(opLength)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
147 self.op = op
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
148
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
149 class queryPos (object):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
150 """
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
151 struct to store the start and end positions of query CIGAR operations
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
152 """
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
153 def __init__(self, qsPos, qePos, qLen):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
154 self.qsPos = int(qsPos)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
155 self.qePos = int(qePos)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
156 self.qLen = int(qLen)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
157
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
158
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
159 def calcQueryOverlap(s1,e1,s2,e2):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
160 o = 1 + min(e1, e2) - max(s1, s2)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
161 return max(0, o)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
162
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
163 ###############################################
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
164
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
165 class Usage(Exception):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
166 def __init__(self, msg):
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
167 self.msg = msg
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
168
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
169 def main():
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
170
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
171 usage = """%prog -i <file>
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
172
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
173 extractSplitReads_BwaMem v0.1.0
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
174 Author: Ira Hall
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
175 Description: Get split-read alignments from bwa-mem in lumpy compatible format. Ignores reads marked as duplicates.
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
176 Works on read or position sorted SAM input. Tested on bwa mem v0.7.5a-r405.
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
177 """
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
178 parser = OptionParser(usage)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
179
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
180 parser.add_option("-i", "--inFile", dest="inFile",
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
181 help="A SAM file or standard input (-i stdin).",
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
182 metavar="FILE")
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
183 parser.add_option("-n", "--numSplits", dest="numSplits", default=2, type = "int",
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
184 help="The maximum number of split-read mappings to allow per read. Reads with more are excluded. Default=2",
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
185 metavar="INT")
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
186 parser.add_option("-d", "--includeDups", dest="includeDups", action="store_true",default=0,
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
187 help="Include alignments marked as duplicates. Default=False")
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
188 parser.add_option("-m", "--minNonOverlap", dest="minNonOverlap", default=20, type = "int",
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
189 help="minimum non-overlap between split alignments on the query (default=20)",
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
190 metavar="INT")
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
191 (opts, args) = parser.parse_args()
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
192 if opts.inFile is None:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
193 parser.print_help()
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
194 print
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
195 else:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
196 try:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
197 extractSplitsFromBwaMem(opts.inFile, opts.numSplits, opts.includeDups, opts.minNonOverlap)
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
198 except IOError as err:
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
199 sys.stderr.write("IOError " + str(err) + "\n");
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
200 return
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
201 if __name__ == "__main__":
796552c157de planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy-sv commit d06124e8a097f3f665b4955281f40fe811eaee64
artbio
parents:
diff changeset
202 sys.exit(main())