Skip to content

Commit

Permalink
Merge pull request #37 from Avsecz/master
Browse files Browse the repository at this point in the history
Added `min_metacluster_size_frac`
  • Loading branch information
AvantiShri committed Feb 26, 2019
2 parents 03377ca + 44dda5a commit 2164657
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions modisco/tfmodisco_workflow/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def __init__(self,
histogram_bins=100, percentiles_in_bandwidth=10,
overlap_portion=0.5,
min_metacluster_size=100,
min_metacluster_size_frac=0.01,
weak_threshold_for_counting_sign=0.8,
max_seqlets_per_metacluster=20000,
target_seqlet_fdr=0.2,
Expand All @@ -163,6 +164,7 @@ def __init__(self,
self.percentiles_in_bandwidth = percentiles_in_bandwidth
self.overlap_portion = overlap_portion
self.min_metacluster_size = min_metacluster_size
self.min_metacluster_size_frac = min_metacluster_size_frac
self.target_seqlet_fdr = target_seqlet_fdr
self.weak_threshold_for_counting_sign =\
weak_threshold_for_counting_sign
Expand Down Expand Up @@ -234,6 +236,14 @@ def __call__(self, task_names, contrib_scores,
print("WARNING: you found relatively few seqlets."
+" Consider dropping target_seqlet_fdr")


if int(self.min_metacluster_size_frac * len(seqlets)) > self.min_metacluster_size:
print("min_metacluster_size_frac * len(seqlets) = {0} is more than min_metacluster_size={1}.".\
format(int(self.min_metacluster_size_frac * len(seqlets)), self.min_metacluster_size))
print("Using it as a new min_metacluster_size")
self.min_metacluster_size = int(self.min_metacluster_size_frac * len(seqlets))


if (self.weak_threshold_for_counting_sign is None):
weak_threshold_for_counting_sign = weakest_transformed_thresh
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
description='TF MOtif Discovery from Importance SCOres',
long_description="""Algorithm for discovering consolidated patterns from base-pair-level importance scores""",
url='https://github.com/kundajelab/tfmodisco',
version='0.5.0.0',
version='0.5.0.1',
packages=find_packages(),
package_data={
'': ['cluster/phenograph/louvain/*convert*', 'cluster/phenograph/louvain/*community*', 'cluster/phenograph/louvain/*hierarchy*']
Expand Down

0 comments on commit 2164657

Please sign in to comment.