-
Notifications
You must be signed in to change notification settings - Fork 9
dataset: synthetic from PANTHER #25
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
Open
tristan-f-r
wants to merge
17
commits into
main
Choose a base branch
from
synthetic
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
20b1580
feat: synthetic pathways
tristan-f-r fc12b4e
Merge branch 'main' into synthetic
tristan-f-r 8ff381f
Merge branch 'main' into synthetic
tristan-f-r f7c0c2d
fix: use full protein links to unify synthetic with databases
tristan-f-r 73b6d93
Merge branch 'main' into synthetic
tristan-f-r 2ce621a
re-correct links
tristan-f-r 280b92a
fix: interactome fetching
tristan-f-r db30556
fix(diseases): fetch correct string links
tristan-f-r 0658528
chore: mv to scripts
tristan-f-r e024e2c
chore: move to scripts, Pathify
tristan-f-r 7b09381
style: fmt
tristan-f-r 2a5feec
drop old thresholding
tristan-f-r e389b32
begin sampling
tristan-f-r af0ac30
chore: mv
tristan-f-r d1ade54
rename
tristan-f-r 7483eea
fix: compute weight counts normally
tristan-f-r 05cf6d6
feat: weight-preserving sampling
tristan-f-r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,3 @@ | ||
| intermediate | ||
| processed | ||
| raw/9606.protein.links.full.v12.0.txt |
This file contains hidden or 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,63 @@ | ||
| # Synthetic Data | ||
|
|
||
| ## Download STRING Human Interactome | ||
| 1. Download the STRING *Homo sapiens* `9606.protein.links.full.v12.0.txt.gz` database file from [STRING](https://string-db.org/cgi/download?sessionId=bL9sRTdIaUEt&species_text=Homo+sapiens&settings_expanded=0&min_download_score=0&filter_redundant_pairs=0&delimiter_type=txt). | ||
| 2. Move the downloaded file into the `raw/human-interactome/` folder. | ||
| 3. From the `raw/synthetic-data/` directory, extract the file using: | ||
|
|
||
| ```sh | ||
| gunzip human-interactome/9606.protein.links.full.v12.0.txt.gz | ||
| ``` | ||
|
|
||
| ## Download New PANTHER Pathways | ||
| 1. Visit [Pathway Commons](https://www.pathwaycommons.org/). | ||
| 2. Search for the desired pathway (e.g., "signaling") and filter the results by the **PANTHER pathway** data source. | ||
| Example: [Search for "Signaling" filtered by PANTHER pathway](https://apps.pathwaycommons.org/search?datasource=panther&q=Signaling&type=Pathway) | ||
| 3. Click on the desired pathway and download the **Extended SIF** version of the pathway. | ||
| 4. In the `raw/pathway-data/` folder, create a new subfolder named after the pathway you downloaded. | ||
| 5. Move the downloaded Extended SIF file to this new folder (as a `.txt` file). Rename the file to match the subfolder name exactly. | ||
|
|
||
| ## Sources and Targets | ||
|
|
||
| [Sources](https://www.pnas.org/doi/full/10.1073/pnas.1808790115) are silico human surfaceomes receptors. | ||
|
|
||
| [Targets](https://academic.oup.com/nar/article/51/D1/D39/6765312) are human transcription factors. | ||
|
|
||
| ## Steps to Generate SPRAS-Compatible Pathways | ||
|
|
||
| ### 1. Process PANTHER Pathways | ||
|
|
||
| 1. Open `Snakefile` and add the name of any new pathways to the `pathways` entry. | ||
| 2. Run the command: | ||
| ``` | ||
| uv run scripts/process_panther_pathway.py <pathway> | ||
| ``` | ||
| 3. This will create five new files in the respective `pathway` subfolder of the `pathway-data/` directory: | ||
| - `EDGES.txt` | ||
| - `NODES.txt` | ||
| - `PRIZES-100.txt` | ||
| - `SOURCES.txt` | ||
| - `TARGETS.txt` | ||
|
|
||
| ### 2. Convert Pathways to SPRAS-Compatible Format | ||
| 1. In `panther_spras_formatting.py`, add the name of any new pathways to the `pathway_dirs` list on **line 8**. | ||
| 2. From the synthetic-data/ directory, run the command: | ||
| ``` | ||
| python scripts/panther_spras_formatting.py | ||
| ``` | ||
| 3. This will create a new folder named `spras-compatible-pathway-data`, containing subfolders for each PANTHER pathway in SPRAS-compatible format. | ||
| Each subfolder will include the following three files: | ||
| - `<pathway_name>_gs_edges.txt` | ||
| - `<pathway_name>_gs_nodes.txt` | ||
| - `<pathway_name>_node_prizes.txt` | ||
|
|
||
| # Pilot Data | ||
| For the pilot data, use the list `["Wnt_signaling", "JAK_STAT_signaling", "Interferon_gamma_signaling", "FGF_signaling", "Ras"]` in both: | ||
| - the list in `combine.py` | ||
| - the list in `overlap_analytics.py` | ||
|
|
||
| Make sure these pathways in the list are also added `["Wnt_signaling", "JAK_STAT_signaling", "Interferon_gamma_signaling", "FGF_signaling", "Ras"]`to: | ||
| - the `pathways` vector in `ProcessPantherPathway.R` | ||
| - the list in `panther_spras_formatting.py` | ||
|
|
||
| **Once you’ve updated the pathway lists in all relevant scripts, run all the steps above to generate the Pilot dataset.** |
This file contains hidden or 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,49 @@ | ||
| include: "../../cache/Snakefile" | ||
|
|
||
| pathways = ["Apoptosis_signaling", "B_cell_activation", | ||
| "Beta3_adrenergic_rec", "Cadherin_signaling", | ||
| "Hedgehog_signaling", "Insulin_IGF", | ||
| "Interleukin_signaling", "Notch_signaling", | ||
| "PDGF_signaling", "Ras", "T_cell_activation", | ||
| "Toll_signaling", "Wnt_signaling", "p38_MAPK", | ||
| "Nicotinic_acetylchol", "Fas_signaling", | ||
| "FGF_signaling", "Interferon_gamma_signaling", | ||
| "JAK_STAT_signaling", "VEGF_signaling"] | ||
|
|
||
| rule all: | ||
| input: | ||
| "raw/9606.protein.links.full.v12.0.txt", | ||
| expand([ | ||
| "processed/{pathway}/{pathway}_node_prizes.txt", | ||
| "processed/{pathway}/{pathway}_gs_edges.txt", | ||
| "processed/{pathway}/{pathway}_gs_nodes.txt" | ||
| ], pathway=pathways) | ||
|
|
||
| produce_fetch_rules({ | ||
| "raw/9606.protein.links.full.v12.0.txt": FetchConfig(["STRING", "9606", "9606.protein.links.full.txt.gz"], uncompress=True), | ||
| }) | ||
|
|
||
| rule process_panther_pathway: | ||
| input: "raw/pathway-data/{pathway}.txt" | ||
| output: | ||
| "intermediate/{pathway}/EDGES.txt", | ||
| "intermediate/{pathway}/NODES.txt", | ||
| "intermediate/{pathway}/TARGETS.txt", | ||
| "intermediate/{pathway}/SOURCES.txt", | ||
| "intermediate/{pathway}/PRIZES.txt" | ||
| shell: | ||
| "uv run scripts/process_panther_pathway.py {wildcards.pathway}" | ||
|
|
||
| rule make_spras_compatible: | ||
| input: | ||
| "intermediate/{pathway}/EDGES.txt", | ||
| "intermediate/{pathway}/NODES.txt", | ||
| "intermediate/{pathway}/TARGETS.txt", | ||
| "intermediate/{pathway}/SOURCES.txt", | ||
| "intermediate/{pathway}/PRIZES.txt" | ||
| output: | ||
| "processed/{pathway}/{pathway}_node_prizes.txt", | ||
| "processed/{pathway}/{pathway}_gs_edges.txt", | ||
| "processed/{pathway}/{pathway}_gs_nodes.txt" | ||
| shell: | ||
| "uv run scripts/panther_spras_formatting.py {wildcards.pathway}" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Each of the files have this variable. I think we should have it only in the snakefile and send this list to each of the files that use this pathway list