[Bioperl-l] Tool to mutate DNA sequence

Boris Steipe boris.steipe at utoronto.ca
Thu Feb 9 16:54:53 EST 2006


Golf, anyone?


#!/usr/bin/perl -nl
for(split//){push at a,$_}
END{
   while($n/@a<0.5) {
     $p=rand(@a);
     if($a[$p]=~/[A-Z]/){$a[$p]=lc((grep!/$a[$p]/,split//,"ACGT")[rand 
(3)]);
       $n++;
     }
   }
print @a;
}

(144, not counting \s and the # !line )

:-)


B.



>> Does anyone know of tool to mutate a DNA sequence by a specified
>> amount?
>> For instance, say I have a DNA sequence 1000 bases long, and I  
>> want to
>> simulate mutations to make it 75% (or 80%, etc) similar to the
>> original.
>>
>>
>> Ryan
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l



More information about the Bioperl-l mailing list