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 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?