comparison SMART/Java/Python/structure/Transcript.py @ 46:169d364ddd91

Uploaded
author m-zytnicki
date Mon, 30 Sep 2013 03:19:26 -0400
parents 44d5973c188c
children
comparison
equal deleted inserted replaced
45:e454402ba9d9 46:169d364ddd91
345 newTranscript.setEnd(newEnd) 345 newTranscript.setEnd(newEnd)
346 newTranscript.setStart(newStart) 346 newTranscript.setStart(newStart)
347 newTranscript.exons = theseExons 347 newTranscript.exons = theseExons
348 return newTranscript 348 return newTranscript
349 349
350
351 def getIntersection(self, transcript):
352 """
353 Get the intersection between this transcript and another one
354 @param transcript: object to be compared to
355 @type transcript: class L{Transcript<Transcript>}
356 @return: an other transcript
357 """
358 if self.getChromosome() != transcript.getChromosome() or self.getDirection() != transcript.getDirection():
359 return None
360 newTranscript = Transcript()
361 newTranscript.setDirection(self.getDirection())
362 newTranscript.setChromosome(self.getChromosome())
363 newTranscript.setName("%s_intersect_%s" % (self.getName(), transcript.getName()))
364 newExons = []
365 for thisExon in self.getExons():
366 for thatExon in transcript.getExons():
367 newExon = thisExon.getIntersection(thatExon)
368 if newExon != None:
369 newExons.append(newExon)
370 if not newExons:
371 return None
372 newTranscript.exons = newExons
373 return newTranscript
374
375 350
376 def getSqlVariables(cls): 351 def getSqlVariables(cls):
377 """ 352 """
378 Get the properties of the object that should be saved in a database 353 Get the properties of the object that should be saved in a database
379 """ 354 """