-
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
4
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
4 commits
Select commit
Hold shift + click to select a range
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
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,2 @@ | ||
| intermediate | ||
| processed |
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,93 @@ | ||
| # 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: | ||
|
|
||
| ``` | ||
| 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 `process_panther_pathway.py` and add the name of any new pathways to the `pathways` vector on **line 6**. | ||
| 2. Run the command: | ||
| ``` | ||
| uv run src/process_panther_pathway.py | ||
| ``` | ||
| 3. This will create five new files in each 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 `SPRAS_compatible_files.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 src/SPRAS_compatible_files.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` | ||
|
|
||
| 4. From the synthetic-data/ directory, run the command: | ||
| ``` | ||
| python src/ratios.py | ||
| ``` | ||
| 5. This will create a new file `data_ratio.txt` in `spras-compatible-pathway-data` to explain the edge to target/sources ratios. | ||
|
|
||
| ## Steps to get the interactomes | ||
| ### 1. Steps to get threshold interactomes | ||
| 1. From the synthetic-data/ directory, run the command: | ||
| ``` | ||
| python src/threshold_interactomes.py | ||
| ``` | ||
| 2. This will create a new folder named `interactomes`, containing a subfolder called `uniprot-threshold-interactomes`. | ||
| The subfolder will include the following 12 files: | ||
| - 10 thresholded interactomes: `uniprot_human_interactome_<threshold>.txt` (thresholds range from 1 to 900) | ||
| - `proteins_missing_aliases.csv`: STRING IDs that are missing UniProt accession identifiers | ||
| - `removed_edges.txt`: All edges removed from the uniprot_human_interactome_<threshold>.txt files | ||
|
|
||
| ### 2. Steps to get combined interactomes (Panther pathways and threshold interactomes) | ||
| 1. In `combine.py`, adjust the `pathway_dirs` list on **line 11** to be the pathways to be included in the combined networks | ||
| 2. From the synthetic-data/ directory, run the command: | ||
| ``` | ||
| python src/combine.py | ||
| ``` | ||
| 3. This will create a new a subfolder called `uniprot-combined-threshold-interactomes` in `interactomes`. | ||
| This subfolder will include 12 files: | ||
| - 10 combined threshold interactomes combined with the chosen pathways: `uniprot_combined_interactome_<threshold>.txt` (thresholds range from 1 to 900) | ||
| - `overlap_combined_info.csv` | ||
| - `overlap_info.csv` | ||
|
|
||
| # 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 `SPRAS_compatible_files.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,92 @@ | ||
| 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"] | ||
| # TODO: deduplicate this from thresholding scripts by passing it in? | ||
| thresholds = [1, 100, 200, 300, 400, 500, 600, 700, 800, 900] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar thing for the thresholds |
||
|
|
||
| rule all: | ||
| input: | ||
| "../../databases/string/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), | ||
| expand( | ||
| "processed/interactomes/uniprot-combined-threshold-interactomes/uniprot_combined_interactome_{threshold}.txt", | ||
| threshold=thresholds) | ||
|
|
||
| rule of_db: | ||
| output: | ||
| "../../databases/string/9606.protein.links.full.v12.0.txt" | ||
| run: | ||
| "uv run ../../databases/stringdb.py --id 9606" | ||
|
|
||
| rule combine_interactomes: | ||
| input: | ||
| expand("processed/{pathway}/{pathway}_gs_edges.txt", pathway=pathways), | ||
| expand( | ||
| "processed/interactomes/uniprot-threshold-interactomes/uniprot_human_interactome_{threshold}.txt", | ||
| threshold=thresholds) | ||
| output: | ||
| "processed/interactomes/uniprot-combined-threshold-interactomes/overlap_info.csv", | ||
| "processed/interactomes/uniprot-combined-threshold-interactomes/overlap_combined_info.csv", | ||
| expand( | ||
| "processed/interactomes/uniprot-combined-threshold-interactomes/uniprot_combined_interactome_{threshold}.txt", | ||
| threshold=thresholds) | ||
| shell: | ||
| "uv run src/combine.py" | ||
|
|
||
| rule threshold_interactomes: | ||
| input: | ||
| "../../databases/string/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) | ||
| output: | ||
| "processed/interactomes/uniprot-threshold-interactomes/proteins_missing_aliases.csv", | ||
| "processed/interactomes/uniprot-threshold-interactomes/removed_edges.txt", | ||
| expand( | ||
| "processed/interactomes/uniprot-threshold-interactomes/uniprot_human_interactome_{threshold}.txt", | ||
| threshold=thresholds) | ||
| shell: | ||
| "uv run src/threshold_interactomes.py" | ||
|
|
||
| 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 src/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 src/SPRAS_compatible_files.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