-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added rules for generating all-genes from ppi network
- Loading branch information
1 parent
ddb5e6a
commit 80716bc
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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
55 changes: 55 additions & 0 deletions
55
prepare_data/workflow/rules/prepare_enrichment_analysis.smk
This file contains 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,55 @@ | ||
# Resolve Network Dependency | ||
for key, path in config['networks'].items(): | ||
config["networks"][key] = path.format(network_dir=config["network_dir"]) | ||
|
||
rule data_prep_for_enrichment_analysis: | ||
input: | ||
expand( | ||
"{ppi_dir}/all_proteins/{network}/{file_format}/{name}.txt", | ||
ppi_dir = config["ppi_dir"], | ||
network = config["networks"].keys(), | ||
file_format = "uniprot", | ||
name = "all-proteins" | ||
), | ||
expand( | ||
"{gene_id_mapping_dir}/msu_mapping/{file_name}.pickle", | ||
gene_id_mapping_dir = config["gene_id_mapping_dir"], | ||
file_name = "uniprot_to_msu" | ||
), | ||
expand( | ||
"{raw_enrich_dir}/all_genes/{network}/{file_format}/all-genes.txt", | ||
raw_enrich_dir = config["raw_enrich_dir"], | ||
network = config["networks"].keys(), | ||
file_format = "MSU" | ||
) | ||
|
||
rule get_proteins_from_network: | ||
input: | ||
lambda wildcards: config['networks'][wildcards.network] | ||
output: | ||
"{ppi_dir}/all_proteins/{network}/{file_format}/{name}.txt" | ||
shell: | ||
"python scripts/network_util/get-nodes-from-network.py " \ | ||
"{input} {wildcards.ppi_dir}/all_proteins/{wildcards.network}/{wildcards.file_format} " \ | ||
"--name {wildcards.name}" | ||
|
||
rule convert_all_proteins_to_genes: | ||
input: | ||
proteins_file="{0}/all_proteins/{{network}}/uniprot/all-proteins.txt".format(config["ppi_dir"]), | ||
protein_to_gene_mapping="{0}/msu_mapping/uniprot_to_msu.pickle".format(config["gene_id_mapping_dir"]) | ||
output: | ||
"{raw_enrich_dir}/all_genes/{network}/{file_format}/all-genes.txt" | ||
shell: | ||
"python scripts/ppi_util/convert_all_prot_to_gene.py " \ | ||
"{input.proteins_file} {input.protein_to_gene_mapping} " \ | ||
"{wildcards.raw_enrich_dir}/all_genes/{wildcards.network}/{wildcards.file_format}" | ||
|
||
rule prepare_uniprot_to_gene: | ||
input: | ||
"{0}/Nb/Nb_gene_descriptions.csv".format(config["gene_desc_dir"]) | ||
output: | ||
"{gene_id_mapping_dir}/msu_mapping/{file_name}.pickle" | ||
shell: | ||
"python scripts/ppi_util/prepare_uniprot_to_gene.py " \ | ||
"{input} {wildcards.gene_id_mapping_dir}/msu_mapping " \ | ||
"{wildcards.file_name}" |