annotate SMART/Java/Python/clusterize.py @ 60:90f4b29d884f

Uploaded
author m-zytnicki
date Fri, 21 Feb 2014 08:32:36 -0500
parents 169d364ddd91
children f4de72c80eac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
1 #! /usr/bin/env python
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
2 #
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
3 # Copyright INRA-URGI 2009-2010
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
4 #
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
5 # This software is governed by the CeCILL license under French law and
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
6 # abiding by the rules of distribution of free software. You can use,
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
7 # modify and/ or redistribute the software under the terms of the CeCILL
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
8 # license as circulated by CEA, CNRS and INRIA at the following URL
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
9 # "http://www.cecill.info".
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
10 #
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
11 # As a counterpart to the access to the source code and rights to copy,
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
12 # modify and redistribute granted by the license, users are provided only
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
13 # with a limited warranty and the software's author, the holder of the
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
14 # economic rights, and the successive licensors have only limited
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
15 # liability.
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
16 #
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
17 # In this respect, the user's attention is drawn to the risks associated
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
18 # with loading, using, modifying and/or developing or reproducing the
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
19 # software by the user in light of its specific status of free software,
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
20 # that may mean that it is complicated to manipulate, and that also
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
21 # therefore means that it is reserved for developers and experienced
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
22 # professionals having in-depth computer knowledge. Users are therefore
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
23 # encouraged to load and test the software's suitability as regards their
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
24 # requirements in conditions enabling the security of their systems and/or
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
25 # data to be ensured and, more generally, to use and operate it in the
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
26 # same conditions as regards security.
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
27 #
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
28 # The fact that you are presently reading this means that you have had
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
29 # knowledge of the CeCILL license and that you accept its terms.
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
30 #
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
31 from commons.core.writer.WriterChooser import WriterChooser
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
32 """Clusterize a set of transcripts"""
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
33
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
34 import os, os.path, random
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
35 from optparse import OptionParser
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
36 from heapq import heappush, heappop
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
37 from commons.core.parsing.ParserChooser import ParserChooser
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
38 from commons.core.writer.Gff3Writer import Gff3Writer
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
39 from SMART.Java.Python.structure.Transcript import Transcript
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
40 from SMART.Java.Python.ncList.NCListFilePickle import NCListFileUnpickle
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
41 from SMART.Java.Python.ncList.FileSorter import FileSorter
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
42 from SMART.Java.Python.misc.Progress import Progress
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
43 from SMART.Java.Python.misc.UnlimitedProgress import UnlimitedProgress
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
44
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
45 class Clusterize(object):
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
46
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
47 def __init__(self, verbosity):
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
48 self.parsers = {}
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
49 self.sortedFileNames = {}
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
50 self.normalize = False
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
51 self.presorted = False
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
52 self.distance = 1
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
53 self.collinear = False
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
54 self.nbWritten = 0
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
55 self.nbMerges = 0
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
56 self.verbosity = verbosity
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
57 self.splittedFileNames = {}
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
58 self.chromosomes = set()
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
59
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
60 def __del__(self):
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
61 for fileName1 in self.splittedFileNames:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
62 for fileName2 in self.splittedFileNames[fileName1].values():
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
63 os.remove(fileName2)
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
64
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
65 def setInputFiles(self, fileNames, format):
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
66 parserChooser = ParserChooser(self.verbosity)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
67 parserChooser.findFormat(format)
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
68 for fileName in fileNames:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
69 self.parsers[fileName] = parserChooser.getParser(fileName)
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
70 self.sortedFileNames[fileName] = "%s_sorted_%d.pkl" % (os.path.splitext(fileName)[0], random.randint(1, 100000))
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
71 if "SMARTTMPPATH" in os.environ:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
72 self.sortedFileNames[fileName] = os.path.join(os.environ["SMARTTMPPATH"], os.path.basename(self.sortedFileNames[fileName]))
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
73
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
74 def setOutputFileName(self, fileName, format="gff3", title="S-MART", feature="transcript", featurePart="exon"):
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
75 writerChooser = WriterChooser()
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
76 writerChooser.findFormat(format)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
77 self.writer = writerChooser.getWriter(fileName)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
78 self.writer.setTitle(title)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
79 self.writer.setFeature(feature)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
80 self.writer.setFeaturePart(featurePart)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
81
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
82 def setDistance(self, distance):
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
83 self.distance = distance
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
84
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
85 def setColinear(self, collinear):
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
86 self.collinear = collinear
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
87
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
88 def setNormalize(self, normalize):
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
89 self.normalize = normalize
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
90
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
91 def setPresorted(self, presorted):
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
92 self.presorted = presorted
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
93
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
94 def _sortFiles(self):
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
95 if self.presorted:
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
96 return
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
97 for fileName, parser in self.parsers.iteritems():
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
98 fs = FileSorter(parser, self.verbosity-4)
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
99 fs.perChromosome(True)
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
100 fs.setPresorted(self.presorted)
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
101 fs.setOutputFileName(self.sortedFileNames[fileName])
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
102 fs.sort()
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
103 self.splittedFileNames[fileName] = fs.getOutputFileNames()
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
104 self.nbElementsPerChromosome = fs.getNbElementsPerChromosome()
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
105 self.nbElements = fs.getNbElements()
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
106 self.chromosomes.update(self.splittedFileNames[fileName].keys())
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
107
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
108 def _iterate(self):
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
109 progress = UnlimitedProgress(10000, "Reading input file", self.verbosity)
46
169d364ddd91 Uploaded
m-zytnicki
parents: 36
diff changeset
110 transcripts = []
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
111 heap = []
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
112 parsersSets = []
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
113 if self.chromosomes:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
114 parsersSets.append(self.parsers.values())
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
115 else:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
116 for chromosome in self.chromosomes:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
117 parsersSets.append([self.splittedFileNames[fileName][chromosome] for fileName in self.splittedFileNames if chromosome in self.splittedFileNames[fileName]])
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
118 for parsers in parsersSets:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
119 for parser in parsers:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
120 iterator = parser.getIterator()
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
121 for transcript in iterator:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
122 if transcript.__class__.__name__ == "Mapping":
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
123 transcript = transcript.getTranscript()
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
124 heappush(heap, (transcript.getChromosome(), transcript.getStart(), -transcript.getEnd(), transcript, iterator))
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
125 break
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
126 while heap:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
127 chromosome, start, end, newTranscript, iterator = heappop(heap)
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
128 for transcript in iterator:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
129 if transcript.__class__.__name__ == "Mapping":
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
130 transcript = transcript.getTranscript()
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
131 heappush(heap, (transcript.getChromosome(), transcript.getStart(), -transcript.getEnd(), transcript, iterator))
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
132 break
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
133 newTranscripts = []
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
134 if newTranscript.__class__.__name__ == "Mapping":
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
135 newTranscript = newTranscript.getTranscript()
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
136 for oldTranscript in transcripts:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
137 if self._checkOverlap(newTranscript, oldTranscript):
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
138 self._merge(newTranscript, oldTranscript)
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
139 elif self._checkPassed(newTranscript, oldTranscript):
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
140 self._write(oldTranscript)
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
141 else:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
142 newTranscripts.append(oldTranscript)
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
143 newTranscripts.append(newTranscript)
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
144 transcripts = newTranscripts
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
145 progress.inc()
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
146 for transcript in transcripts:
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
147 self._write(transcript)
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
148 progress.done()
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
149
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
150 def _merge(self, transcript1, transcript2):
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
151 self.nbMerges += 1
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
152 transcript2.setDirection(transcript1.getDirection())
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
153 transcript1.merge(transcript2)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
154
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
155 def _write(self, transcript):
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
156 self.nbWritten += 1
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
157 self.writer.addTranscript(transcript)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
158
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
159 def _checkOverlap(self, transcript1, transcript2):
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
160 if transcript1.getChromosome() != transcript2.getChromosome():
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
161 return False
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
162 if self.collinear and transcript1.getDirection() != transcript2.getDirection():
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
163 return False
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
164 if transcript1.getDistance(transcript2) > self.distance:
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
165 return False
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
166 return True
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
167
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
168 def _checkPassed(self, transcript1, transcript2):
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
169 return ((transcript1.getChromosome() != transcript2.getChromosome()) or (transcript1.getDistance(transcript2) > self.distance))
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
170
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
171 def run(self):
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
172 self._sortFiles()
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
173 self._iterate()
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
174 self.writer.close()
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
175 if self.verbosity > 0:
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
176 print "# input: %d" % (self.nbElements)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
177 print "# written: %d (%d%% overlaps)" % (self.nbWritten, 0 if (self.nbElements == 0) else ((float(self.nbWritten) / self.nbElements) * 100))
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
178 print "# merges: %d" % (self.nbMerges)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
179
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
180
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
181 if __name__ == "__main__":
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
182 description = "Clusterize v1.0.3: clusterize the data which overlap. [Category: Merge]"
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
183
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
184 parser = OptionParser(description = description)
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
185 parser.add_option("-i", "--inputs", dest="inputFileNames", action="store", type="string", help="input files (separated by commas) [compulsory] [format: string]")
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
186 parser.add_option("-f", "--format", dest="format", action="store", type="string", help="format of file [format: transcript file format]")
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
187 parser.add_option("-o", "--output", dest="outputFileName", action="store", type="string", help="output file [compulsory] [format: output file in transcript format given by -u]")
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
188 parser.add_option("-u", "--outputFormat", dest="outputFormat", action="store", default="gff", type="string", help="output file format [format: transcript file format]")
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
189 parser.add_option("-c", "--collinear", dest="collinear", action="store_true", default=False, help="merge collinear transcripts only [format: bool] [default: false]")
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
190 parser.add_option("-d", "--distance", dest="distance", action="store", default=0, type="int", help="max. distance between two transcripts to be merged [format: int] [default: 0]")
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
191 parser.add_option("-n", "--normalize", dest="normalize", action="store_true", default=False, help="normalize the number of reads per cluster by the number of mappings per read [format: bool] [default: false]")
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
192 parser.add_option("-s", "--sorted", dest="sorted", action="store_true", default=False, help="input is already sorted [format: bool] [default: false]")
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
193 parser.add_option("-v", "--verbosity", dest="verbosity", action="store", default=1, type="int", help="trace level [format: int] [default: 1]")
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
194 (options, args) = parser.parse_args()
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
195
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
196 c = Clusterize(options.verbosity)
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
197 c.setInputFiles(options.inputFileNames.split(","), options.format)
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
198 c.setOutputFileName(options.outputFileName, options.outputFormat)
60
90f4b29d884f Uploaded
m-zytnicki
parents: 46
diff changeset
199 c.setColinear(options.collinear)
36
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
200 c.setDistance(options.distance)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
201 c.setNormalize(options.normalize)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
202 c.setPresorted(options.sorted)
44d5973c188c Uploaded
m-zytnicki
parents:
diff changeset
203 c.run()