蛋白质接触图使用二元二维矩阵表示三维蛋白质结构的所有可能的氨基酸残基对之间的距离。
导入库
import pandas as pd import numpy as np from Bio import SeqIO import matplotlib.pyplot as plt import requests from sklearn.metrics import pairwise_distances %matplotlib inline
定义坐标提取函数
def get_ca_coords(pdb='1LUC', chain='A'): url = f'https://files.rcsb.org/download/{pdb}.pdb' r = requests.get(url) r.raise_for_status() lines = r.text.splitlines() out = [] for line