How to use the clustergrammer2.clustergrammer_fun.run_filter function in clustergrammer2

To help you get started, we’ve selected a few clustergrammer2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ismms-himc / clustergrammer2 / clustergrammer2 / clustergrammer_fun / make_views.py View on Github external
def N_rows(net, df, all_views, dist_type='cosine', rank_type='sum'):
  from copy import deepcopy
  from .__init__ import Network
  from . import calc_clust, run_filter

  keep_top = ['all', 500, 250, 100, 50, 20, 10]

  rows_sorted = run_filter.get_sorted_rows(df['mat'], rank_type)

  for inst_keep in keep_top:

    tmp_df = deepcopy(df)

    check_keep_num = inst_keep

    # convert 'all' to -1 to clean up checking mechanism
    if check_keep_num == 'all':
      check_keep_num = -1

    if check_keep_num < len(rows_sorted):

      tmp_net = deepcopy(Network())

      if inst_keep != 'all':