[Bioperl-l] update: genpept module

Dimitar Kenanov dimitark at bii.a-star.edu.sg
Thu Nov 25 05:34:39 UTC 2010


I used it like this in the script:

if( $options{'-db'} eq 'protein' ) {
     ### DIMITAR ###
     if( $retformat eq 'fasta'){
     $dbh = Bio::DB::GenPept->new(-verbose => $debug,
                             -format => 'Fasta');
     ### END DIMITAR ###
     }else{
     $dbh = Bio::DB::GenPept->new(-verbose => $debug);
     }


}

i added $retformat to getoptlong as well. but that didnt work well as 
did for GenBank. May be GenBank and GenPept should be made to work in 
the same way. Now they are a bit different. I tried to see why they 
react different but i couldnt understand why.

now my GenPept new method looks like this:
sub new {
   my($class, @args) = @_;
   my $self = $class->SUPER::new(@args);
   my ($verbose,$format)=$self->_rearrange([qw(VERBOSE 
FORMAT)], at args);#dimitar
   $DEFAULTFORMAT=$format if (defined $format);#dimitar
   $self->request_format($self->default_format($format));
   return $self;
}

this way i can get sequences in any format which Eutils is allowing.

On 11/25/2010 11:57 AM, Jason Stajich wrote:
> This doesn't seem like the right fix -- you don't want to updated a 
> default variable -- why didn't you just use it like this: ?
>
> my $db = new Bio::DB::GenPept->new(-format => 'fasta');
>
>
>
> Chris Fields wrote, On 11/24/10 7:24 PM:
>> Dimitar,
>>
>> Missed your original post, but was it reported as a bug?
>>
>> chris
>>
>> On Nov 24, 2010, at 8:38 PM, Dimitar Kenanov wrote:
>>
>>> Hi guys,
>>> just managed to get GenPept to give me the fasta in the full form. I 
>>> modified GenPept in this way:
>>>
>>> sub new {
>>>   my($class, @args) = @_;
>>>   my $self = $class->SUPER::new(@args);
>>>   my ($verbose,$format)=$self->_rearrange([qw(VERBOSE 
>>> FORMAT)], at args); #DIMITAR
>>>   $DEFAULTFORMAT='fasta' if (defined $format); #DIMITAR
>>>   $self->request_format($self->default_format($format));
>>>   return $self;
>>> }
>>>
>>> Cheers
>>> Dimitar
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>



On 11/25/2010 11:57 AM, Jason Stajich wrote:
> This doesn't seem like the right fix -- you don't want to updated a 
> default variable -- why didn't you just use it like this: ?
>
> my $db = new Bio::DB::GenPept->new(-format => 'fasta');
>
>
>
> Chris Fields wrote, On 11/24/10 7:24 PM:
>> Dimitar,
>>
>> Missed your original post, but was it reported as a bug?
>>
>> chris
>>
>> On Nov 24, 2010, at 8:38 PM, Dimitar Kenanov wrote:
>>
>>> Hi guys,
>>> just managed to get GenPept to give me the fasta in the full form. I 
>>> modified GenPept in this way:
>>>
>>> sub new {
>>>   my($class, @args) = @_;
>>>   my $self = $class->SUPER::new(@args);
>>>   my ($verbose,$format)=$self->_rearrange([qw(VERBOSE 
>>> FORMAT)], at args); #DIMITAR
>>>   $DEFAULTFORMAT='fasta' if (defined $format); #DIMITAR
>>>   $self->request_format($self->default_format($format));
>>>   return $self;
>>> }
>>>
>>> Cheers
>>> Dimitar
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>




More information about the Bioperl-l mailing list