def calc_eval_metrics(aa_match_binary_list, orig_total_num_aa, pred_total_num_aa):
    """
    Calculate evaluation metrics using amino acid matches
    
    Parameters
    ----------
    aa_match_binary_list : list of lists
        List of amino acid matches in each predicted peptide
    orig_total_num_aa : int
        Number of amino acids in the original peptide sequences
    pred_total_num_aa : int
        Number of amino acids in the predicted peptide sequences
    Returns
    -------
    aa_precision: float
        Number of correct aa predictions divided by all predicted aa
    aa_recall: float
        Number of correct aa predictions divided by all original aa        
    pep_recall: float
        Number of correct peptide predictions divided by all original peptide    
    """ 
    
    correct_aa_count = sum([sum(pred_tuple[0]) for pred_tuple in aa_match_binary_list])
    aa_recall = correct_aa_count/(orig_total_num_aa+1e-8)
    aa_precision = correct_aa_count/(pred_total_num_aa+1e-8)
    pep_recall = sum([pred_tuple[1] for pred_tuple in aa_match_binary_list])/(len(aa_match_binary_list)+1e-8)
    
    return aa_precision, aa_recall, pep_recall