in reply to Re^2: String character replacement based on position
in thread String character replacement based on position
... more than once per DNA sequence.
Maybe:
>perl -wMstrict -le "my $seq = 'atcgcgtacatcgatac'; my $rule = '01234567890123456'; my @uc_offsets = (0, 8, 15); ;; print qq{$rule}; print qq{$seq}; for my $offset (@uc_offsets) { substr($seq, $offset, 1) = uc substr $seq, $offset, 1; } print qq{$seq}; " 01234567890123456 atcgcgtacatcgatac AtcgcgtaCatcgatAc
Easy to put that into a function.
Update: Looking back, I see that BrowserUk essentially gave this solution already, so... Never mind.
|
|---|