comparison SMART/Java/Python/structure/Transcript.py @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents 769e306b7933
children
comparison
equal deleted inserted replaced
17:b0e8584489e6 18:94ab73e8a190
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
350 375
351 def getSqlVariables(cls): 376 def getSqlVariables(cls):
352 """ 377 """
353 Get the properties of the object that should be saved in a database 378 Get the properties of the object that should be saved in a database
354 """ 379 """