[BiO BB] random sequences

James Stroud jstroud at mbi.ucla.edu
Wed Mar 16 20:05:49 EST 2005

Python can do this with about 5 lines if you don't have a polynomial 
distribution and about 8 if you do. Download and install python and run this 
program (you will need to consult the manual to figure out how to run python 
programs--pretty easy though). Work through the "hello world" example to get 
started, then run the following program.

from random import choice

seq_len = 100
choices = ("A","T","G","C")

the_seq = ""
for abase in xrange(seq_len):
  the_seq += choice(choices)

print the_seq

If you have polynomial distributions, its a little more complicated


On Monday 14 March 2005 10:46 am, Seema Trivedi wrote:
> Dr. Boris Steipe,
> I will be highly obliged if you could kindly let me know if there are any
> softwares which I can use for generation of random sequences of
> nucleotides. I need to do this with large sequences. Thank you
> Sorry for the trouble,
> seema

James Stroud, Ph.D.
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

More information about the BBB mailing list