fragcompΒΆ
The fragment competition module contains functionality to maintain the exclusive assignment of signal to identifications.
The fragment competition module contains functionality to maintain the exclusive assignment of signal to identifications.
- class alphadia.fragcomp.fragcomp.FragmentCompetition(rt_tol_seconds: int = 3, mass_tol_ppm: int = 15, thread_count: int = 8)[source]ΒΆ
Bases:
objectFragment competition class to remove PSMs that share fragments with other PSMs.
- __init__(rt_tol_seconds: int = 3, mass_tol_ppm: int = 15, thread_count: int = 8)[source]ΒΆ
Remove PSMs that share fragments with other PSMs.
- Parameters:
rt_tol_seconds (int) β The retention time tolerance in seconds.
mass_tol_ppm (int) β The mass tolerance in ppm.
thread_count (int) β The number of threads to use.
Utility methods for fragment competition.
- alphadia.fragcomp.utils.add_frag_start_stop_idx(psm_df: DataFrame, frag_df: DataFrame) DataFrame[source]ΒΆ
The fragment dataframe is indexed by the precursor index.
This function adds the start and stop indices of the fragments to the PSM dataframe.
- Parameters:
psm_df (pd.DataFrame) β The PSM dataframe.
frag_df (pd.DataFrame) β The fragment dataframe.
- Returns:
The PSM dataframe with the start and stop indices of the fragments.
- Return type:
pd.DataFrame
- alphadia.fragcomp.utils.candidate_hash(precursor_idx: ndarray, rank: ndarray) ndarray[source]ΒΆ
Create a 64 bit hash (np.ndarray[np.uint64]) from precursor_idx and rank.
The precursor_idx is the lower 32 bits. The rank is the next 8 bits.
Note: the explicit casting is important to ensure it returns a 64-bit integer.