maradoner 0.15.0__tar.gz → 0.16.0__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.15.0 → maradoner-0.16.0}/PKG-INFO +1 -3
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/__init__.py +1 -1
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/export.py +39 -1
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/main.py +22 -1
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner.egg-info/PKG-INFO +1 -3
- {maradoner-0.15.0 → maradoner-0.16.0}/setup.py +0 -2
- {maradoner-0.15.0 → maradoner-0.16.0}/README.md +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/create.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/dataset_filter.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/fit.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/grn.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/mara/__init__.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/mara/export.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/mara/fit.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/mara/main.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/mara.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/meta_optimizer.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/select.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/synthetic_data.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner/utils.py +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner.egg-info/SOURCES.txt +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner.egg-info/dependency_links.txt +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner.egg-info/entry_points.txt +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner.egg-info/requires.txt +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/maradoner.egg-info/top_level.txt +0 -0
- {maradoner-0.15.0 → maradoner-0.16.0}/setup.cfg +0 -0
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: maradoner
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: Variance-adjusted estimation of motif activities.
|
|
5
5
|
Home-page: https://github.com/autosome-ru/maradoner
|
|
6
6
|
Author: Georgy Meshcheryakov
|
|
7
7
|
Author-email: iam@georgy.top
|
|
8
8
|
Classifier: Programming Language :: Python :: 3.11
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
11
9
|
Classifier: Topic :: Scientific/Engineering
|
|
12
10
|
Classifier: Operating System :: OS Independent
|
|
13
11
|
Requires-Python: >=3.11
|
|
@@ -407,7 +407,45 @@ def export_results(project_name: str, output_folder: str,
|
|
|
407
407
|
promoter_names_test = np.array(data.promoter_names)[fit.promoter_inds_to_drop]
|
|
408
408
|
export_fov(test, os.path.join(folder, 'test'), promoter_names=promoter_names_test,
|
|
409
409
|
sample_names=sample_names)
|
|
410
|
-
|
|
410
|
+
|
|
411
|
+
def export_pairwise_test(project_name: str, output_folder: str,
|
|
412
|
+
group_a: str, group_b: str):
|
|
413
|
+
data = read_init(project_name)
|
|
414
|
+
fmt = data.fmt
|
|
415
|
+
motif_names = data.motif_names
|
|
416
|
+
prom_names = data.promoter_names
|
|
417
|
+
del data
|
|
418
|
+
with openers[fmt](f'{project_name}.fit.{fmt}', 'rb') as f:
|
|
419
|
+
fit: FitResult = dill.load(f)
|
|
420
|
+
if fit.promoter_inds_to_drop:
|
|
421
|
+
prom_names = np.delete(prom_names, fit.promoter_inds_to_drop)
|
|
422
|
+
group_names = fit.group_names
|
|
423
|
+
with openers[fmt](f'{project_name}.predict.{fmt}', 'rb') as f:
|
|
424
|
+
act: ActivitiesPrediction = dill.load(f)
|
|
425
|
+
if act.filtered_motifs is not None:
|
|
426
|
+
motif_names_filtered = np.delete(motif_names, act.filtered_motifs)
|
|
427
|
+
else:
|
|
428
|
+
motif_names_filtered = motif_names
|
|
429
|
+
i = group_names.index(group_a)
|
|
430
|
+
j = group_names.index(group_b)
|
|
431
|
+
variances_a = None
|
|
432
|
+
variances_b = None
|
|
433
|
+
for k, cov in enumerate(act.cov()):
|
|
434
|
+
if k == i:
|
|
435
|
+
variances_a = cov.diagonal()
|
|
436
|
+
elif k == j:
|
|
437
|
+
variances_b = cov.diagonal()
|
|
438
|
+
U = act.U
|
|
439
|
+
U_a = U[:, i]
|
|
440
|
+
U_b = U[:, j]
|
|
441
|
+
z_stat = (U_b - U_a) / (variances_a + variances_b) ** 0.5
|
|
442
|
+
pval = 2 * norm.sf(np.abs(z_stat))
|
|
443
|
+
fdr = multitest.multipletests(pval, alpha=0.05, method='fdr_by')[1]
|
|
444
|
+
data = np.array([z_stat, pval, fdr]).T
|
|
445
|
+
filename = os.path.join(output_folder, f'{group_a}_vs_{group_b}.tsv')
|
|
446
|
+
os.makedirs(output_folder, exist_ok=True)
|
|
447
|
+
DF(data, columns=['z_stat', 'pval', 'fdr'],
|
|
448
|
+
index=motif_names_filtered).to_csv(filename, sep='\t')
|
|
411
449
|
|
|
412
450
|
def export_loadings_product(project_name: str, output_folder: str,
|
|
413
451
|
use_hdf: bool = True, intercepts: bool = True,
|
|
@@ -18,6 +18,7 @@ from .synthetic_data import generate_dataset
|
|
|
18
18
|
from time import time
|
|
19
19
|
from dill import __version__ as dill_version
|
|
20
20
|
from .export import export_results, export_loadings_product, Standardization, ANOVAType
|
|
21
|
+
from .export import export_pairwise_test
|
|
21
22
|
from . import __version__ as project_version
|
|
22
23
|
from .select import select_motifs_single
|
|
23
24
|
import json
|
|
@@ -176,7 +177,7 @@ def _fit(name: str = Argument(..., help='Project name.'),
|
|
|
176
177
|
|
|
177
178
|
@app.command('gof', help='Estimate GOFs given test/train data split. Provides test info only if [orange]test-chromosomes[/orange] is not None in [cyan]fit[/cyan].')
|
|
178
179
|
def _gof(name: str = Argument(..., help='Project name.'),
|
|
179
|
-
use_groups: bool = Option(False, help='Compute statistic for
|
|
180
|
+
use_groups: bool = Option(False, help='Compute statistic for samples aggragated across groups.'),
|
|
180
181
|
stat_type: GOFStat = Option(GOFStat.fov, help='Statistic type to compute'),
|
|
181
182
|
stat_mode: GOFStatMode = Option(GOFStatMode.total, help='Whether to compute stats for residuals or accumulate their effects'),
|
|
182
183
|
gpu: bool = Option(False, help='Use GPU if available for most of computations.'),
|
|
@@ -349,6 +350,26 @@ def _estimate_promoter_variance(name: str = Argument(..., help='Project name'),
|
|
|
349
350
|
p.stop()
|
|
350
351
|
dt = time() - t0
|
|
351
352
|
rprint(f'[green][bold]✔️[/bold] Done![/green]\t time: {dt:.2f} s.')
|
|
353
|
+
|
|
354
|
+
@app.command('pairwise-difftest',
|
|
355
|
+
help='Perform pairwise differential test between 2 groups using posterior distribution of activities.'
|
|
356
|
+
' It computes difference in activities between group_b and group_a and performs a series of Z-tests for each motif.')
|
|
357
|
+
def _pairwise_difftest(name: str = Argument(..., help='Project name'),
|
|
358
|
+
group_a: str = Argument(...,
|
|
359
|
+
help='Name of the first group.'
|
|
360
|
+
),
|
|
361
|
+
group_b: str = Argument(...,
|
|
362
|
+
help='Name of the second group.'
|
|
363
|
+
),
|
|
364
|
+
output_folder: Path = Argument(..., help='Output folder.') ):
|
|
365
|
+
t0 = time()
|
|
366
|
+
p = Progress(SpinnerColumn(speed=0.5), TextColumn("[progress.description]{task.description}"), transient=True)
|
|
367
|
+
p.add_task(description="Performing and saving a pairwise test...", total=None)
|
|
368
|
+
p.start()
|
|
369
|
+
export_pairwise_test(name, output_folder, group_a, group_b)
|
|
370
|
+
p.stop()
|
|
371
|
+
dt = time() - t0
|
|
372
|
+
rprint(f'[green][bold]✔️[/bold] Done![/green]\t time: {dt:.2f} s.')
|
|
352
373
|
|
|
353
374
|
def main():
|
|
354
375
|
check_packages()
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: maradoner
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: Variance-adjusted estimation of motif activities.
|
|
5
5
|
Home-page: https://github.com/autosome-ru/maradoner
|
|
6
6
|
Author: Georgy Meshcheryakov
|
|
7
7
|
Author-email: iam@georgy.top
|
|
8
8
|
Classifier: Programming Language :: Python :: 3.11
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
11
9
|
Classifier: Topic :: Scientific/Engineering
|
|
12
10
|
Classifier: Operating System :: OS Independent
|
|
13
11
|
Requires-Python: >=3.11
|
|
@@ -27,8 +27,6 @@ setup(
|
|
|
27
27
|
url="https://github.com/autosome-ru/maradoner",
|
|
28
28
|
classifiers=[
|
|
29
29
|
"Programming Language :: Python :: 3.11",
|
|
30
|
-
"Programming Language :: Python :: 3.12",
|
|
31
|
-
"Programming Language :: Python :: 3.13",
|
|
32
30
|
"Topic :: Scientific/Engineering",
|
|
33
31
|
"Operating System :: OS Independent"]
|
|
34
32
|
|
|
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
|