annotate commons/core/parsing/SamParser.py @ 14:c79b9ae3f65f

Deleted selected files
author m-zytnicki
date Fri, 19 Apr 2013 10:13:11 -0400
parents 769e306b7933
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
1 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
2 # Copyright INRA-URGI 2009-2010
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
3 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
4 # This software is governed by the CeCILL license under French law and
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
5 # abiding by the rules of distribution of free software. You can use,
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
6 # modify and/ or redistribute the software under the terms of the CeCILL
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
7 # license as circulated by CEA, CNRS and INRIA at the following URL
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
8 # "http://www.cecill.info".
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
9 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
10 # As a counterpart to the access to the source code and rights to copy,
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
11 # modify and redistribute granted by the license, users are provided only
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
12 # with a limited warranty and the software's author, the holder of the
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
13 # economic rights, and the successive licensors have only limited
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
14 # liability.
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
15 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
16 # In this respect, the user's attention is drawn to the risks associated
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
17 # with loading, using, modifying and/or developing or reproducing the
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
18 # software by the user in light of its specific status of free software,
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
19 # that may mean that it is complicated to manipulate, and that also
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
20 # therefore means that it is reserved for developers and experienced
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
21 # professionals having in-depth computer knowledge. Users are therefore
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
22 # encouraged to load and test the software's suitability as regards their
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
23 # requirements in conditions enabling the security of their systems and/or
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
24 # data to be ensured and, more generally, to use and operate it in the
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
25 # same conditions as regards security.
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
26 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
27 # The fact that you are presently reading this means that you have had
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
28 # knowledge of the CeCILL license and that you accept its terms.
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
29 #
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
30 import re
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
31 import sys
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
32 from commons.core.parsing.MapperParser import MapperParser
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
33 from SMART.Java.Python.structure.Mapping import Mapping
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
34 from SMART.Java.Python.structure.SubMapping import SubMapping
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
35 from SMART.Java.Python.structure.Interval import Interval
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
36
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
37 class SamParser(MapperParser):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
38 """A class that parses SAM format (as given by BWA)"""
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
39
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
40 def __init__(self, fileName, verbosity = 0):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
41 super(SamParser, self).__init__(fileName, verbosity)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
42
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
43
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
44 def __del__(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
45 super(SamParser, self).__del__()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
46
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
47
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
48 def getFileFormats():
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
49 return ["sam"]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
50 getFileFormats = staticmethod(getFileFormats)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
51
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
52
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
53 def skipFirstLines(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
54 pass
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
55
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
56
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
57 def getInfos(self):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
58 self.chromosomes = set()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
59 self.nbMappings = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
60 self.size = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
61 self.reset()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
62 if self.verbosity >= 10:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
63 print "Getting information on SAM file"
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
64 self.reset()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
65 for line in self.handle:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
66 line = line.strip()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
67 if line == "" or line[0] == "@":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
68 continue
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
69 parts = line.split("\t")
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
70 chromosome = parts[2]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
71 if chromosome != "*":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
72 self.chromosomes.add(chromosome)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
73 self.nbMappings += 1
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
74 self.size += len(parts[8])
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
75 if self.verbosity >= 10 and self.nbMappings % 100000 == 0:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
76 sys.stdout.write(" %d mappings read\r" % (self.nbMappings))
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
77 sys.stdout.flush()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
78 self.reset()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
79 if self.verbosity >= 10:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
80 print " %d mappings read" % (self.nbMappings)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
81 print "Done."
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
82
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
83
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
84 def parseLine(self, line):
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
85
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
86 line = line.strip()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
87 if line[0] == "@":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
88 return
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
89
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
90 fields = line.split("\t")
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
91 if len(fields) < 11:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
92 raise Exception("Line %d '%s' does not look like a SAM line (number of fields is %d instead of 11)" % (self.currentLineNb, line, len(fields)))
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
93
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
94 name = fields[0]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
95 flag = int(fields[1])
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
96
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
97 if (flag & 0x4) == 0x4:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
98 return None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
99
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
100 direction = 1 if (flag & 0x10) == 0x0 else -1
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
101 chromosome = fields[2]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
102 genomeStart = int(fields[3])
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
103 quality = fields[4]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
104 cigar = fields[5]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
105 mate = fields[6]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
106 mateGenomeStart = fields[7]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
107 gapSize = fields[8]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
108 sequence = fields[9]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
109 quality = fields[10]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
110 tags = fields[11:]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
111
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
112 if mateGenomeStart != "*":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
113 mateGenomeStart = int(mateGenomeStart)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
114
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
115 mapping = Mapping()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
116 nbOccurrences = 1
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
117 nbMismatches = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
118 nbMatches = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
119 nbGaps = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
120 subMapping = None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
121 queryOffset = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
122 targetOffset = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
123 currentNumber = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
124 readStart = None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
125
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
126 for tag in tags:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
127 key = tag[:2]
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
128 if key == "X0":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
129 nbOccurrences = int(tag[5:])
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
130 elif key == "X1":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
131 nbOccurrences += int(tag[5:])
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
132 elif key == "XM":
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
133 nbMismatches = int(tag[5:])
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
134 mapping.setTagValue("nbOccurrences", nbOccurrences)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
135 mapping.setTagValue("quality", int(fields[4]))
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
136
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
137 for char in cigar:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
138 m = re.match(r"[0-9]", char)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
139 if m != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
140 currentNumber = currentNumber * 10 + (ord(char) - ord("0"))
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
141 continue
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
142 # match
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
143 m = re.match(r"[M]", char)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
144 if m != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
145 if readStart == None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
146 readStart = queryOffset
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
147 if subMapping == None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
148 subMapping = SubMapping()
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
149 subMapping.setSize(currentNumber)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
150 subMapping.setDirection(direction)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
151 subMapping.queryInterval.setName(name)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
152 subMapping.queryInterval.setStart(queryOffset)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
153 subMapping.queryInterval.setDirection(direction)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
154 subMapping.targetInterval.setChromosome(chromosome)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
155 subMapping.targetInterval.setStart(genomeStart + targetOffset)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
156 subMapping.targetInterval.setDirection(1)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
157 nbMatches += currentNumber
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
158 targetOffset += currentNumber
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
159 queryOffset += currentNumber
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
160 currentNumber = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
161 continue
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
162 # insertion on the read
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
163 m = re.match(r"[I]", char)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
164 if m != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
165 nbGaps += 1
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
166 queryOffset += currentNumber
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
167 currentNumber = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
168 continue
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
169 # insertion on the genome
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
170 m = re.match(r"[D]", char)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
171 if m != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
172 if subMapping != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
173 subMapping.queryInterval.setEnd(queryOffset - 1)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
174 subMapping.targetInterval.setEnd(genomeStart + targetOffset - 1)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
175 mapping.addSubMapping(subMapping)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
176 subMapping = None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
177 nbGaps += 1
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
178 targetOffset += currentNumber
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
179 currentNumber = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
180 continue
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
181 # intron
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
182 m = re.match(r"[N]", char)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
183 if m != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
184 if subMapping != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
185 subMapping.queryInterval.setEnd(queryOffset - 1)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
186 subMapping.targetInterval.setEnd(genomeStart + targetOffset - 1)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
187 mapping.addSubMapping(subMapping)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
188 subMapping = None
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
189 targetOffset += currentNumber
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
190 currentNumber = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
191 continue
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
192 # soft clipping (substitution)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
193 m = re.match(r"[S]", char)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
194 if m != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
195 nbMismatches += currentNumber
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
196 targetOffset += currentNumber
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
197 queryOffset += currentNumber
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
198 currentNumber = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
199 continue
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
200 # hard clipping
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
201 m = re.match(r"[H]", char)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
202 if m != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
203 targetOffset += currentNumber
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
204 queryOffset += currentNumber
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
205 currentNumber = 0
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
206 continue
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
207 # padding
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
208 m = re.match(r"[P]", char)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
209 if m != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
210 continue
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
211 raise Exception("Do not understand paramer '%s' in line %s" % (char, line))
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
212
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
213 if subMapping != None:
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
214 subMapping.queryInterval.setEnd(queryOffset - 1)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
215 subMapping.targetInterval.setEnd(genomeStart + targetOffset - 1)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
216 mapping.addSubMapping(subMapping)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
217
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
218 mapping.queryInterval.setStart(readStart)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
219 mapping.queryInterval.setEnd(queryOffset - 1)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
220 mapping.targetInterval.setEnd(genomeStart + targetOffset - 1)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
221 mapping.setNbMismatches(nbMismatches)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
222 mapping.setNbGaps(nbGaps)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
223
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
224 mapping.queryInterval.setName(name)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
225 mapping.queryInterval.setDirection(direction)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
226 mapping.targetInterval.setChromosome(chromosome)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
227 mapping.targetInterval.setStart(genomeStart)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
228 mapping.targetInterval.setDirection(direction)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
229 mapping.setSize(len(sequence))
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
230 mapping.setDirection(direction)
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
231
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
232 return mapping
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
233
769e306b7933 Change the repository level.
yufei-luo
parents:
diff changeset
234