Question: biological sequences random seq
0
gravatar for mahmud.rossi
4 weeks ago by
mahmud.rossi0 wrote:

I want to generate m derivatives of the parent sequence by mutating p% of the bases in the parent gene. The final m+1 derivative genes will then be stored in a fasta file.

This is my code:

mySeq="AATTCC"
random_sequence=''
for i in range(0,100):
     random_sequence+=random.choice(mySeq)
print(random_sequence)
print("l: The length of the parent sequence:",len(random_sequence))
print("frequence:", (random_sequence).count(random_sequence)/len(random_sequence))
nmute = 5
for i in range (nmute):
   print(" random_sequence after %p mute:" % nmute, random_sequence)
rna-seq • 126 views
ADD COMMENTlink modified 4 weeks ago by Mensur Dlakic6.9k • written 4 weeks ago by mahmud.rossi0
1

What is the problem? It is expected to explain where you get stuck and what you tried to solve the issue.

ADD REPLYlink written 4 weeks ago by ATpoint40k

It is showing error.

ADD REPLYlink written 4 weeks ago by mahmud.rossi0
0
gravatar for Mensur Dlakic
4 weeks ago by
Mensur Dlakic6.9k
USA
Mensur Dlakic6.9k wrote:

Not sure that random mutation is the best choice. There are programs that will mutate sequence probabilistically, which will save you time on coding and likely be more appropriate. See here for an example, but there are many others.

ADD COMMENTlink written 4 weeks ago by Mensur Dlakic6.9k

Thanks for your reply. Here the program is written in R. but I need the help by python.

ADD REPLYlink written 4 weeks ago by mahmud.rossi0

Not sure why that matters. Presumably you need the result and the tool should matter less. Still, I can do the search for you. Googling will probably yield additional results.

ADD REPLYlink modified 4 weeks ago • written 4 weeks ago by Mensur Dlakic6.9k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1948 users visited in the last hour