Add sequence feature

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Add sequence feature

jsun529
Does anyone knows how to open a genbank file, add new feature and then save
a new genbank
file with new feature added in bioperl ?

thx

--
Jessica Jingping Sun
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

Re: Add sequence feature

Roy Chaudhuri-3
Hi Jessica.

You need to use Bio::SeqIO to read in the GenBank file to a BioPerl
sequence object, and to write your new GenBank file:
http://www.bioperl.org/wiki/HOWTO:SeqIO

To add a new feature follow the instructions here:
http://www.bioperl.org/wiki/HOWTO:Feature-Annotation#Building_Your_Own_Sequences

(except that you are adding the feature to the sequence object you got
from the Genbank file, not a new Bio::Seq object).

Cheers.
Roy.

On 13/08/2010 16:06, Jessica Sun wrote:
> Does anyone knows how to open a genbank file, add new feature and then save
> a new genbank
> file with new feature added in bioperl ?
>
> thx
>

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

Re: Add sequence feature

jsun529
unfortunately. I want to add the feature to the sequence object I got from
the Genbank file, I do not mind to save a new genbank file but these new
genbank file contains the original genbank format and info I got plus the
new feature tags I need to added to. Any quick solution to this?

thx

Jessica



On Fri, Aug 13, 2010 at 11:21 AM, Roy Chaudhuri <[hidden email]>wrote:

> Hi Jessica.
>
> You need to use Bio::SeqIO to read in the GenBank file to a BioPerl
> sequence object, and to write your new GenBank file:
> http://www.bioperl.org/wiki/HOWTO:SeqIO
>
> To add a new feature follow the instructions here:
>
> http://www.bioperl.org/wiki/HOWTO:Feature-Annotation#Building_Your_Own_Sequences
>
> (except that you are adding the feature to the sequence object you got from
> the Genbank file, not a new Bio::Seq object).
>
> Cheers.
> Roy.
>
>
> On 13/08/2010 16:06, Jessica Sun wrote:
>
>> Does anyone knows how to open a genbank file, add new feature and then
>> save
>> a new genbank
>> file with new feature added in bioperl ?
>>
>> thx
>>
>>
>


--
Jessica Jingping Sun
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

Re: Add sequence feature

Roy Chaudhuri-3
I'm not sure I understand, do you mean that you want to load just the
sequence from the GenBank file (ignoring the existing annotation), then
add your own features? There are instructions on how to do that here:
http://www.bioperl.org/wiki/HOWTO:SeqIO#Speed.2C_Bio::Seq::SeqBuilder

On 13/08/2010 16:27, Jessica Sun wrote:

> unfortunately. I want to add the feature to the sequence object I got
> from the Genbank file, I do not mind to save a new genbank file but
> these new genbank file contains the original genbank format and info I
> got plus the new feature tags I need to added to. Any quick solution to
> this?
>
> thx
>
> Jessica
>
>
>
> On Fri, Aug 13, 2010 at 11:21 AM, Roy Chaudhuri <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi Jessica.
>
>     You need to use Bio::SeqIO to read in the GenBank file to a BioPerl
>     sequence object, and to write your new GenBank file:
>     http://www.bioperl.org/wiki/HOWTO:SeqIO
>
>     To add a new feature follow the instructions here:
>     http://www.bioperl.org/wiki/HOWTO:Feature-Annotation#Building_Your_Own_Sequences
>
>     (except that you are adding the feature to the sequence object you
>     got from the Genbank file, not a new Bio::Seq object).
>
>     Cheers.
>     Roy.
>
>
>     On 13/08/2010 16:06, Jessica Sun wrote:
>
>         Does anyone knows how to open a genbank file, add new feature
>         and then save
>         a new genbank
>         file with new feature added in bioperl ?
>
>         thx
>
>
>
>
>
> --
> Jessica Jingping Sun

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

Re: Add sequence feature

Roy Chaudhuri-3
Please remember to copy replies to the mailing list.

You can loop over the features in your Bio::Seq object:
for my $feat ($seq->get_SeqFeatures) { # do something }

And once you have found the feature you want to modify, you can add a
tag using something like:
$feat->add_tag_value('note',"this is a note");

When you're finished you can write out the modified sequence object to a
new GenBank file.

On 13/08/2010 16:40, Jessica Sun wrote:

> no i want to load the genbank file with existing features and I need to
> add some new feature tags to the existing ones and then save to a new
> update genbank file for local usage. I just not quite good on how to
> easily merge the two steps you recommended into one in a neat way.
>
> thx
>
>
> On Fri, Aug 13, 2010 at 11:37 AM, Roy Chaudhuri <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     I'm not sure I understand, do you mean that you want to load just
>     the sequence from the GenBank file (ignoring the existing
>     annotation), then add your own features? There are instructions on
>     how to do that here:
>     http://www.bioperl.org/wiki/HOWTO:SeqIO#Speed.2C_Bio::Seq::SeqBuilder
>
>
>     On 13/08/2010 16:27, Jessica Sun wrote:
>
>         unfortunately. I want to add the feature to the sequence object
>         I got
>         from the Genbank file, I do not mind to save a new genbank file but
>         these new genbank file contains the original genbank format and
>         info I
>         got plus the new feature tags I need to added to. Any quick
>         solution to
>         this?
>
>         thx
>
>         Jessica
>
>
>
>         On Fri, Aug 13, 2010 at 11:21 AM, Roy Chaudhuri
>         <[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>> wrote:
>
>             Hi Jessica.
>
>             You need to use Bio::SeqIO to read in the GenBank file to a
>         BioPerl
>             sequence object, and to write your new GenBank file:
>         http://www.bioperl.org/wiki/HOWTO:SeqIO
>
>             To add a new feature follow the instructions here:
>         http://www.bioperl.org/wiki/HOWTO:Feature-Annotation#Building_Your_Own_Sequences
>
>             (except that you are adding the feature to the sequence
>         object you
>             got from the Genbank file, not a new Bio::Seq object).
>
>             Cheers.
>             Roy.
>
>
>             On 13/08/2010 16:06, Jessica Sun wrote:
>
>                 Does anyone knows how to open a genbank file, add new
>         feature
>                 and then save
>                 a new genbank
>                 file with new feature added in bioperl ?
>
>                 thx
>
>
>
>
>
>         --
>         Jessica Jingping Sun
>
>
>
>
>
> --
> Jessica Jingping Sun

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

Re: Add sequence feature

jsun529
Thanks. I somehow get these error messages.

--------------------- WARNING ---------------------
MSG:  Bio::SeqIO::genbank=HASH(0xa7ba1c) is not a SeqI compliant module.
Attempting to dump, but may fail!
---------------------------------------------------
Can't locate object method "seq" via package "Bio::SeqIO::genbank" at
/Library/Perl/5.8.8/Bio/SeqIO/genbank.pm line 760, <GEN0> line 447.

by doing this,

my $feat = new Bio::SeqFeature::Generic(-start                 =>20,
                                        -end         => $40,
                                        -primary_tag => 'newfeature' );
                                    $feat->add_tag_value("note","this is
notes");
  $f->add_SeqFeature($feat); ## f is original feature pointer
$io = Bio::SeqIO->new(-format => "genbank", -file => ">$newoutfile" );

    $io->write_seq($seqio_object);

On Fri, Aug 13, 2010 at 11:57 AM, Roy Chaudhuri <[hidden email]>wrote:

> Please remember to copy replies to the mailing list.
>
> You can loop over the features in your Bio::Seq object:
> for my $feat ($seq->get_SeqFeatures) { # do something }
>
> And once you have found the feature you want to modify, you can add a tag
> using something like:
> $feat->add_tag_value('note',"this is a note");
>
> When you're finished you can write out the modified sequence object to a
> new GenBank file.
>
>
> On 13/08/2010 16:40, Jessica Sun wrote:
>
>> no i want to load the genbank file with existing features and I need to
>> add some new feature tags to the existing ones and then save to a new
>> update genbank file for local usage. I just not quite good on how to
>> easily merge the two steps you recommended into one in a neat way.
>>
>> thx
>>
>>
>> On Fri, Aug 13, 2010 at 11:37 AM, Roy Chaudhuri <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>    I'm not sure I understand, do you mean that you want to load just
>>    the sequence from the GenBank file (ignoring the existing
>>    annotation), then add your own features? There are instructions on
>>    how to do that here:
>>    http://www.bioperl.org/wiki/HOWTO:SeqIO#Speed.2C_Bio::Seq::SeqBuilder
>>
>>
>>    On 13/08/2010 16:27, Jessica Sun wrote:
>>
>>        unfortunately. I want to add the feature to the sequence object
>>        I got
>>        from the Genbank file, I do not mind to save a new genbank file but
>>        these new genbank file contains the original genbank format and
>>        info I
>>        got plus the new feature tags I need to added to. Any quick
>>        solution to
>>        this?
>>
>>        thx
>>
>>        Jessica
>>
>>
>>
>>        On Fri, Aug 13, 2010 at 11:21 AM, Roy Chaudhuri
>>        <[hidden email] <mailto:[hidden email]>
>>        <mailto:[hidden email]
>>        <mailto:[hidden email]>>> wrote:
>>
>>            Hi Jessica.
>>
>>            You need to use Bio::SeqIO to read in the GenBank file to a
>>        BioPerl
>>            sequence object, and to write your new GenBank file:
>>        http://www.bioperl.org/wiki/HOWTO:SeqIO
>>
>>            To add a new feature follow the instructions here:
>>
>> http://www.bioperl.org/wiki/HOWTO:Feature-Annotation#Building_Your_Own_Sequences
>>
>>            (except that you are adding the feature to the sequence
>>        object you
>>            got from the Genbank file, not a new Bio::Seq object).
>>
>>            Cheers.
>>            Roy.
>>
>>
>>            On 13/08/2010 16:06, Jessica Sun wrote:
>>
>>                Does anyone knows how to open a genbank file, add new
>>        feature
>>                and then save
>>                a new genbank
>>                file with new feature added in bioperl ?
>>
>>                thx
>>
>>
>>
>>
>>
>>        --
>>        Jessica Jingping Sun
>>
>>
>>
>>
>>
>> --
>> Jessica Jingping Sun
>>
>
>


--
Jessica Jingping Sun
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

Re: Add sequence feature

Cook, Malcolm-2
Jessica,

Show more code!

In particular, where did $f get set?

--Malcolm

 

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jessica Sun
Sent: Friday, August 13, 2010 12:07 PM
To: Roy Chaudhuri
Cc: [hidden email]
Subject: Re: [Bioperl-l] Add sequence feature

Thanks. I somehow get these error messages.

--------------------- WARNING ---------------------
MSG:  Bio::SeqIO::genbank=HASH(0xa7ba1c) is not a SeqI compliant module.
Attempting to dump, but may fail!
---------------------------------------------------
Can't locate object method "seq" via package "Bio::SeqIO::genbank" at /Library/Perl/5.8.8/Bio/SeqIO/genbank.pm line 760, <GEN0> line 447.

by doing this,

my $feat = new Bio::SeqFeature::Generic(-start                 =>20,
                                        -end         => $40,
                                        -primary_tag => 'newfeature' );
                                    $feat->add_tag_value("note","this is notes");
  $f->add_SeqFeature($feat); ## f is original feature pointer $io = Bio::SeqIO->new(-format => "genbank", -file => ">$newoutfile" );

    $io->write_seq($seqio_object);

On Fri, Aug 13, 2010 at 11:57 AM, Roy Chaudhuri <[hidden email]>wrote:

> Please remember to copy replies to the mailing list.
>
> You can loop over the features in your Bio::Seq object:
> for my $feat ($seq->get_SeqFeatures) { # do something }
>
> And once you have found the feature you want to modify, you can add a
> tag using something like:
> $feat->add_tag_value('note',"this is a note");
>
> When you're finished you can write out the modified sequence object to
> a new GenBank file.
>
>
> On 13/08/2010 16:40, Jessica Sun wrote:
>
>> no i want to load the genbank file with existing features and I need
>> to add some new feature tags to the existing ones and then save to a
>> new update genbank file for local usage. I just not quite good on how
>> to easily merge the two steps you recommended into one in a neat way.
>>
>> thx
>>
>>
>> On Fri, Aug 13, 2010 at 11:37 AM, Roy Chaudhuri
>> <[hidden email] <mailto:[hidden email]>> wrote:
>>
>>    I'm not sure I understand, do you mean that you want to load just
>>    the sequence from the GenBank file (ignoring the existing
>>    annotation), then add your own features? There are instructions on
>>    how to do that here:
>>    
>> http://www.bioperl.org/wiki/HOWTO:SeqIO#Speed.2C_Bio::Seq::SeqBuilder
>>
>>
>>    On 13/08/2010 16:27, Jessica Sun wrote:
>>
>>        unfortunately. I want to add the feature to the sequence object
>>        I got
>>        from the Genbank file, I do not mind to save a new genbank file but
>>        these new genbank file contains the original genbank format and
>>        info I
>>        got plus the new feature tags I need to added to. Any quick
>>        solution to
>>        this?
>>
>>        thx
>>
>>        Jessica
>>
>>
>>
>>        On Fri, Aug 13, 2010 at 11:21 AM, Roy Chaudhuri
>>        <[hidden email] <mailto:[hidden email]>
>>        <mailto:[hidden email]
>>        <mailto:[hidden email]>>> wrote:
>>
>>            Hi Jessica.
>>
>>            You need to use Bio::SeqIO to read in the GenBank file to a
>>        BioPerl
>>            sequence object, and to write your new GenBank file:
>>        http://www.bioperl.org/wiki/HOWTO:SeqIO
>>
>>            To add a new feature follow the instructions here:
>>
>> http://www.bioperl.org/wiki/HOWTO:Feature-Annotation#Building_Your_Ow
>> n_Sequences
>>
>>            (except that you are adding the feature to the sequence
>>        object you
>>            got from the Genbank file, not a new Bio::Seq object).
>>
>>            Cheers.
>>            Roy.
>>
>>
>>            On 13/08/2010 16:06, Jessica Sun wrote:
>>
>>                Does anyone knows how to open a genbank file, add new
>>        feature
>>                and then save
>>                a new genbank
>>                file with new feature added in bioperl ?
>>
>>                thx
>>
>>
>>
>>
>>
>>        --
>>        Jessica Jingping Sun
>>
>>
>>
>>
>>
>> --
>> Jessica Jingping Sun
>>
>
>


--
Jessica Jingping Sun
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

Re: Add sequence feature

Mike Williams-18
In reply to this post by jsun529
On Fri, Aug 13, 2010 at 1:06 PM, Jessica Sun <[hidden email]> wrote:

> Thanks. I somehow get these error messages.
> by doing this,
>
> my $feat = new Bio::SeqFeature::Generic(-start                 =>20,
>                                        -end         => $40,
>                                        -primary_tag => 'newfeature' );
>                                     $feat->add_tag_value("note","this is
> notes");
>

That $40 looks fishy.  Try deleting the dollar sign.  You did mean just 40,
right?

Mike
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

Re: Add sequence feature

Kevin Brown-8
In reply to this post by jsun529
If I'm reading your sample code correctly, then you are mistakenly
trying to output the input SeqIO object and not the actual Bio::Seq
object that was read in by SeqIO.

My $seqio = Bio::SeqIO->new;
My $seq = $seqio->next_seq;

#manipulate $seq

My $out = Bio::SeqIO->new;
$out->write_seq($seq);

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Jessica Sun
Sent: Friday, August 13, 2010 10:07 AM
To: Roy Chaudhuri
Cc: [hidden email]
Subject: Re: [Bioperl-l] Add sequence feature

Thanks. I somehow get these error messages.

--------------------- WARNING ---------------------
MSG:  Bio::SeqIO::genbank=HASH(0xa7ba1c) is not a SeqI compliant module.
Attempting to dump, but may fail!
---------------------------------------------------
Can't locate object method "seq" via package "Bio::SeqIO::genbank" at
/Library/Perl/5.8.8/Bio/SeqIO/genbank.pm line 760, <GEN0> line 447.

by doing this,

my $feat = new Bio::SeqFeature::Generic(-start                 =>20,
                                        -end         => $40,
                                        -primary_tag => 'newfeature' );
                                    $feat->add_tag_value("note","this is
notes");
  $f->add_SeqFeature($feat); ## f is original feature pointer
$io = Bio::SeqIO->new(-format => "genbank", -file => ">$newoutfile" );

    $io->write_seq($seqio_object);

On Fri, Aug 13, 2010 at 11:57 AM, Roy Chaudhuri
<[hidden email]>wrote:

> Please remember to copy replies to the mailing list.
>
> You can loop over the features in your Bio::Seq object:
> for my $feat ($seq->get_SeqFeatures) { # do something }
>
> And once you have found the feature you want to modify, you can add a
tag
> using something like:
> $feat->add_tag_value('note',"this is a note");
>
> When you're finished you can write out the modified sequence object to
a
> new GenBank file.
>
>
> On 13/08/2010 16:40, Jessica Sun wrote:
>
>> no i want to load the genbank file with existing features and I need
to
>> add some new feature tags to the existing ones and then save to a new
>> update genbank file for local usage. I just not quite good on how to
>> easily merge the two steps you recommended into one in a neat way.
>>
>> thx
>>
>>
>> On Fri, Aug 13, 2010 at 11:37 AM, Roy Chaudhuri
<[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>    I'm not sure I understand, do you mean that you want to load just
>>    the sequence from the GenBank file (ignoring the existing
>>    annotation), then add your own features? There are instructions on
>>    how to do that here:
>>
http://www.bioperl.org/wiki/HOWTO:SeqIO#Speed.2C_Bio::Seq::SeqBuilder
>>
>>
>>    On 13/08/2010 16:27, Jessica Sun wrote:
>>
>>        unfortunately. I want to add the feature to the sequence
object
>>        I got
>>        from the Genbank file, I do not mind to save a new genbank
file but
>>        these new genbank file contains the original genbank format
and

>>        info I
>>        got plus the new feature tags I need to added to. Any quick
>>        solution to
>>        this?
>>
>>        thx
>>
>>        Jessica
>>
>>
>>
>>        On Fri, Aug 13, 2010 at 11:21 AM, Roy Chaudhuri
>>        <[hidden email] <mailto:[hidden email]>
>>        <mailto:[hidden email]
>>        <mailto:[hidden email]>>> wrote:
>>
>>            Hi Jessica.
>>
>>            You need to use Bio::SeqIO to read in the GenBank file to
a
>>        BioPerl
>>            sequence object, and to write your new GenBank file:
>>        http://www.bioperl.org/wiki/HOWTO:SeqIO
>>
>>            To add a new feature follow the instructions here:
>>
>>
http://www.bioperl.org/wiki/HOWTO:Feature-Annotation#Building_Your_Own_S
equences

>>
>>            (except that you are adding the feature to the sequence
>>        object you
>>            got from the Genbank file, not a new Bio::Seq object).
>>
>>            Cheers.
>>            Roy.
>>
>>
>>            On 13/08/2010 16:06, Jessica Sun wrote:
>>
>>                Does anyone knows how to open a genbank file, add new
>>        feature
>>                and then save
>>                a new genbank
>>                file with new feature added in bioperl ?
>>
>>                thx
>>
>>
>>
>>
>>
>>        --
>>        Jessica Jingping Sun
>>
>>
>>
>>
>>
>> --
>> Jessica Jingping Sun
>>
>
>


--
Jessica Jingping Sun
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

Fwd: Add sequence feature

jsun529
---------- Forwarded message ----------
From: Jessica Sun <[hidden email]>
Date: Fri, Aug 13, 2010 at 3:16 PM
Subject: Re: [Bioperl-l] Add sequence feature
To: Kevin Brown <[hidden email]>


yes, I change that, somehow it still did not take the added features in.


On Fri, Aug 13, 2010 at 1:53 PM, Kevin Brown <[hidden email]> wrote:

> If I'm reading your sample code correctly, then you are mistakenly
> trying to output the input SeqIO object and not the actual Bio::Seq
> object that was read in by SeqIO.
>
> My $seqio = Bio::SeqIO->new;
> My $seq = $seqio->next_seq;
>
> #manipulate $seq
>
> My $out = Bio::SeqIO->new;
> $out->write_seq($seq);
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Jessica Sun
> Sent: Friday, August 13, 2010 10:07 AM
> To: Roy Chaudhuri
> Cc: [hidden email]
> Subject: Re: [Bioperl-l] Add sequence feature
>
> Thanks. I somehow get these error messages.
>
> --------------------- WARNING ---------------------
> MSG:  Bio::SeqIO::genbank=HASH(0xa7ba1c) is not a SeqI compliant module.
> Attempting to dump, but may fail!
> ---------------------------------------------------
> Can't locate object method "seq" via package "Bio::SeqIO::genbank" at
> /Library/Perl/5.8.8/Bio/SeqIO/genbank.pm line 760, <GEN0> line 447.
>
> by doing this,
>
> my $feat = new Bio::SeqFeature::Generic(-start                 =>20,
>                                        -end         => $40,
>                                        -primary_tag => 'newfeature' );
>                                    $feat->add_tag_value("note","this is
> notes");
>  $f->add_SeqFeature($feat); ## f is original feature pointer
> $io = Bio::SeqIO->new(-format => "genbank", -file => ">$newoutfile" );
>
>    $io->write_seq($seqio_object);
>
> On Fri, Aug 13, 2010 at 11:57 AM, Roy Chaudhuri
> <[hidden email]>wrote:
>
> > Please remember to copy replies to the mailing list.
> >
> > You can loop over the features in your Bio::Seq object:
> > for my $feat ($seq->get_SeqFeatures) { # do something }
> >
> > And once you have found the feature you want to modify, you can add a
> tag
> > using something like:
> > $feat->add_tag_value('note',"this is a note");
> >
> > When you're finished you can write out the modified sequence object to
> a
> > new GenBank file.
> >
> >
> > On 13/08/2010 16:40, Jessica Sun wrote:
> >
> >> no i want to load the genbank file with existing features and I need
> to
> >> add some new feature tags to the existing ones and then save to a new
> >> update genbank file for local usage. I just not quite good on how to
> >> easily merge the two steps you recommended into one in a neat way.
> >>
> >> thx
> >>
> >>
> >> On Fri, Aug 13, 2010 at 11:37 AM, Roy Chaudhuri
> <[hidden email]
> >> <mailto:[hidden email]>> wrote:
> >>
> >>    I'm not sure I understand, do you mean that you want to load just
> >>    the sequence from the GenBank file (ignoring the existing
> >>    annotation), then add your own features? There are instructions on
> >>    how to do that here:
> >>
> http://www.bioperl.org/wiki/HOWTO:SeqIO#Speed.2C_Bio::Seq::SeqBuilder
> >>
> >>
> >>    On 13/08/2010 16:27, Jessica Sun wrote:
> >>
> >>        unfortunately. I want to add the feature to the sequence
> object
> >>        I got
> >>        from the Genbank file, I do not mind to save a new genbank
> file but
> >>        these new genbank file contains the original genbank format
> and
> >>        info I
> >>        got plus the new feature tags I need to added to. Any quick
> >>        solution to
> >>        this?
> >>
> >>        thx
> >>
> >>        Jessica
> >>
> >>
> >>
> >>        On Fri, Aug 13, 2010 at 11:21 AM, Roy Chaudhuri
> >>        <[hidden email] <mailto:[hidden email]>
> >>        <mailto:[hidden email]
> >>        <mailto:[hidden email]>>> wrote:
> >>
> >>            Hi Jessica.
> >>
> >>            You need to use Bio::SeqIO to read in the GenBank file to
> a
> >>        BioPerl
> >>            sequence object, and to write your new GenBank file:
> >>        http://www.bioperl.org/wiki/HOWTO:SeqIO
> >>
> >>            To add a new feature follow the instructions here:
> >>
> >>
> http://www.bioperl.org/wiki/HOWTO:Feature-Annotation#Building_Your_Own_S
> equences
> >>
> >>            (except that you are adding the feature to the sequence
> >>        object you
> >>            got from the Genbank file, not a new Bio::Seq object).
> >>
> >>            Cheers.
> >>            Roy.
> >>
> >>
> >>            On 13/08/2010 16:06, Jessica Sun wrote:
> >>
> >>                Does anyone knows how to open a genbank file, add new
> >>        feature
> >>                and then save
> >>                a new genbank
> >>                file with new feature added in bioperl ?
> >>
> >>                thx
> >>
> >>
> >>
> >>
> >>
> >>        --
> >>        Jessica Jingping Sun
> >>
> >>
> >>
> >>
> >>
> >> --
> >> Jessica Jingping Sun
> >>
> >
> >
>
>
> --
> Jessica Jingping Sun
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>



--
Jessica Jingping Sun



--
Jessica Jingping Sun
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Add sequence feature

Cook, Malcolm-2
if you want to show all your code we might not have to guess at what the problem is.....
 


Malcolm Cook
Stowers Institute for Medical Research -  Bioinformatics
Kansas City, Missouri  USA
 

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jessica Sun
Sent: Friday, August 13, 2010 2:17 PM
To: [hidden email]
Subject: [Bioperl-l] Fwd: Add sequence feature

---------- Forwarded message ----------
From: Jessica Sun <[hidden email]>
Date: Fri, Aug 13, 2010 at 3:16 PM
Subject: Re: [Bioperl-l] Add sequence feature
To: Kevin Brown <[hidden email]>


yes, I change that, somehow it still did not take the added features in.


On Fri, Aug 13, 2010 at 1:53 PM, Kevin Brown <[hidden email]> wrote:

> If I'm reading your sample code correctly, then you are mistakenly
> trying to output the input SeqIO object and not the actual Bio::Seq
> object that was read in by SeqIO.
>
> My $seqio = Bio::SeqIO->new;
> My $seq = $seqio->next_seq;
>
> #manipulate $seq
>
> My $out = Bio::SeqIO->new;
> $out->write_seq($seq);
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Jessica Sun
> Sent: Friday, August 13, 2010 10:07 AM
> To: Roy Chaudhuri
> Cc: [hidden email]
> Subject: Re: [Bioperl-l] Add sequence feature
>
> Thanks. I somehow get these error messages.
>
> --------------------- WARNING ---------------------
> MSG:  Bio::SeqIO::genbank=HASH(0xa7ba1c) is not a SeqI compliant module.
> Attempting to dump, but may fail!
> ---------------------------------------------------
> Can't locate object method "seq" via package "Bio::SeqIO::genbank" at
> /Library/Perl/5.8.8/Bio/SeqIO/genbank.pm line 760, <GEN0> line 447.
>
> by doing this,
>
> my $feat = new Bio::SeqFeature::Generic(-start                 =>20,
>                                        -end         => $40,
>                                        -primary_tag => 'newfeature' );
>                                    $feat->add_tag_value("note","this
> is notes");  $f->add_SeqFeature($feat); ## f is original feature
> pointer $io = Bio::SeqIO->new(-format => "genbank", -file =>
> ">$newoutfile" );
>
>    $io->write_seq($seqio_object);
>
> On Fri, Aug 13, 2010 at 11:57 AM, Roy Chaudhuri
> <[hidden email]>wrote:
>
> > Please remember to copy replies to the mailing list.
> >
> > You can loop over the features in your Bio::Seq object:
> > for my $feat ($seq->get_SeqFeatures) { # do something }
> >
> > And once you have found the feature you want to modify, you can add
> > a
> tag
> > using something like:
> > $feat->add_tag_value('note',"this is a note");
> >
> > When you're finished you can write out the modified sequence object
> > to
> a
> > new GenBank file.
> >
> >
> > On 13/08/2010 16:40, Jessica Sun wrote:
> >
> >> no i want to load the genbank file with existing features and I
> >> need
> to
> >> add some new feature tags to the existing ones and then save to a
> >> new update genbank file for local usage. I just not quite good on
> >> how to easily merge the two steps you recommended into one in a neat way.
> >>
> >> thx
> >>
> >>
> >> On Fri, Aug 13, 2010 at 11:37 AM, Roy Chaudhuri
> <[hidden email]
> >> <mailto:[hidden email]>> wrote:
> >>
> >>    I'm not sure I understand, do you mean that you want to load just
> >>    the sequence from the GenBank file (ignoring the existing
> >>    annotation), then add your own features? There are instructions on
> >>    how to do that here:
> >>
> http://www.bioperl.org/wiki/HOWTO:SeqIO#Speed.2C_Bio::Seq::SeqBuilder
> >>
> >>
> >>    On 13/08/2010 16:27, Jessica Sun wrote:
> >>
> >>        unfortunately. I want to add the feature to the sequence
> object
> >>        I got
> >>        from the Genbank file, I do not mind to save a new genbank
> file but
> >>        these new genbank file contains the original genbank format
> and
> >>        info I
> >>        got plus the new feature tags I need to added to. Any quick
> >>        solution to
> >>        this?
> >>
> >>        thx
> >>
> >>        Jessica
> >>
> >>
> >>
> >>        On Fri, Aug 13, 2010 at 11:21 AM, Roy Chaudhuri
> >>        <[hidden email] <mailto:[hidden email]>
> >>        <mailto:[hidden email]
> >>        <mailto:[hidden email]>>> wrote:
> >>
> >>            Hi Jessica.
> >>
> >>            You need to use Bio::SeqIO to read in the GenBank file
> >> to
> a
> >>        BioPerl
> >>            sequence object, and to write your new GenBank file:
> >>        http://www.bioperl.org/wiki/HOWTO:SeqIO
> >>
> >>            To add a new feature follow the instructions here:
> >>
> >>
> http://www.bioperl.org/wiki/HOWTO:Feature-Annotation#Building_Your_Own
> _S
> equences
> >>
> >>            (except that you are adding the feature to the sequence
> >>        object you
> >>            got from the Genbank file, not a new Bio::Seq object).
> >>
> >>            Cheers.
> >>            Roy.
> >>
> >>
> >>            On 13/08/2010 16:06, Jessica Sun wrote:
> >>
> >>                Does anyone knows how to open a genbank file, add new
> >>        feature
> >>                and then save
> >>                a new genbank
> >>                file with new feature added in bioperl ?
> >>
> >>                thx
> >>
> >>
> >>
> >>
> >>
> >>        --
> >>        Jessica Jingping Sun
> >>
> >>
> >>
> >>
> >>
> >> --
> >> Jessica Jingping Sun
> >>
> >
> >
>
>
> --
> Jessica Jingping Sun
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>



--
Jessica Jingping Sun



--
Jessica Jingping Sun
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://lists.open-bio.org/mailman/listinfo/bioperl-l