[Bioperl-l] How can I edit a sequence?

Heikki Lehvaslaiho heikki at tiscali.co.uk
Sun Jun 1 11:08:52 EDT 2003

Yee Man,

There is nothing that would do inplace edit of the basic sequence
object for you. There are Bio::LiveSeq sequence classes but they are
definitely an overkill for this.

I suggest that you put the sequence into a string variable, do the
modifications and put it back into the sequence object.

More object oriented alternatives:

1. Add a method mutate() into Bio::SeqUtils using substr arguments.
2. Use Bio::LiveSeq::Mutation to describe your changes

# $seq->isa('Bio::PrimarySeq');
# $mutation->isa('Bio::LiveSeq::Mutation');
Bio::SeqUtils->mutate($seq, $mutation);

If you do not feel like writing it, I think I will at some point.
Let me know.


On Fri, 2003-05-30 at 21:10, Yee Man Chan wrote:
> Hi,
> 	I want to change some residues in my Seq object. How can I do
> that? I looked at this page:
> http://doc.bioperl.org/releases/bioperl-1.2/Bio/Seq.html
> but I still haven't figured out how to do that. For normal strings, I can
> do
> substr($str, $index, 1, "r");
> if I want to replace the character at $index by "r". Is there a similar
> function in Seq?
> Thanks
> Yee Man
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

      Heikki Lehväslaiho     -     heikki/at/bioperl.org

More information about the Bioperl-l mailing list