python编译器acanda_用python做生信分析

DNA互补序列

代码1:

dna_sequence_orange = "ACTGATCGATTACGTATAGTAGAATTCTATCATACATATATATCGATGCGTTCAT"

complement1 = dna_sequence_orange.replace("A","t")

complement2 = complement1.replace("T","a")

complement3 = complement2.replace("G","c")

complement4 = complement3.replace("C","g")

dna_sequence = complement4.upper()

print(dna_sequence_orange)

print(dna_sequence)

代码2:

dna_sequence_orange = "ACTGATCGATTACGTATAGTAGAATTCTATCATACATATATATCGATGCGTTCAT"

dna_sequence = list(dna_sequence_orange)

i = 0

lenth = len(dna_sequence)

A = "A"

T = "T"

C = "C"

G = "G"

for i in range(lenth):

if dna_sequence[i] == A:

dna_sequence[i] = "T"

elif dna_sequence[i] == T:

dna_sequence[i] = "A"

elif dna_sequence[i] == G:

dna_sequence[i] = "C"

elif dna_sequence[i] == C:

dna_sequence[i] = "G"

else:

print("The is something wrong in the sequence")

i = i + 1

print(dna_sequence_orange,''.join(dna_sequence),sep='\n')

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值