Problem with revcom

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with revcom

Antony03
Hello,

I try to reverse complement a sequence found with fasta36:

        if ( $hsp->strand('query') == -1 ) {
my $rev_output=$hsp->hit_string->revcom();
print "$rev_output";
          }

And I get an error like:

Can't locate object method "revcom" via package

Can someone know what is wrong with my code?

Thanks,

Antony
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with revcom

Mark A. Jensen
Antony,
hit_string() returns a string, not a sequence obj.

Something like

  $rc  = Bio::Seq->new( -seq => $hsp->hit_string )->revcom;

should work.
MAJ

On 2014-07-17 20:14, Antony03 wrote:

> Hello,
>
> I try to reverse complement a sequence found with fasta36:
>
> if ( $hsp->strand('query') == -1 ) {
> my $rev_output=$hsp->hit_string->revcom();
> print "$rev_output";
>           }
>
> And I get an error like:
>
> Can't locate object method "revcom" via package
>
> Can someone know what is wrong with my code?
>
> Thanks,
>
> Antony
>
>
>
> --
> View this message in context:
> http://bioperl.996286.n3.nabble.com/Problem-with-revcom-tp17581.html
> Sent from the Bioperl-L mailing list archive at Nabble.com.
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://mailman.open-bio.org/mailman/listinfo/bioperl-l

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

Re: Problem with revcom

Antony03
It almost works,

Just a little correction if this can help someone else:

$rc  = Bio::Seq->new( -seq => $hsp->hit_string )->revcom->seq;

Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with revcom

Mark A. Jensen

Excellent!


On Fri, Jul 18, 2014 at 7:13 AM, Antony03 <[hidden email]> wrote:

It almost works,

Just a little correction if this can help someone else:

$rc  = Bio::Seq->new( -seq => $hsp->hit_string )->revcom->seq;

Thanks!




--
View this message in context: http://bioperl.996286.n3.nabble.com/Problem-with-revcom-tp17581p17583.html
Sent from the Bioperl-L mailing list archive at Nabble.com.
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l


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

Re: Problem with revcom

Torsten Seemann
In reply to this post by Antony03
$rc  = Bio::Seq->new( -seq => $hsp->hit_string )->revcom->seq;

Would this do the same thing?

$rc = $hsp->hit->revcom->seq 

ie. I think the hit() method returns a Seq object, so no need to convert between strings?
 
--Torsten Seemann
--Victorian Bioinformatics Consortium, Dept. Microbiology, Monash University, AUSTRALIA

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

Re: Problem with revcom

Mark A. Jensen

Sounds like the right way to do it!


On Sun, Jul 20, 2014 at 3:09 AM, Torsten Seemann <[hidden email]> wrote:

$rc = Bio::Seq->new( -seq => $hsp->hit_string )->revcom->seq;

Would this do the same thing?

$rc = $hsp->hit->revcom->seq

ie. I think the hit() method returns a Seq object, so no need to convert between strings?
--Torsten Seemann
--Victorian Bioinformatics Consortium, Dept. Microbiology, Monash University, AUSTRALIA

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