def get_overlapping_genes(bamfh, read, gene_trees): intervals = get_genomic_intervals(read) # get read strand if it exists strand = get_strand(read) # get all genes compatible with intervals hits = [] for interval in intervals: hits.append(get_genes_at_interval(bamfh.getrname(read.rname), start=interval[0], end=interval[1], strand=strand, trees=gene_trees)) return hits
def get_transcript_coords(bamfh, read, exon_intervals, exon_trees): intervals = get_genomic_intervals(read) # get read strand if it exists strand = get_strand(read) # get all transcripts compatible with first interval txhits = [] for interval in intervals: #print 'READ', read.is_read1, 'INTERVAL', interval txhits.append(get_transcripts_at_interval(bamfh.getrname(read.rname), start=interval[0], end=interval[1], strand=strand, exon_intervals=exon_intervals, exon_trees=exon_trees)) return txhits