序列成员的编号
我需要额外的 python 代码来对下面输出的左列进行编号,就像我在右列中所示的那样:这里的代码只是将序列分为 3 部分。 现在我想将它们从 1 编号到最后一个,就像我在右列中手动完成的那样。
cds = "atgagtgaacgtctgagcattaccccgctggggccgtatatcggcgcacaataa"
for i in range(0,len(cds),3):
print cds[i:i+3],
...
Atg 1
Agt 2
Gaa 3
Cgt 4
Ctg 5
Agc 6
Att 7
Acc 8
Ccg 9
Ctg 10
Ggg 11
Ccg 12
Tat 13
Atc 14
Ggc 15
Gca 16
Caa 17
Taa 18
Taa 19
I need additional python codes that will number the left column of the output below like I have shown in the right column: The codes here just divides the sequence into 3s.
Now I want to number them from 1 to the last as I have done manually in the right column.
cds = "atgagtgaacgtctgagcattaccccgctggggccgtatatcggcgcacaataa"
for i in range(0,len(cds),3):
print cds[i:i+3],
...
Atg 1
Agt 2
Gaa 3
Cgt 4
Ctg 5
Agc 6
Att 7
Acc 8
Ccg 9
Ctg 10
Ggg 11
Ccg 12
Tat 13
Atc 14
Ggc 15
Gca 16
Caa 17
Taa 18
Taa 19
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不确定这是否是您想要的,但是:
Not sure that this is what you want, but:
在这里您可以了解这种方式
Here you may read about this way