supriyoch_2008 has asked for the wisdom of the Perl Monks concerning the following question:
Hi PerlMonks,
I am interested to randomize a DNA string in such a way that the number and the composition of elements in the DNA string remian the same but only the positions of elements are changed. For instance, I have a DNA string like "AATTGGCC" i.e. each base (A,T,G,C) has two copies. I want to get all possible combinations like ATATGGCC,AATGTGCC,ATATGCGC..etc. I am at a fix to find all the possible combinations from the string in perl. I looked for online resouces but I could not find the solution. I welcome suggestions from perlmonks. I have written a script which goes as follows. I have not written the code for combinations.
#!/usr/bin/perl use warnings; my $dna="aattggcc"; $dna=uc$dna; print "\n dna: $dna\n"; # code for all possible combinations ? exit;
Results should look like:
All possible combinations are: ATATGGCC AATGTGCC ATATGCGC ........
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can one randomize a DNA string without changing the composition?
by QM (Parson) on Jan 16, 2015 at 10:46 UTC | |
by Anonymous Monk on Jan 16, 2015 at 11:36 UTC | |
by QM (Parson) on Jan 16, 2015 at 11:44 UTC | |
|
Re: How can one randomize a DNA string without changing the composition?
by Anonymous Monk on Jan 16, 2015 at 02:32 UTC | |
by Anonymous Monk on Jan 16, 2015 at 02:39 UTC | |
|
Re: How can one randomize a DNA string without changing the composition?
by karlgoethebier (Abbot) on Jan 16, 2015 at 10:35 UTC |