Skip to content

Commit

Permalink
save all
Browse files Browse the repository at this point in the history
  • Loading branch information
amirho3in committed Aug 18, 2024
1 parent a466ea4 commit 6247016
Show file tree
Hide file tree
Showing 34 changed files with 12 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions genepioneer/gene_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pandas as pd

import networkx as nx
import pkg_resources

class GeneAnalysis:

Expand All @@ -15,14 +16,16 @@ def __init__(self, cancer_type, input_path):


def load_genes(self):
df = pd.read_csv(f"../Data/cancer-gene-data/{self.cancer_type}_network_features.csv")
data_path = pkg_resources.resource_filename(__name__, f"Data/cancer-gene-data/{self.cancer_type}_network_features.csv")
df = pd.read_csv(data_path)

gene_data = df.to_dict(orient='records')

return gene_data

def load_modules(self):
with open(f"../Data/module-data/{self.cancer_type}.json", 'r') as file:
data_path = pkg_resources.resource_filename(__name__, f"Data/module-data/{self.cancer_type}.json")
with open(data_path, 'r') as file:
data = json.load(file)

modules = {}
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@
'scikit-learn',
'igraph',
'leidenalg',
'gprofiler'
'gprofiler',
'matplotlib',
'gprofiler-official'
],
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Bio-Informatics',
],
package_data={
'genepioneer': ['Data/**/*', 'Data/**/**/*'],
},
keywords='cancer, genomics, gene-analysis',
)
2 changes: 1 addition & 1 deletion tests/test_gene_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
# "Adrenal", "Bladder", "Brain", "Cervix", "Colon", "Corpus uteri", "Kidney", "Liver", "Ovary", "Prostate", "Skin", "Thyroid"
cancers = ["Bladder"]

gene_analysis = GeneAnalysis("Ovary", "../Data/benchmark-data/CGC.txt")
gene_analysis = GeneAnalysis("Ovary", "../genepioneer/Data/benchmark-data/CGC.txt")
gene_analysis.analyze_genes()

0 comments on commit 6247016

Please sign in to comment.