Skip to content

Commit e6b9d1a

Browse files
preparing for version 0.0.4
1 parent 2bea301 commit e6b9d1a

File tree

7 files changed

+541
-123
lines changed

7 files changed

+541
-123
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ data.get_results()
116116

117117
data.get_results_binary()
118118

119+
# get R2 values, coefficients, and coefficient p-values for all models/edges
120+
data.get_model_stats()
121+
119122
```
120123

121124
The expected run time for the installation and running the demo dataset on a "normal" desktop computer is around 3~5 minutes.

dev_tests.ipynb

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,20 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 94,
5+
"execution_count": 1,
66
"id": "d03d274e-6792-4bbf-93bf-b8c7259c1d7f",
77
"metadata": {},
8-
"outputs": [
9-
{
10-
"name": "stdout",
11-
"output_type": "stream",
12-
"text": [
13-
"The autoreload extension is already loaded. To reload it, use:\n",
14-
" %reload_ext autoreload\n"
15-
]
16-
}
17-
],
8+
"outputs": [],
189
"source": [
1910
"%load_ext autoreload\n",
2011
"%autoreload 2\n",
2112
"import pandas as pd\n",
22-
"from dysregnet.dysregnet import run"
13+
"from src.dysregnet.dysregnet import run"
2314
]
2415
},
2516
{
2617
"cell_type": "code",
27-
"execution_count": 47,
18+
"execution_count": 2,
2819
"id": "b6408bef-4768-42c3-88e3-21e250102240",
2920
"metadata": {},
3021
"outputs": [],
@@ -36,7 +27,7 @@
3627
},
3728
{
3829
"cell_type": "code",
39-
"execution_count": 48,
30+
"execution_count": 3,
4031
"id": "0b876315-e883-450e-95a4-88b7caf76085",
4132
"metadata": {},
4233
"outputs": [],
@@ -53,7 +44,7 @@
5344
},
5445
{
5546
"cell_type": "code",
56-
"execution_count": 49,
47+
"execution_count": 4,
5748
"id": "208046d3-5d5f-4ea4-aae7-c575094bc88e",
5849
"metadata": {},
5950
"outputs": [
@@ -266,7 +257,7 @@
266257
"[5 rows x 38 columns]"
267258
]
268259
},
269-
"execution_count": 49,
260+
"execution_count": 4,
270261
"metadata": {},
271262
"output_type": "execute_result"
272263
}
@@ -277,7 +268,7 @@
277268
},
278269
{
279270
"cell_type": "code",
280-
"execution_count": 50,
271+
"execution_count": 5,
281272
"id": "35febb56-1441-4049-a452-450c25afebb1",
282273
"metadata": {},
283274
"outputs": [
@@ -490,7 +481,7 @@
490481
"[5 rows x 22579 columns]"
491482
]
492483
},
493-
"execution_count": 50,
484+
"execution_count": 5,
494485
"metadata": {},
495486
"output_type": "execute_result"
496487
}
@@ -501,7 +492,7 @@
501492
},
502493
{
503494
"cell_type": "code",
504-
"execution_count": 51,
495+
"execution_count": 6,
505496
"id": "9dd72783-5b5d-488d-937e-f1d34535b29a",
506497
"metadata": {},
507498
"outputs": [
@@ -569,7 +560,7 @@
569560
"4 AHR FOS"
570561
]
571562
},
572-
"execution_count": 51,
563+
"execution_count": 6,
573564
"metadata": {},
574565
"output_type": "execute_result"
575566
}
@@ -580,7 +571,7 @@
580571
},
581572
{
582573
"cell_type": "code",
583-
"execution_count": 82,
574+
"execution_count": 7,
584575
"id": "abda2742-f17d-440c-b5b2-e021d2c26f9c",
585576
"metadata": {},
586577
"outputs": [],
@@ -591,15 +582,15 @@
591582
},
592583
{
593584
"cell_type": "code",
594-
"execution_count": 95,
585+
"execution_count": 8,
595586
"id": "62b921d3-27e0-4f54-a77b-d3b35d5eedfb",
596587
"metadata": {},
597588
"outputs": [
598589
{
599590
"name": "stderr",
600591
"output_type": "stream",
601592
"text": [
602-
"14979it [00:42, 354.63it/s]\n"
593+
"14979it [00:45, 332.12it/s]\n"
603594
]
604595
}
605596
],
@@ -614,7 +605,7 @@
614605
},
615606
{
616607
"cell_type": "code",
617-
"execution_count": 96,
608+
"execution_count": 9,
618609
"id": "c3aede6a-7044-456e-affd-3804f54eb9d7",
619610
"metadata": {},
620611
"outputs": [
@@ -1044,7 +1035,7 @@
10441035
"[515 rows x 14979 columns]"
10451036
]
10461037
},
1047-
"execution_count": 96,
1038+
"execution_count": 9,
10481039
"metadata": {},
10491040
"output_type": "execute_result"
10501041
}
@@ -1055,7 +1046,7 @@
10551046
},
10561047
{
10571048
"cell_type": "code",
1058-
"execution_count": 97,
1049+
"execution_count": 10,
10591050
"id": "e719292a-4d97-426a-b1aa-c64e1f0b1837",
10601051
"metadata": {},
10611052
"outputs": [
@@ -1272,7 +1263,7 @@
12721263
"[14979 rows x 9 columns]"
12731264
]
12741265
},
1275-
"execution_count": 97,
1266+
"execution_count": 10,
12761267
"metadata": {},
12771268
"output_type": "execute_result"
12781269
}
@@ -1283,7 +1274,7 @@
12831274
},
12841275
{
12851276
"cell_type": "code",
1286-
"execution_count": 98,
1277+
"execution_count": 11,
12871278
"id": "3aacbc4e-8f13-48ef-849a-7404f45e9573",
12881279
"metadata": {},
12891280
"outputs": [
@@ -1713,7 +1704,7 @@
17131704
"[515 rows x 14979 columns]"
17141705
]
17151706
},
1716-
"execution_count": 98,
1707+
"execution_count": 11,
17171708
"metadata": {},
17181709
"output_type": "execute_result"
17191710
}

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
setup(name='dysregnet',
14-
version='0.0.3',
14+
version='0.0.4',
1515
description='DysRegNet',
1616
long_description=README,
1717
long_description_content_type="text/markdown",
@@ -27,7 +27,8 @@
2727
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
2828
"Topic :: Scientific/Engineering :: Bio-Informatics",
2929
],
30-
packages=find_packages(),
30+
package_dir = {'': 'src'},
31+
packages=['dysregnet'],
3132
include_package_data=True,
3233
python_requires='>=3.7',
3334
install_requires=[
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(self,
5757
List of continuous covariates. They should match the name of their columns in meta Dataframe.
5858
5959
60-
zscoring: boolean, default: True
60+
zscoring: boolean, default: False
6161
zscoring of expression data (if needed).
6262
6363
bonferroni_alpha: Float
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ def dyregnet_model(data):
8686
# fit the model
8787
model = sm.OLS(y_train, x_train)
8888
results = model.fit()
89+
90+
model_stats[edge] = [results.rsquared] + list(results.params.values) + list(results.pvalues.values)
91+
8992

9093
# get residuals of control
9194
resid_control = results.predict(x_train) - y_train
@@ -162,7 +165,6 @@ def dyregnet_model(data):
162165

163166

164167
edges[edge] = np.round(zscore, 1)
165-
model_stats[edge] = [results.rsquared] + list(results.params.values) + list(results.pvalues.values)
166168

167169

168170

0 commit comments

Comments
 (0)