本文整理汇总了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')
示例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()
示例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)