import os
import glob
import numpy as np
import pandas as pd
from diffupath.constants import ROOT_RESULTS_DIR, DEFAULT_DIFFUPATH_DIR, OUTPUT_DIR
from diffupath.utils import get_last_file
DATA_INPUT_PATH = os.path.join(ROOT_RESULTS_DIR, 'data', 'input_samples', 'input_sample_1.csv')
from diffupy.process_input import process_input_data
input_labels = process_input_data(DATA_INPUT_PATH)
pd.DataFrame(index = input_labels.keys(), data={'scores':list(input_labels.values())})
scores | |
---|---|
MANF | 1.81 |
MARS | 1.86 |
AGR2 | 4.82 |
Isoleucine | 1.64 |
Alanine | 1.53 |
from diffupath.diffuse import run_diffusion
run_diffusion(DATA_INPUT_PATH).as_pd_dataframe() #DATA INPUT and GRAPH as PATHs
🌐 Loading network 🌐 🌐Loading from /Users/josepmarin-llao/.diffupath/kernels/Homo_sapiens_kernel_regularized_pathme_universe.pickle 🌐
INFO: [2020-12-21 20:07:55] diffupy.process_network - 🌐 Kernel loaded with: 42272 nodes 🌐
🌐 Processing data input from /Users/Projects/MultiPath/Results/data/input_samples/input_sample_1.csv. 🌐
INFO: [2020-12-21 20:07:55] diffupy.process_input - Processing the data input. INFO: [2020-12-21 20:07:56] diffupy.process_input - Mapping the input labels to the background labels reference. INFO: [2020-12-21 20:07:57] diffupy.process_input - Formatting the processed to the reference kernel Matrix.
Mapping coverage statistics total: 2 mapped entities, 40.0% input coverage 🌐 Computing the diffusion algorithm. 🌐
INFO: [2020-12-21 20:07:57] root - Scores validated. INFO: [2020-12-21 20:09:29] root - Using supplied kernel matrix... INFO: [2020-12-21 20:09:29] root - Kernel validated scores. INFO: [2020-12-21 20:09:29] root - Scores matched. INFO: [2020-12-21 20:11:01] root - Matrix product for raw scores preformed.
🌐 Diffusion performed with success.🌐
/Users/Projects/MultiPath/diffuPy/src/diffupy/matrix.py:512: FutureWarning: set_axis currently defaults to operating inplace. This will change in a future version of pandas, use inplace=True to avoid this warning. df.set_axis(rows_labels)
output diffusion scores | |
---|---|
alanine | 0.038795 |
mars | -0.218957 |
rxn(reactants(a(CHEBI:Homocysteine)), products()) | -0.733597 |
pyruvate | -0.922410 |
composite(p(HGNC:MARS), p(HGNC:MARS2)) | -0.923275 |
lactate | -0.952186 |
rxn(reactants(a(CHEBI:lactate)), products(a(CHEBI:pyruvate))) | -0.958199 |
rxn(reactants(a(CHEBI:Lactate)), products(a(CHEBI:Pyruvate))) | -0.958199 |
rxn(reactants(a(CHEBI:pyruvate)), products()) | -0.961205 |
rxn(reactants(a(CHEBI:Pyruvate)), products()) | -0.961205 |
rxn(reactants(a(CHEBI:Pyruvate)), products(a(CHEBI:Lactate))) | -0.966930 |
rxn(reactants(a(CHEBI:pyruvate)), products(a(CHEBI:lactate))) | -0.966930 |
rxn(reactants(a(CHEBI:Pyruvate)), products(a(WIKIPATHWAYS:"Kreb's Cycle"))) | -0.968964 |
rxn(reactants(), products(a(CHEBI:Pyruvate))) | -0.968964 |
rxn(reactants(a(CHEBI:"Fructose Bisphosphate")), products(a(CHEBI:Pyruvate))) | -0.970643 |
rxn(reactants(a(CHEBI:"L-selenomethionine")), products(a(CHEBI:"Sem-tRNA(Met)"))) | -0.973541 |
rxn(reactants(a(CHEBI:"Sem-tRNA(Met)")), products(a(CHEBI:"L-selenomethionine"))) | -0.973541 |
rxn(reactants(a(CHEBI:Pyruvate)), products(a(CHEBI:"Acetyl-CoA(mit)"))) | -0.975436 |
rxn(reactants(a(CHEBI:"L-methionine")), products(a(CHEBI:"Met-tRNA(Met)"))) | -0.976344 |
rxn(reactants(a(CHEBI:pyruvate)), products(a(CHEBI:Oxaloacetate))) | -0.976703 |
rxn(reactants(a(CHEBI:pyruvate)), products(a(CHEBI:"Acetyl-CoA"))) | -0.976739 |
mars2 | -0.980610 |
homocysteine | -0.981833 |
sem-trna(met) | -0.982361 |
tca cycle | -0.983760 |
met-trna(met) | -0.984412 |
kreb's cycle | -0.984482 |
pyruvate kinase | -0.984482 |
pdha1 | -0.984870 |
oxaloacetate | -0.985410 |
... | ... |
complex(a(REACTOME:"Ligands recognized by TLR7 and TLR8"), complex(REACTOME:"TLR7 or TLR8")) | -1.000000 |
complex(p(REACTOME:"PROK1,PROK2"), p(REACTOME:"PROKR1,PROKR2")) | -1.000000 |
complex(a(REACTOME:"PI3K inhibitors"), a(REACTOME:"PI3K mutants,Activator:PI3K")) | -1.000000 |
phosphoantigens (pags) | -1.000000 |
rxn(reactants(a(REACTOME:"Activated T Cell surface"), p(HGNC:BTN2A2)), products(complex(a(REACTOME:"Activated T Cell surface"), p(HGNC:BTN2A2)))) | -1.000000 |
complex(a(REACTOME:"Activated T Cell surface"), p(HGNC:BTN2A2)) | -1.000000 |
rxn(reactants(a(REACTOME:"DDR1-binding collagens"), complex(p(HGNC:DDR1))), products(complex(a(REACTOME:"DDR1-binding collagens"), complex(p(HGNC:DDR1))))) | -1.000000 |
ddr1-binding collagens | -1.000000 |
complex(p(HGNC:DDR1)) | -1.000000 |
complex(a(REACTOME:"DDR1-binding collagens"), complex(p(HGNC:DDR1))) | -1.000000 |
ubqln1 | -1.000000 |
endostatin | -1.000000 |
add1 | -1.000000 |
pn1 | -1.000000 |
ps15 | -1.000000 |
alpha-1(vi) chains | -1.000000 |
alpha-1(v) propeptides | -1.000000 |
scara5 | -1.000000 |
at2 | -1.000000 |
proteins chaperoned by timm9:timm10 | -1.000000 |
fxc1 | -1.000000 |
timm22 | -1.000000 |
bcap31(165-237) | -1.000000 |
mst3 | -1.000000 |
prok2 | -1.000000 |
2-hexaprenyl-6-methoxy-1,4-benzoquinone | -1.000000 |
complex(p(HGNC:FXC1), p(HGNC:TIMM10), p(HGNC:TIMM9)) | -1.000000 |
pn2 | -1.000000 |
alpha-2(vi) chains | -1.000000 |
timm10 | -1.000000 |
42272 rows × 1 columns
run_diffusion(input_labels).as_pd_dataframe() #DATA INPUT and GRAPH as Python OBJECTS
🌐 Loading network 🌐 🌐Loading from /Users/josepmarin-llao/.diffupath/kernels/Homo_sapiens_kernel_regularized_pathme_universe.pickle 🌐
INFO: [2020-12-21 20:38:10] diffupy.process_network - 🌐 Kernel loaded with: 42272 nodes 🌐
🌐 Processing data input from {'MANF': 1.81, 'MARS': 1.86, 'AGR2': 4.82, 'Isoleucine': 1.64, 'Alanine': 1.53}. 🌐
INFO: [2020-12-21 20:38:11] diffupy.process_input - Processing the data input. INFO: [2020-12-21 20:38:11] diffupy.process_input - Mapping the input labels to the background labels reference. INFO: [2020-12-21 20:38:12] diffupy.process_input - Formatting the processed to the reference kernel Matrix.
Mapping coverage statistics total: 2 mapped entities, 40.0% input coverage 🌐 Computing the diffusion algorithm. 🌐
INFO: [2020-12-21 20:38:13] root - Scores validated. INFO: [2020-12-21 20:39:57] root - Using supplied kernel matrix... INFO: [2020-12-21 20:39:57] root - Kernel validated scores. INFO: [2020-12-21 20:39:57] root - Scores matched. INFO: [2020-12-21 20:41:52] root - Matrix product for raw scores preformed.
🌐 Diffusion performed with success.🌐
output diffusion scores | |
---|---|
alanine | 0.038795 |
mars | -0.218957 |
rxn(reactants(a(CHEBI:Homocysteine)), products()) | -0.733597 |
pyruvate | -0.922410 |
composite(p(HGNC:MARS), p(HGNC:MARS2)) | -0.923275 |
lactate | -0.952186 |
rxn(reactants(a(CHEBI:lactate)), products(a(CHEBI:pyruvate))) | -0.958199 |
rxn(reactants(a(CHEBI:Lactate)), products(a(CHEBI:Pyruvate))) | -0.958199 |
rxn(reactants(a(CHEBI:pyruvate)), products()) | -0.961205 |
rxn(reactants(a(CHEBI:Pyruvate)), products()) | -0.961205 |
rxn(reactants(a(CHEBI:Pyruvate)), products(a(CHEBI:Lactate))) | -0.966930 |
rxn(reactants(a(CHEBI:pyruvate)), products(a(CHEBI:lactate))) | -0.966930 |
rxn(reactants(a(CHEBI:Pyruvate)), products(a(WIKIPATHWAYS:"Kreb's Cycle"))) | -0.968964 |
rxn(reactants(), products(a(CHEBI:Pyruvate))) | -0.968964 |
rxn(reactants(a(CHEBI:"Fructose Bisphosphate")), products(a(CHEBI:Pyruvate))) | -0.970643 |
rxn(reactants(a(CHEBI:"L-selenomethionine")), products(a(CHEBI:"Sem-tRNA(Met)"))) | -0.973541 |
rxn(reactants(a(CHEBI:"Sem-tRNA(Met)")), products(a(CHEBI:"L-selenomethionine"))) | -0.973541 |
rxn(reactants(a(CHEBI:Pyruvate)), products(a(CHEBI:"Acetyl-CoA(mit)"))) | -0.975436 |
rxn(reactants(a(CHEBI:"L-methionine")), products(a(CHEBI:"Met-tRNA(Met)"))) | -0.976344 |
rxn(reactants(a(CHEBI:pyruvate)), products(a(CHEBI:Oxaloacetate))) | -0.976703 |
rxn(reactants(a(CHEBI:pyruvate)), products(a(CHEBI:"Acetyl-CoA"))) | -0.976739 |
mars2 | -0.980610 |
homocysteine | -0.981833 |
sem-trna(met) | -0.982361 |
tca cycle | -0.983760 |
met-trna(met) | -0.984412 |
kreb's cycle | -0.984482 |
pyruvate kinase | -0.984482 |
pdha1 | -0.984870 |
oxaloacetate | -0.985410 |
... | ... |
complex(a(REACTOME:"Ligands recognized by TLR7 and TLR8"), complex(REACTOME:"TLR7 or TLR8")) | -1.000000 |
complex(p(REACTOME:"PROK1,PROK2"), p(REACTOME:"PROKR1,PROKR2")) | -1.000000 |
complex(a(REACTOME:"PI3K inhibitors"), a(REACTOME:"PI3K mutants,Activator:PI3K")) | -1.000000 |
phosphoantigens (pags) | -1.000000 |
rxn(reactants(a(REACTOME:"Activated T Cell surface"), p(HGNC:BTN2A2)), products(complex(a(REACTOME:"Activated T Cell surface"), p(HGNC:BTN2A2)))) | -1.000000 |
complex(a(REACTOME:"Activated T Cell surface"), p(HGNC:BTN2A2)) | -1.000000 |
rxn(reactants(a(REACTOME:"DDR1-binding collagens"), complex(p(HGNC:DDR1))), products(complex(a(REACTOME:"DDR1-binding collagens"), complex(p(HGNC:DDR1))))) | -1.000000 |
ddr1-binding collagens | -1.000000 |
complex(p(HGNC:DDR1)) | -1.000000 |
complex(a(REACTOME:"DDR1-binding collagens"), complex(p(HGNC:DDR1))) | -1.000000 |
ubqln1 | -1.000000 |
endostatin | -1.000000 |
add1 | -1.000000 |
pn1 | -1.000000 |
ps15 | -1.000000 |
alpha-1(vi) chains | -1.000000 |
alpha-1(v) propeptides | -1.000000 |
scara5 | -1.000000 |
at2 | -1.000000 |
proteins chaperoned by timm9:timm10 | -1.000000 |
fxc1 | -1.000000 |
timm22 | -1.000000 |
bcap31(165-237) | -1.000000 |
mst3 | -1.000000 |
prok2 | -1.000000 |
2-hexaprenyl-6-methoxy-1,4-benzoquinone | -1.000000 |
complex(p(HGNC:FXC1), p(HGNC:TIMM10), p(HGNC:TIMM9)) | -1.000000 |
pn2 | -1.000000 |
alpha-2(vi) chains | -1.000000 |
timm10 | -1.000000 |
42272 rows × 1 columns
from diffupath.diffuse import run_diffusion
run_diffusion(input_labels, database='kegg').as_pd_dataframe()
🌐 Loading network 🌐 🌐Loading from /Users/josepmarin-llao/.diffupath/kernels/by_db/kegg.pickle 🌐
INFO: [2020-12-22 00:01:17] diffupy.process_network - 🌐 Kernel loaded with: 13228 nodes 🌐
🌐 Processing data input from {'MANF': 1.81, 'MARS': 1.86, 'AGR2': 4.82, 'Isoleucine': 1.64, 'Alanine': 1.53}. 🌐
INFO: [2020-12-22 00:01:17] diffupy.process_input - Processing the data input. INFO: [2020-12-22 00:01:17] diffupy.process_input - Mapping the input labels to the background labels reference. INFO: [2020-12-22 00:01:18] diffupy.process_input - Formatting the processed to the reference kernel Matrix.
Mapping coverage statistics total: 1 mapped entities, 20.0% input coverage 🌐 Computing the diffusion algorithm. 🌐
INFO: [2020-12-22 00:01:18] root - Scores validated. INFO: [2020-12-22 00:01:21] root - Using supplied kernel matrix... INFO: [2020-12-22 00:01:21] root - Kernel validated scores. INFO: [2020-12-22 00:01:21] root - Scores matched. INFO: [2020-12-22 00:01:21] root - Matrix product for raw scores preformed.
🌐 Diffusion performed with success.🌐
/Users/Projects/MultiPath/diffuPy/src/diffupy/matrix.py:512: FutureWarning: set_axis currently defaults to operating inplace. This will change in a future version of pandas, use inplace=True to avoid this warning. df.set_axis(rows_labels)
output diffusion scores | |
---|---|
mars | 0.054156 |
composite(p(HGNC:MARS), p(HGNC:MARS2)) | -0.891687 |
mars2 | -0.945844 |
rxn(reactants(a(CHEBI:"Sem-tRNA(Met)")), products(a(CHEBI:"L-selenomethionine"))) | -0.961102 |
rxn(reactants(a(CHEBI:"L-selenomethionine")), products(a(CHEBI:"Sem-tRNA(Met)"))) | -0.961102 |
rxn(reactants(a(CHEBI:"L-methionine")), products(a(CHEBI:"Met-tRNA(Met)"))) | -0.964683 |
met-trna(met) | -0.970642 |
sem-trna(met) | -0.974068 |
l-selenomethionine | -0.978654 |
rxn(reactants(a(CHEBI:"Met-tRNA(Met)")), products(a(CHEBI:"fMet-tRNA(fMet)"))) | -0.988426 |
mtfmt | -0.989503 |
rxn(reactants(a(CHEBI:"Met-tRNA(Met)")), products(a(CHEBI:"5,6,7,8-tetrahydrofolic acid"))) | -0.989553 |
rxn(reactants(a(CHEBI:"L-selenohomocysteine")), products(a(CHEBI:"L-selenomethionine"))) | -0.991997 |
rxn(reactants(a(CHEBI:"L-selenomethionine")), products(a(CHEBI:"L-selenohomocysteine"))) | -0.991997 |
rxn(reactants(a(CHEBI:"L-selenomethionine")), products(a(CHEBI:methylselenol))) | -0.992723 |
rxn(reactants(a(CHEBI:methylselenol)), products(a(CHEBI:"L-selenomethionine"))) | -0.992723 |
mtr | -0.993320 |
cysteine and methionine metabolism | -0.994335 |
fmet-trna(fmet) | -0.994635 |
cth | -0.995217 |
rxn(reactants(a(CHEBI:"10-formyltetrahydrofolic acid")), products(a(CHEBI:"fMet-tRNA(fMet)"))) | -0.995480 |
l-selenohomocysteine | -0.996016 |
l-methionine | -0.996402 |
methylselenol | -0.997020 |
rxn(reactants(a(CHEBI:"5,6,7,8-tetrahydrofolic acid")), products(a(CHEBI:"5-methyltetrahydrofolic acid"))) | -0.997259 |
rxn(reactants(a(CHEBI:"5-methyltetrahydrofolic acid")), products(a(CHEBI:"5,6,7,8-tetrahydrofolic acid"))) | -0.997259 |
rxn(reactants(a(CHEBI:"10-formyltetrahydrofolic acid")), products(a(CHEBI:"5,6,7,8-tetrahydrofolic acid"))) | -0.997502 |
rxn(reactants(a(CHEBI:"L-homocysteine")), products(a(CHEBI:"L-methionine"))) | -0.997642 |
5-methyltetrahydrofolic acid | -0.997699 |
composite(p(HGNC:BHMT), p(HGNC:BHMT2), p(HGNC:MTR)) | -0.997774 |
... | ... |
gemin6 | -1.000000 |
nup62 | -1.000000 |
nup58 | -1.000000 |
nup54 | -1.000000 |
nup93 | -1.000000 |
nup205 | -1.000000 |
nup188 | -1.000000 |
nup155 | -1.000000 |
nup35 | -1.000000 |
hat1 | -1.000000 |
glyat | -1.000000 |
rxn(reactants(a(CHEBI:"benzoyl-CoA")), products(a(CHEBI:"N-benzoylglycine"))) | -1.000000 |
composite(p(HGNC:HBA1), p(HGNC:HBA2), p(HGNC:HBB)) | -1.000000 |
hbb | -1.000000 |
composite(p(HGNC:AP2A1), p(HGNC:AP2A2), p(HGNC:AP2B1), p(HGNC:AP2M1), p(HGNC:AP2S1)) | -1.000000 |
ap2m1 | -1.000000 |
srsf3 | -1.000000 |
rxn(reactants(a(CHEBI:"2,5-dichloro-4-oxohex-2-enedioic acid")), products(a(CHEBI:"2,5-Dichloro-carboxymethylenebut-2-en-4-olide"))) | -1.000000 |
rxn(reactants(a(CHEBI:"3,4-dihydroxy-5-polyprenylbenzoate")), products(a(CHEBI:"3-Polyprenyl-4-hydroxy-5-methoxybenzoate"))) | -1.000000 |
3,4-dihydroxy-5-polyprenylbenzoate | -1.000000 |
2-polyprenyl-3-methyl-5-hydroxy-6-methoxy-1,4-benzoquinone | -1.000000 |
rxn(reactants(a(KEGG:"gl:G13057")), products(a(KEGG:"gl:G13058"))) | -1.000000 |
rxn(reactants(a(CHEBI:"cob(I)alamin")), products(a(CHEBI:cobamamide))) | -1.000000 |
rxn(reactants(a(CHEBI:cobamamide)), products(a(CHEBI:"cob(I)alamin"))) | -1.000000 |
coq5 | -1.000000 |
3-methyl-6-methoxy-2-octaprenyl-1,4-benzoquinone | -1.000000 |
coq3 | -1.000000 |
nsfl1c | -1.000000 |
galr1 | -1.000000 |
ap2a1 | -1.000000 |
13228 rows × 1 columns