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


Python Network.load_tsv_to_net方法代码示例

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


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

示例1: calc_treatment_ratios

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

  from clustergrammer import Network

  net = Network()

  net.load_tsv_to_net('treated_cell_12_1_2015/treated_cl_phospho.tsv')
开发者ID:MaayanLab,项目名称:cst_drug_treatment,代码行数:9,代码来源:load_latest_cst.py

示例2: main

# 需要导入模块: from clustergrammer import Network [as 别名]
# 或者: from clustergrammer.Network import load_tsv_to_net [as 别名]
def main( buff, inst_filename, mongo_address, viz_id):
  import numpy as np
  import flask
  from bson.objectid import ObjectId
  from pymongo import MongoClient
  from flask import request
  from clustergrammer import Network
  import StringIO

  client = MongoClient(mongo_address)
  db = client.clustergrammer

  viz_id = ObjectId(viz_id)
  found_viz = db.networks.find_one({'_id':viz_id})

  try:

    net = Network()
    net.load_tsv_to_net(buff)

    net.swap_nan_for_zero()

    views = ['N_row_sum', 'N_row_var']

    net.make_clust(dist_type='cosine', dendro=True, views=views, \
                   linkage_type='average')

    export_dat = {}
    export_dat['name'] = inst_filename
    export_dat['dat'] = net.export_net_json('dat')
    export_dat['source'] = 'user_upload'

    dat_id = db.network_data.insert(export_dat)

    update_viz = net.viz 
    update_dat = dat_id

  except:
    print('\n-----------------------')
    print('error in clustering')
    print('-----------------------\n')
    update_viz = 'error'
    update_dat = 'error'

  found_viz['viz'] = update_viz
  found_viz['dat'] = update_dat

  db.networks.update_one( {'_id':viz_id}, {'$set': found_viz} )

  client.close()


  
开发者ID:abdohlman,项目名称:clustergrammer,代码行数:52,代码来源:load_tsv_file.py

示例3: Network

# 需要导入模块: from clustergrammer import Network [as 别名]
# 或者: from clustergrammer.Network import load_tsv_to_net [as 别名]
import time
start_time = time.time()

# import network class from Network.py
from clustergrammer import Network

net = Network()

net.load_tsv_to_net('txt/example_tsv.txt')

net.make_filtered_views(dist_type='cos',views=['N_row_sum','pct_row_sum'])

net.write_json_to_file('viz', 'json/mult_view.json', 'indent')

# your code
elapsed_time = time.time() - start_time

print('\n\n\nelapsed time')
print(elapsed_time)
开发者ID:msyinmei,项目名称:clustergrammer.js,代码行数:21,代码来源:make_clustergram.py


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