当前位置: 首页>>代码示例>>Python>>正文


Python Network.df_to_dat方法代码示例

本文整理汇总了Python中clustergrammer.Network.df_to_dat方法的典型用法代码示例。如果您正苦于以下问题:Python Network.df_to_dat方法的具体用法?Python Network.df_to_dat怎么用?Python Network.df_to_dat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在clustergrammer.Network的用法示例。


在下文中一共展示了Network.df_to_dat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_viz_json

# 需要导入模块: from clustergrammer import Network [as 别名]
# 或者: from clustergrammer.Network import df_to_dat [as 别名]
def make_viz_json(inst_df, name):
  from clustergrammer import Network
  net = Network()

  filename = 'json/'+name
  load_df = {}
  load_df['mat'] = inst_df
  net.df_to_dat(load_df)
  net.swap_nan_for_zero()
  net.make_clust(views=[])
  net.write_json_to_file('viz', filename, 'no-indent')
开发者ID:MaayanLab,项目名称:IDG_poster_2016,代码行数:13,代码来源:make_hgram_poster_image.py

示例2: process_GCT_and_export_tsv

# 需要导入模块: from clustergrammer import Network [as 别名]
# 或者: from clustergrammer.Network import df_to_dat [as 别名]
def process_GCT_and_export_tsv():
  from clustergrammer import Network

  filename = 'gcts/LDS-1003.gct'
  print('exporting processed GCT as tsv file')

  df = load_file(filename)

  net = Network()

  net.df_to_dat(df)
  net.swap_nan_for_zero()

  # zscore first to get the columns distributions to be similar
  net.normalize(axis='col', norm_type='zscore', keep_orig=True)

  # filter the rows to keep the perts with the largest normalizes values
  net.filter_N_top('row', 200)

  net.write_matrix_to_tsv('txt/example_gct_export.txt')
开发者ID:MaayanLab,项目名称:LINCS_GCT,代码行数:22,代码来源:old_load_gct.py

示例3: make_viz_from_df

# 需要导入模块: from clustergrammer import Network [as 别名]
# 或者: from clustergrammer.Network import df_to_dat [as 别名]
def make_viz_from_df(df, filename):
  from clustergrammer import Network

  net = Network()

  net.df_to_dat(df)
  net.swap_nan_for_zero()

  # zscore first to get the columns distributions to be similar
  net.normalize(axis='col', norm_type='zscore', keep_orig=True)

  # filter the rows to keep the perts with the largest normalizes values
  net.filter_N_top('row', 2000)

  num_coluns = net.dat['mat'].shape[1]

  if num_coluns < 50:
    # views = ['N_row_sum', 'N_row_var']
    views = ['N_row_sum']
    net.make_clust(dist_type='cos', views=views)

    filename = 'json/' + filename.split('/')[1].replace('.gct','') + '.json'

    net.write_json_to_file('viz', filename)
开发者ID:MaayanLab,项目名称:LINCS_GCT,代码行数:26,代码来源:old_load_gct.py


注:本文中的clustergrammer.Network.df_to_dat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。