splicing_analyses/extract_SJs_from_sam.py
def create_sj_tuples(chrom, strand, intron_coords, genome):
    """ Walk through intron coord pairs to assemble SJ tuples for each:
            (chr, start, end, strand, splice_motif)
        Since we want the smallest coordinate first in each case, we do not 
        need to orient based on strand."""

    sj_tuples = []

    start_index = 0
    while start_index < len(intron_coords) -1 :
        end_index = start_index + 1

        start_pos = intron_coords[start_index]
        end_pos = intron_coords[end_index]

        motif = fetch_splice_motif_code(chrom, start_pos, end_pos, strand, genome)

        # Assemble the tuple
        sj = (chrom, start_pos, end_pos, strand, motif)
        sj_tuples.append(sj)

        start_index += 2

    return sj_tuples
 Walk through intron coord pairs to assemble SJ tuples for each:
            (chr, start, end, strand, splice_motif)
        Since we want the smallest coordinate first in each case, we do not 
        need to orient based on strand.
Walk through intron coord pairs to assemble SJ tuples for each:
(chr, start, end, strand, splice_motif)
Since we want the smallest coordinate first in each case, we do not
need to orient based on strand.
Walk through intron coord pairs to assemble SJ tuples for each : ( chr start end strand splice_motif ) Since we want the smallest coordinate first in each case we do not need to orient based on strand .
def create_sj_tuples(chrom, strand, intron_coords, genome):
    sj_tuples = []
    start_index = 0
    while start_index < len(intron_coords) -1 :
        end_index = start_index + 1
        start_pos = intron_coords[start_index]
        end_pos = intron_coords[end_index]
        motif = fetch_splice_motif_code(chrom, start_pos, end_pos, strand, genome)
        sj = (chrom, start_pos, end_pos, strand, motif)
        sj_tuples.append(sj)
        start_index += 2
    return sj_tuples
def create_sj_tuples ( chrom , strand , intron_coords , genome ) : sj_tuples = [ ] start_index = 0 while start_index < len ( intron_coords ) - 1 : end_index = start_index + 1 start_pos = intron_coords [ start_index ] end_pos = intron_coords [ end_index ] motif = fetch_splice_motif_code ( chrom , start_pos , end_pos , strand , genome ) sj = ( chrom , start_pos , end_pos , strand , motif ) sj_tuples . append ( sj ) start_index += 2 return sj_tuples
Walk through intron coord pairs to assemble SJ tuples for each:
(chr, start, end, strand, splice_motif)
Since we want the smallest coordinate first in each case, we do not
need to orient based on strand.
Walk through intron coord pairs to assemble SJ tuples for each : ( chr start end strand splice_motif ) Since we want the smallest coordinate first in each case we do not need to orient based on strand .
""" Walk through intron coord pairs to assemble SJ tuples for each:
            (chr, start, end, strand, splice_motif)
        Since we want the smallest coordinate first in each case, we do not 
        need to orient based on strand.""" # Assemble the tuple
chrom
strand
intron_coords
genome