Ejemplo n.º 1
0
def main(argv):
    parser = OptionParser()
    (opt, args) = parser.parse_args(argv)

    A = [(1, 2.5), (3.5, 15), (45, 71), (74, 93)]
    B = [(1.2, 2.5), (2, 7), (2, 2), (57, 84)]
    print A
    print B
    print Utility_extended.intersect(A, B, 0.0001)
Ejemplo n.º 2
0
def getSharedExonicRegions(transcripts, min_width=5):
    """
	shared_exons: a list of (start,end), which are shared among all transcripts in input, might breaking up existing exons.
	sorted
	"""

    shared_exons = transcripts[0].getExons()
    for index in range(1, len(transcripts)):
        current_exons = transcripts[index].getExons()
        shared_exons = Utility_extended.intersect(shared_exons, current_exons,
                                                  min_width)
    return shared_exons  #sorted
Ejemplo n.º 3
0
def getSharedIntronicRegions(transcripts, min_width=5):
    """
	shared_introns: a list of (start,end), which are shared among all transcripts in input, might breaking up existing introns.
	sorted
	"""

    shared_introns = transcripts[0].getIntrons()
    for index in range(1, len(transcripts)):
        current_introns = transcripts[index].getIntrons()
        #if len(current_introns) == 0 and len(shared_introns) == 0:
        #for transcript in transcripts:
        #print transcript.getAll()
        shared_introns = Utility_extended.intersect(shared_introns,
                                                    current_introns, min_width)
    return shared_introns  #sorted