jinfo/utils/percentage_identity.py
def percentage_identity(seq1: ALL_SEQS, seq2: ALL_SEQS, dp: int = 2) -> float:
    """
    Calculate pairwise sequence similarity from aligned sequences

    Optionally control precision using dp argument
    Returns: float
    """
    i = 0
    for b1, b2 in zip(seq1.seq, seq2.seq):
        if b1 == b2:
            i += 1
    pid = i * 100 / ((seq1.len + seq2.len) / 2)
    return round(pid, dp)

    Calculate pairwise sequence similarity from aligned sequences

    Optionally control precision using dp argument
    Returns: float
    
Calculate pairwise sequence similarity from aligned sequences
Optionally control precision using dp argument
Returns: float
Calculate pairwise sequence similarity from aligned sequences Optionally control precision using dp argument Returns : float
def percentage_identity(seq1: ALL_SEQS, seq2: ALL_SEQS, dp: int = 2) -> float:
    i = 0
    for b1, b2 in zip(seq1.seq, seq2.seq):
        if b1 == b2:
            i += 1
    pid = i * 100 / ((seq1.len + seq2.len) / 2)
    return round(pid, dp)
def percentage_identity ( seq1 : ALL_SEQS , seq2 : ALL_SEQS , dp : int = 2 ) -> float : i = 0 for b1 , b2 in zip ( seq1 . seq , seq2 . seq ) : if b1 == b2 : i += 1 pid = i * 100 / ( ( seq1 . len + seq2 . len ) / 2 ) return round ( pid , dp )
Calculate pairwise sequence similarity from aligned sequences
Optionally control precision using dp argument
Returns: float
Calculate pairwise sequence similarity from aligned sequences Optionally control precision using dp argument Returns : float
"""
    Calculate pairwise sequence similarity from aligned sequences

    Optionally control precision using dp argument
    Returns: float
    """
seq1
ALL_SEQS
seq2
ALL_SEQS
dp
int