[Bioperl-l] How can I edit a sequence?
Yee Man Chan
ymc at paxil.stanford.edu
Sun Jun 1 09:05:36 EDT 2003
Cool, Heikki! I will use it when you release it. I think it will be
helpful for people who are writing SNP related programs. :)
Regards,
Yee Man
On 1 Jun 2003, Heikki Lehvaslaiho wrote:
> I could not resist coding the mutate function into SeqUtils.
>
> It's in the CVS.
>
> -Heikki
>
> On Sun, 2003-06-01 at 11:08, Heikki Lehvaslaiho wrote:
> > 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.
> >
> > -Heikki
> >
> > 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