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
Background network randomization and graph expansion fix #6
Conversation
I had problems with igraph in my R environment, so we decided to split the network randomization from the PCSF+TPS pipeline. Unlike the protein-peptide map permutation and bootstrapping, a separate script |
aa3d674 is a relaxation to allow self-edges in the TPS partial model file. The randomized networks can introduce self-edges, which we will note in the readme. |
Our relaxed assumption still breaks when the input has a self edge A -> A, where the protein A has multiple phosphosites. This is due to the Cartesian product of phosphosites generating pairs that violate the assumption, e.g. A#C -> A#B. We remove this assertion and add code that explicitly handles the lexicographically-aware expansion and collapsing of peptide-level solutions. |
We also added a fix to transformations between protein-level and peptide-level graphs, to handle cases where the protein-level network had self-edges. @agitter , would you like to look at the python and R scripts to generate randomized networks, or should I go ahead and merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Python and R code looks good to me. We're ready to merge.
Purpose
Introduce tooling for randomizing the background network. We use BiRewire to randomize the directed and undirected edges of the background network separately, shuffle the weights for each subset of edges, and produce weighted, randomized background networks with the same number of undirected and directed edges as the input. We additionally generate partial model files that correspond to the directed subgraph of each randomized background network.
Technical description
Testing plan
I tested the workflow manually as I was debugging BiRewire, but I can also produce some tests to supplement them.