-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e98c491
commit 89dae69
Showing
12 changed files
with
296 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
"""Initialize seach result.""" | ||
from .mascot import Mascot | ||
from .maxquant import MaxQuant | ||
from .msfragger import MSFragger | ||
from .process import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import logging | ||
import re | ||
|
||
import pandas as pd | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def filter_valid_prosit_sequences(df: pd.DataFrame) -> pd.DataFrame: | ||
""" | ||
Filter valid Prosit sequences. | ||
:param df: df to filter | ||
:return: df after filtering out unsupported peptides | ||
""" | ||
logger.info(f"#sequences before filtering for valid prosit sequences: {len(df.index)}") | ||
# retain only peptides that fall within [7, 30] length supported by Prosit | ||
df = df[(df["PEPTIDE_LENGTH"] <= 30) & (df["PEPTIDE_LENGTH"] >= 7)] | ||
# remove unsupported mods to exclude | ||
unsupported_mods = [r"Acetyl \(Protein N\-term\)", "ac", r"\[[0-9]+\]"] | ||
exclude_mods_pattern = re.compile("|".join(unsupported_mods)) | ||
df = df[~df["MODIFIED_SEQUENCE"].str.contains(exclude_mods_pattern)] | ||
# remove non-canonical aas | ||
df = df[(~df["SEQUENCE"].str.contains("U|O"))] | ||
# remove precursor charges greater than 6 | ||
df = df[df["PRECURSOR_CHARGE"] <= 6] | ||
logger.info(f"#sequences after filtering for valid prosit sequences: {len(df.index)}") | ||
|
||
return df |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.