scripts/processing/clan_competition.py
def calc_seq_overlap(s1, e1, s2, e2):
    """
    Calculate sequence overlaps

    s1: SEQ1 start coordinate
    e1: SEQ1 end coordinate
    s2: SEQ2 start coordinate
    e2: SEQ2 end coordinate
    """

    len1 = abs(e1 - s1)
    len2 = abs(e2 - s2)

    overlap = None

    # get strand
    strand = get_strand(s1, e1)

    # full overlap
    if s1 == s2 and len1 == len2:
        return float(len1) / float(len2)

    # check5'
    elif strand == 1:
        overlap = cal_overlap_pos_strand(s1, e1, s2, e2)

    # check 3'
    elif strand == -1:
        overlap = cal_overlap_neg_strand(s1, e1, s2, e2)

    # will return None in a case that we didn't capture
    return overlap

    Calculate sequence overlaps

    s1: SEQ1 start coordinate
    e1: SEQ1 end coordinate
    s2: SEQ2 start coordinate
    e2: SEQ2 end coordinate
    
Calculate sequence overlaps
s1: SEQ1 start coordinate
e1: SEQ1 end coordinate
s2: SEQ2 start coordinate
e2: SEQ2 end coordinate
Calculate sequence overlaps s1 : SEQ1 start coordinate e1 : SEQ1 end coordinate s2 : SEQ2 start coordinate e2 : SEQ2 end coordinate
def calc_seq_overlap(s1, e1, s2, e2):
    len1 = abs(e1 - s1)
    len2 = abs(e2 - s2)
    overlap = None
    strand = get_strand(s1, e1)
    if s1 == s2 and len1 == len2:
        return float(len1) / float(len2)
    elif strand == 1:
        overlap = cal_overlap_pos_strand(s1, e1, s2, e2)
    elif strand == -1:
        overlap = cal_overlap_neg_strand(s1, e1, s2, e2)
    return overlap
def calc_seq_overlap ( s1 , e1 , s2 , e2 ) : len1 = abs ( e1 - s1 ) len2 = abs ( e2 - s2 ) overlap = None strand = get_strand ( s1 , e1 ) if s1 == s2 and len1 == len2 : return float ( len1 ) / float ( len2 ) elif strand == 1 : overlap = cal_overlap_pos_strand ( s1 , e1 , s2 , e2 ) elif strand == - 1 : overlap = cal_overlap_neg_strand ( s1 , e1 , s2 , e2 ) return overlap
Calculate sequence overlaps
s1: SEQ1 start coordinate
e1: SEQ1 end coordinate
s2: SEQ2 start coordinate
e2: SEQ2 end coordinate
Calculate sequence overlaps s1 : SEQ1 start coordinate e1 : SEQ1 end coordinate s2 : SEQ2 start coordinate e2 : SEQ2 end coordinate
"""
    Calculate sequence overlaps

    s1: SEQ1 start coordinate
    e1: SEQ1 end coordinate
    s2: SEQ2 start coordinate
    e2: SEQ2 end coordinate
    """ # get strand # full overlap # check5' # check 3' # will return None in a case that we didn't capture
s1
e1
s2
e2