Skip to content

Commit

Permalink
consensus and io functions are moved to separate modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ozolotareva committed Oct 7, 2024
1 parent ed8be44 commit 8864dd9
Show file tree
Hide file tree
Showing 8 changed files with 756 additions and 671 deletions.
137 changes: 75 additions & 62 deletions notebooks/UnPaSt_examples.ipynb

Large diffs are not rendered by default.

25 changes: 14 additions & 11 deletions notebooks/consensus.ipynb

Large diffs are not rendered by default.

100 changes: 33 additions & 67 deletions notebooks/simulated_data.ipynb

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions unpast/run_unpast.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3
import argparse
import random
import numpy as np
import pandas as pd

Expand All @@ -23,7 +22,7 @@ def run(exprs_file: pd.DataFrame,
max_power: int = 10,
precluster: bool = True,
rpath: str ="", # for WGCNA
cluster_binary: bool = False,
#cluster_binary: bool = False,
merge: float = 1,
seed: int = 42,
verbose: bool = True,
Expand Down Expand Up @@ -185,7 +184,6 @@ def run(exprs_file: pd.DataFrame,
biclusters = make_biclusters(feature_clusters,
binarized_features,
exprs,
null_distribution,
method = bin_method,
merge = merge,
min_n_samples=min_n_samples,
Expand All @@ -195,7 +193,7 @@ def run(exprs_file: pd.DataFrame,
verbose = verbose)


from unpast.utils.method import write_bic_table
from unpast.utils.io import write_bic_table
suffix = ".seed="+str(seed)+".bin="+bin_method+",pval="+str(pval)+",clust="+clust_method+",direction="+"-".join(directions)
if "WGCNA" in clust_method:
suffix2 = ",ds="+str(ds)+",dch="+str(dch)+",max_power="+str(max_power)+",precluster="+str(precluster)
Expand All @@ -206,7 +204,6 @@ def run(exprs_file: pd.DataFrame,
write_bic_table(biclusters, out_dir+basename+suffix+suffix2+".biclusters.tsv",to_str=True,
add_metadata=True, seed = seed, min_n_samples = min_n_samples, pval = pval,
bin_method = bin_method, clust_method = clust_method, directions = directions,
#alpha=alpha, beta_K = beta_K,
similarity_cutoff = used_similarity_cutoffs,
m=modularity, ds = ds, dch = dch,
max_power=max_power, precluster=precluster,
Expand Down Expand Up @@ -273,4 +270,4 @@ def parse_args():
merge = args.merge,
seed = args.seed,
#plot_all = args.plot,
verbose = args.verbose)
verbose = args.verbose)
Loading

0 comments on commit 8864dd9

Please sign in to comment.