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


Python Network.gene_list方法代码示例

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


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

示例1: read_output

# 需要导入模块: import Network [as 别名]
# 或者: from Network import gene_list [as 别名]
    def read_output(self,settings):
      # Code to write for collecting the output files from the algorithm, writes to the
      # output list in the object
      # What we want to do here is get the prediction rate on the last time
      # point and the network so we can compare it against a gold std.
      # This file is a bunch of zscores, so we have to load the cutoff we want
      output_file = open(self.output_dir + "/output/ranked_edges.txt", 'r')
      topn = None
      if "top_n_edges" in settings["genie3"].keys():
        topn = settings["genie3"]["top_n_edges"]
      else:
        topn = len(self.gene_list)
      zscores = []
      for line in output_file:
          gene1, gene2, zscore = line.split()
          zscore = float(zscore)
          zscores.append((gene1, gene2, zscore))
      zscores = sorted(zscores, key=lambda zscore: abs(zscore[2]), reverse=True)

      self.zscores = zscores[:]
      network = []

      #for i,zscore in enumerate(zscores):
          #if i < topn:
            #gene1, gene2, zscore = zscore
            #zscores[i] = (gene1, gene2, 1)
          #else:
            #gene1, gene2, zscore = zscore
            #zscores[i] = (gene1, gene2, 0)
      net = Network()
      net.read_networklist(zscores)
      net.gene_list = self.gene_list
      self.network = net

      return self.zscores
开发者ID:remtcs,项目名称:Network-Inference-Workspace,代码行数:37,代码来源:genie3.py

示例2: read_output

# 需要导入模块: import Network [as 别名]
# 或者: from Network import gene_list [as 别名]
    def read_output(self,settings):
        # Code to write for collecting the output files from the algorithm, writes to the
      # output list in the object
      # What we want to do here is get the prediction rate on the last time
      # point and the network so we can compare it against a gold std.
      # This file is a bunch of zscores, so we have to load the cutoff we want
      output_file = open(self.output_dir + "/output/mcz_output.txt", 'r')

      output_file = output_file.readlines()
      zscores = []
      for g1, line in enumerate(output_file[1:]):
          for g2, val in enumerate(line.split('\t')[1:]):
              zscores.append((self.gene_list[g2], self.gene_list[g1], float(line.split()[1:][g2])))
      topn = settings["mcz"]["top_n_edges"]
      #for line in output_file:
          #gene1, gene2, zscore = line.split()
          #zscore = float(zscore)
          #zscores.append((gene1, gene2, zscore))
      zscores = sorted(zscores, key=lambda zscore: abs(zscore[2]), reverse=True)

      self.zscores = zscores[:]
      network = []

      #for i,zscore in enumerate(zscores):
          #if i < topn:
            #gene1, gene2, zscore = zscore
            #if zscore > 0:
                #zscores[i] = (gene1, gene2, 1)
            #if zscore < 0:
                #zscores[i] = (gene1, gene2, -1)

          #else:
            #gene1, gene2, zscore = zscore
            #zscores[i] = (gene1, gene2, 0)
      net = Network()
      net.read_networklist(zscores)
      net.gene_list = self.gene_list
      self.network = net

      return self.network
开发者ID:remtcs,项目名称:Network-Inference-Workspace,代码行数:42,代码来源:mcz.py

示例3: JobManager

# 需要导入模块: import Network [as 别名]
# 或者: from Network import gene_list [as 别名]
cnlo_storage.normalize()
cnlo_no3_storage.normalize()
#all_storage.normalize()

ts_storage = [kno3_1, kno3_2, kno3_3, kno3_4]
#for s in ts_storage:
    #s.normalize()

# Setup job manager
jobman = JobManager(settings)


# Figure out list of dex targets and put them into a network so we can
# compare
net = Network()
net.gene_list = dex_storage.gene_list
target = sys.argv[1]

if target == "At1g25550":
    dex_storage = dex_storage2

for gene1 in dex_storage.gene_list:
    net.network[gene1] = {}
    for gene2 in dex_storage.gene_list:
        net.network[gene1][gene2] = 0
for gene in dex_storage.gene_list:
    print dex_storage.experiments[0].ratios[gene]
    if dex_storage.experiments[0].ratios[gene] >= 2.0:
        print dex_storage.experiments[0].ratios[gene]
        net.network[target][gene] = 1
    elif dex_storage.experiments[0].ratios[gene] <= 0.5:
开发者ID:ylyhlh,项目名称:Network-Inference-Workspace,代码行数:33,代码来源:compare_to_dex.py


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