Elsa镇魂女孩 2019-07-01 23:31 采纳率: 62.5%
浏览 2428
已结题

python 如何将print的结果导入excel

如何将print(ppi.scorePPITreesP(proteinsA, proteinsB))的结果倒入excel表格???

import numpy as np
from matplotlib import pyplot as plt
from sklearn import manifold
import PPI as ppi

# Fanconia Anemia proteins files
# shall exist in the sub-folder ./PPIData. These files contain the corresponding protein sequences from Fanconia Anemia
proteinNames = ['FAAP24', 'FANCM', 'FANCC', 'FANCD2', 'FANCI', 'FANCL', 'FANCE', 'FANCG', 'FANCF', 'FANCB', 'FANCA', 'FAAP100', 'FAAP20']
n = len(proteinNames)
n = len(proteinNames)
distM = np.zeros([n, n])
distV = []

for i in range(0, n):
    nameA = proteinNames[i]
    proteinsA = ppi.getAllSequences(nameA)  # The Fanconi Anemia file: one file contain the same protein for different geneomes
    print(nameA, len(proteinsA))
    for j in range(0, n):
        nameB = proteinNames[j]
        proteinsB = ppi.getAllSequences(nameB)
        print(nameB, len(proteinsB))
        dist = 1 - ppi.scorePPITreesP(proteinsA, proteinsB)
        distV.append(dist)
        distM[i, j] = dist
        print(nameA, nameB, dist)
        print(ppi.scorePPITreesP(proteinsA, proteinsB))
print(distM)
print()

'''

'''

print(ppi.scorePPITreesP(proteinsA, proteinsB))的结果如下所示:


  • 写回答

2条回答 默认 最新

  • dabocaiqq 2019-07-02 09:14
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器