https://github.com/benpullman/peptide_statistics_hpp/blob/501cfff6aaefb93b0de9aa13d06e2aae284cb469/tools/peptide_statistics_hpp/peptide_protein_cosine.py#L450