This particular task might be solved with gsub():

> foo <- DNAStringSet('ACTTA')
> gsub("^(..)(.)", "\\1G\\2", foo)
[1] "ACGTTA"

There is of course a more concise solution than the one given here.

On Mon, Jul 19, 2010 at 11:11 PM, Andrew Yee <[email protected]> wrote:
> Is there a way to use subseq() to insert nucleotides?
>
> Take for example foo:
>
> foo <- DNAStringSet('ACTTA')
>
> I'd like to insert e.g. a G between positions 2 and 3 so that foo looks like
> 'ACGTTA'  Is there a way to do this using subseq()?  Or is an alternative
> function recommended?
>
> Thanks,
> Andrew
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-sig-sequencing mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
>

_______________________________________________
Bioc-sig-sequencing mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

Reply via email to