[Bioperl-l] extracting 'comments' from gff-ver 2
Cook, Malcolm
MEC at Stowers-Institute.org
Fri Apr 4 12:02:33 EST 2003
Charles,
Your GFF is ill formatted. The attribute field can't have literal tabs in them. Yours does. Change them to spaces and you'll be fine I bet.
The perl code in effect removes them, giving you I think a single attribute 'sequence833005F02.y1' with no value.
From: http://www.sanger.ac.uk/Software/formats/GFF/GFF_Spec.shtml
>From version 2 onwards, the attribute field must have an tag value structure following the syntax used within objects in a .ace file, flattened onto one line by semicolon separators. Tags must be standard identifiers ([A-Za-z][A-Za-z0-9_]*). Free text values must be quoted with double quotes. Note: all non-printing characters in such free text value strings (e.g. newlines, tabs, control characters, etc) must be explicitly represented by their C (UNIX) style backslash-escaped representation (e.g. newlines as '\n', tabs as '\t').
> -----Original Message-----
> From: Charles Hauser [mailto:chauser at duke.edu]
> Sent: Friday, April 04, 2003 10:16 AM
> To: Cook, Malcolm
> Cc: BioPerl-List
> Subject: RE: [Bioperl-l] extracting 'comments' from gff-ver 2
>
>
> Malcom,
>
> I see why this should work, but I get warning that tag value
> sequence does not exist?
>
>
> while($feature = $gffio->next_feature()) {
> if($feature->primary_tag eq 'gene') {
> print
> "Target ", $feature->seqname,"\n",
> "Query ",
> ($feature->each_tag_value('sequence'))[0],"\n";
> }
> }
>
>
>
>
> ------------- EXCEPTION -------------
> MSG: asking for tag value that does not exist sequence
> STACK Bio::SeqFeature::Generic::each_tag_value
> /usr/lib/perl5/site_perl/5.6.1/Bio/SeqFeature/Generic.pm:507
> STACK main::GFF gff_parser.pl:55
> STACK toplevel gff_parser.pl:22
>
>
> On Fri, 2003-04-04 at 10:42, Cook, Malcolm wrote:
> > Charles,
> >
> > try:
> > ($feature->each_tag_value('sequence'))[0]
> > where you have
> > $feature->comments
> >
> > -Malcolm Cook
> >
> > > -----Original Message-----
> > > From: Charles Hauser [mailto:chauser at duke.edu]
> > > Sent: Friday, April 04, 2003 9:21 AM
> > > To: BioPerl-List
> > > Subject: [Bioperl-l] extracting 'comments' from gff-ver 2
> > >
> > >
> > > I am trying to generate a plot of the distribution of
> ESTs on genomic
> > > scaffolds using the GFF output from exonerate. I need to grab the
> > > clone_id in the comments field '833005F02.y1'.
> > >
> > > the method $feature->comments does not exist, how can I
> access these
> > > data?
> > >
> > > -regards
> > >
> > > Charles
> > >
> > >
> > >
> > >
> > > use Bio::Tools::GFF;
> > > <snip>
> > > my $gffio = Bio::Tools::GFF->new(-fh => \*FH,
> > > -gff_version => 2);
> > > my $feature;
> > > while($feature = $gffio->next_feature()) {
> > > if($feature->primary_tag eq 'gene') {
> > > print
> > > $feature->seqname, "\n",
> > > $feature->comments, "\n";
> > >
> > >
> > >
> > > ##gff-version 2
> > > ##source-version exonerate:est2genome 0.6.7
> > > ##date 2003-03-24
> > > ##type DNA
> > > #
> > > #
> > > # seqname source feature start end score strand frame attributes
> > > #
> > > scaffold_1 exonerate:est2genome gene 367897 368609
> > > 1884 + . gene_id 1 ; sequence
> > > 833005F02.y1 ; gene_orientation
> > > + ;
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > Bioperl-l mailing list
> > > Bioperl-l at bioperl.org
> > > http://bioperl.org/mailman/listinfo/bioperl-l
> > >
>
>
>
More information about the Bioperl-l
mailing list