oktoberfest.pp.filter_peptides
- oktoberfest.pp.filter_peptides(peptides, min_length, max_length, max_charge)
Filter search results using given constraints.
This function filters provided search results by peptide length, precursor charge, unsupported special aminoacids, and unsupported modifications.
- Parameters:
- Return type:
- Returns:
The filtered dataframe or AnnData object given the provided constraints.
- Example:
>>> from oktoberfest import preprocessing as pp >>> import pandas as pd >>> search_results = pd.DataFrame({"MODIFIED_SEQUENCE": ["AAAC[UNIMOD:4]RFVQ","RM[UNIMOD:35]PC[UNIMOD:4]HKPYL","TAIASPEK"], >>> "SEQUENCE": ["AAACRFVQ","RMPCHKPYL","TAIASPEK"], >>> "PEPTIDE_LENGTH": [8,9,8], >>> "PRECURSOR_CHARGE": [1,2,7]}) >>> filtered_peptides = pp.filter_peptides(peptides=search_results, min_length=7, max_length=30, max_charge=6) >>> print(filtered_peptides)