[Bioperl-l] Re: Bio::Tools::EPCR.pm patch request
Jason Stajich
jason at cgt.duhs.duke.edu
Mon Mar 15 16:28:38 EST 2004
done!
I added the ability to the update the primary,source,groupclass fields
using get/set methods as well. I also capitalized the 'Note' field to be
in line with the way GFF3 looks.
-j
On Mon, 15 Mar 2004, Cook, Malcolm wrote:
> Jason,
>
> I'd like it if you would accept and apply the following diff to the very
> useful Bio::Tools::EPCR module. I hope you agree that it provides more
> flexibility in defining the structure of the features that are produced
> (and, ultimately for me, the format of the GFF which gets written before
> being loaded into Bio::DB::GFF database).
>
> I have made the behaviour completely backwards compatible.
>
> Sincerely,
>
> Malcolm Cook - mec at stowers-institute.org - 816-926-4449
> Database Applications Manager - Bioinformatics
> Stowers Institute for Medical Research - Kansas City, MO USA
>
> Index: EPCR.pm
> ===================================================================
> RCS file: /home/repository/bioperl/bioperl-live/Bio/Tools/EPCR.pm,v
> retrieving revision 1.8
> diff -c -r1.8 EPCR.pm
> *** EPCR.pm 2002/12/01 00:05:21 1.8
> --- EPCR.pm 2004/03/15 20:27:04
> ***************
> *** 92,110 ****
> =head2 new
>
> Title : new
> ! Usage : my $epcr = new Bio::Tools::EPCR(-file => $file);
> ! Function: Initializes a new EPCR parser
> Returns : Bio::Tools::EPCR
> Args : -fh => filehandle
> OR
> -file => filename
>
> =cut
>
> sub new {
> my($class, at args) = @_;
>
> my $self = $class->SUPER::new(@args);
> $self->_initialize_io(@args);
>
> return $self;
> --- 92,120 ----
> =head2 new
>
> Title : new
> ! Usage : my $epcr = new Bio::Tools::EPCR(-file => $file, -primary =>
> $fprimary, -source => $fsource, -groupclass => $fgroupclass);
> ! Function: Initializes a new EPCR parser.
> Returns : Bio::Tools::EPCR
> Args : -fh => filehandle
> OR
> -file => filename
>
> + -primary => a string to be used as the common value for
> each features '-primary' tag. Defaults to 'sts'. (This in turn maps to
> the GFF 'type' tag (aka 'method')).
> +
> + -source => a string to be used as the common value for each
> features '-source' tag. Defaults to 'e-PCR'. (This in turn maps to the
> GFF 'source' tag)
> +
> + -groupclass => a string to be used as the name of the tag
> which will hold the sts marker namefirst attribute. Defaults to 'name'.
> +
> =cut
>
> sub new {
> my($class, at args) = @_;
>
> my $self = $class->SUPER::new(@args);
> + my ($primary, $source, $groupclass) = $self->_rearrange([qw(PRIMARY
> SOURCE GROUPCLASS)], at args);
> + $self->{'_primary'} = $primary || 'sts';
> + $self->{'_source'} = $source || 'e-PCR';
> + $self->{'_groupclass'} = $groupclass || 'name';
> $self->_initialize_io(@args);
>
> return $self;
> ***************
> *** 139,152 ****
> my $markerfeature = new Bio::SeqFeature::Generic ( '-start' =>
> $start,
> '-end' =>
> $end,
> '-strand' =>
> $strand,
> ! '-source' =>
> 'e-PCR',
> ! '-primary' =>
> 'sts',
> '-seq_id' =>
> $seqname,
> '-tag' => {
> ! 'name'=>
> $mkrname,
> ! 'note'=>
> $rest,
> });
> return $markerfeature;
> }
>
> 1;
> --- 149,163 ----
> my $markerfeature = new Bio::SeqFeature::Generic ( '-start' =>
> $start,
> '-end' =>
> $end,
> '-strand' =>
> $strand,
> ! '-source' =>
> $self->{'_source'},
> ! '-primary' =>
> $self->{'_primary'},
> '-seq_id' =>
> $seqname,
> '-tag' => {
> !
> $self->{'_groupclass'}=> $mkrname,
> });
> + $markerfeature->add_tag_value('note',$rest) if $rest;
> return $markerfeature;
> +
> }
>
> 1;
>
--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu
More information about the Bioperl-l
mailing list