def it_adds_permutation_labels(): new_pep_seqs = _do_ptm_permutations(df, n_ptms_limit) assert len(new_pep_seqs) == 3 # remember the pro_ptm_locs string is 1-based assert new_pep_seqs[0].aa.tolist() == ["A[p]", "B", "C", "D", "E", "F"] assert new_pep_seqs[1].aa.tolist() == ["A", "B", "C", "D[p]", "E", "F"] assert new_pep_seqs[2].aa.tolist() == [ "A[p]", "B", "C", "D[p]", "E", "F" ] assert np.all(np.isnan(new_pep_seqs[0].pep_i.values))
def it_handles_too_many_permutations(): # we allow 5 per peptide at present df_too_many = df.copy() df_too_many.pro_ptm_locs = "1;2;3;4;5;6" new_pep_seqs = _do_ptm_permutations(df_too_many, n_ptms_limit) assert len(new_pep_seqs) == 0
def it_handles_empty_ptm_locations(): df_empty = df.copy() df_empty.pro_ptm_locs = "" new_pep_seqs = _do_ptm_permutations(df_empty, n_ptms_limit) assert len(new_pep_seqs) == 0