Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworking PEP to prevent cross-contamination #2394

Merged
merged 118 commits into from
Aug 28, 2024

Conversation

Alexander-Sol
Copy link
Contributor

@Alexander-Sol Alexander-Sol commented Aug 6, 2024

This PR changes how the PEP Engine works in order to prevent contamination during cross validation. It also changes how decoys are generated.

PEP Changes

In PEP, all PSMs that correspond to the same sequence are grouped together. The PeptideMatchGroup class enables this, acting as a collection of PSMs that all correspond to the same base sequence.

Then, the PEP engine splits the PeptideMatchGroups into 4 partitions. All PSMs in one partition have their PEPs calculated using a model trained on data from the other three partitions.

Decoy changes

When databases are loaded in MetaMorpheusTask, there is a new step that removes decoy peptides that are identical to target peptides. This is done by modifying the base sequence of each decoy protein to scramble and sequences that are identical to a target peptide.

@trishorts
Copy link
Contributor

image

/// e.g., partition 1 = [0, 4, 8...], partition 2 = [1, 5, 9...], etc.
/// </summary>
/// <returns>A list containing numGroups partitions (lists of ints) </returns>
static List<List<int>> DivideListIntoGroups(List<int> list, int numGroups)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was a previously less complicated method here. did it not function correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously, the method took sequential chunks from each list. e.g., [1,2,3,4,5,6,7,8] would return [[1, 2], [3, 4], [5, 6], [7, 8]].

This function would return [[1, 5], [2, 6], [3, 7], [4, 8]].

Copy link
Contributor

@nbollis nbollis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, a few scattered questions here and there.

MetaMorpheus/EngineLayer/EngineLayer.csproj Outdated Show resolved Hide resolved
MetaMorpheus/Test/MyTaskTest.cs Outdated Show resolved Hide resolved
MetaMorpheus/Test/FdrTest.cs Show resolved Hide resolved
@trishorts trishorts merged commit 5c019b4 into smith-chem-wisc:master Aug 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants