计算氨基酸序列的平均

发布于 2025-01-28 07:47:32 字数 582 浏览 2 评论 0原文

我有此代码用于使用Biopython计算FastA格式的序列。我得到了lenghts。

NP_418305.1

349

np_418306.1

469

np_418308.1

236

但是,现在我想计算整个序列的平均值,就像我可以添加到研究中的相互关系的事实一样。获得一些建议会很棒。

from Bio import SeqIO

record_dict = seqio.to_dict(seqio.parse(“ aminoacids.txt”,“ fasta”))

in Record_dict.items():

print(键) [0],“ \ n”,len(key [1] .seq))

I have this code for calculating the length of sequences in fasta format using BioPython. I got the lenghts.

NP_418305.1

349

NP_418306.1

469

NP_418308.1

236

However, now I'd like to calcule the mean of the whole sequences, just like an intereting fact that I can add to my research. Will be great to get some advices.

from Bio import SeqIO

record_dict = SeqIO.to_dict(SeqIO.parse("aminoacids.txt", "fasta"))

for key in record_dict.items():

print(key[0],"\n ",len(key[1].seq))

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

于我来说 2025-02-04 07:47:32

我能够通过将每个序列的每个长度求和除以序列的总长度来获得总长度的平均值。

I was able to get the mean of total length by summing each length of every sequence and dividing by the total of sequences.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文