maradoner 0.13__tar.gz → 0.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of maradoner might be problematic. Click here for more details.
- {maradoner-0.13 → maradoner-0.14}/PKG-INFO +1 -1
- {maradoner-0.13 → maradoner-0.14}/maradoner/__init__.py +1 -1
- {maradoner-0.13 → maradoner-0.14}/maradoner/create.py +8 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/dataset_filter.py +0 -1
- {maradoner-0.13 → maradoner-0.14}/maradoner/grn.py +13 -3
- {maradoner-0.13 → maradoner-0.14}/maradoner.egg-info/PKG-INFO +1 -1
- {maradoner-0.13 → maradoner-0.14}/README.md +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/export.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/fit.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/main.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/mara/__init__.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/mara/export.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/mara/fit.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/mara/main.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/mara.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/meta_optimizer.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/select.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/synthetic_data.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner/utils.py +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner.egg-info/SOURCES.txt +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner.egg-info/dependency_links.txt +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner.egg-info/entry_points.txt +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner.egg-info/requires.txt +0 -0
- {maradoner-0.13 → maradoner-0.14}/maradoner.egg-info/top_level.txt +0 -0
- {maradoner-0.13 → maradoner-0.14}/setup.cfg +0 -0
- {maradoner-0.13 → maradoner-0.14}/setup.py +0 -0
|
@@ -74,6 +74,14 @@ def create_project(project_name: str, promoter_expression_filename: str, loading
|
|
|
74
74
|
logger_print('Reading dataset...', verbose)
|
|
75
75
|
promoter_expression = dt.fread(promoter_expression_filename).to_pandas()
|
|
76
76
|
promoter_expression = promoter_expression.set_index(promoter_expression.columns[0])
|
|
77
|
+
|
|
78
|
+
if sample_groups:
|
|
79
|
+
cols = set()
|
|
80
|
+
for vals in sample_groups.values():
|
|
81
|
+
cols.update(vals)
|
|
82
|
+
cols = list(cols)
|
|
83
|
+
promoter_expression = promoter_expression[cols]
|
|
84
|
+
|
|
77
85
|
proms = promoter_expression.index
|
|
78
86
|
sample_names = promoter_expression.columns
|
|
79
87
|
loading_matrices = [dt.fread(f).to_pandas() for f in loading_matrix_filenames]
|
|
@@ -79,7 +79,7 @@ def estimate_promoter_variance(project_name: str, prior_top=0.90):
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
def grn(project_name: str, output: str, use_hdf=False, save_stat=True,
|
|
82
|
-
prior_h1=1/100):
|
|
82
|
+
fdr_alpha=0.05, prior_h1=1/100):
|
|
83
83
|
data = read_init(project_name)
|
|
84
84
|
fmt = data.fmt
|
|
85
85
|
with openers[fmt](f'{project_name}.fit.{fmt}', 'rb') as f:
|
|
@@ -153,10 +153,20 @@ def grn(project_name: str, output: str, use_hdf=False, save_stat=True,
|
|
|
153
153
|
lr = lr[inds]
|
|
154
154
|
belief = belief[inds]
|
|
155
155
|
belief = belief.astype(np.half)
|
|
156
|
+
sorted_beliefs = np.sort(belief)
|
|
157
|
+
cumulative_fdr = np.cumsum(sorted_beliefs) / (np.arange(len(sorted_beliefs)) + 1)
|
|
158
|
+
try:
|
|
159
|
+
k = np.max(np.where(cumulative_fdr <= fdr_alpha)[0])
|
|
160
|
+
fdr_threshold = sorted_beliefs[k-1]
|
|
161
|
+
except ValueError:
|
|
162
|
+
fdr_threshold = 1.0
|
|
163
|
+
filename = os.path.join(folder_belief, f'{name}.txt')
|
|
164
|
+
with open(filename, 'w') as f:
|
|
165
|
+
f.write(f'{fdr_threshold}')
|
|
166
|
+
|
|
156
167
|
|
|
157
|
-
proms = list(np.array(prom_names)[inds])
|
|
158
168
|
|
|
159
|
-
|
|
169
|
+
proms = list(np.array(prom_names)[inds])
|
|
160
170
|
if use_hdf:
|
|
161
171
|
if save_stat:
|
|
162
172
|
lr = lr.astype(np.half)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|