[Bioperl-l] no revcom method in Bio::Seq module?

Chris Fields cjfields at uiuc.edu
Sun May 14 17:39:50 UTC 2006


This line should give you the hint:

	#revcom=Bio::Seq=HASH(0x10493304)

You're getting an object ref here.  The actual way to get the rev. comp on
the wiki states '$seq->revcom->seq', not '$seq->revcom'.

When I ran your script and change your line to the wiki version I get (using
my test seq):

what attributes/keys are available:
primary_id      =>      test,
primary_seq     =>      Bio::PrimarySeq=HASH(0x1d47fe0)
primary_id=test,

id=test,

revcom=GGAACGAGATCTCCATGCCGCGCACCATCGGCCCGGGATGCAGCACGATCGCGCGGTCCGGCAGCATCG
CCTGGCGCTTCTCGGACAATCCGTAGCGCACCGAGTACTCACGCGCGGA
CGGGAAGAAACTGCCGTTCATGCGTTCGGCCTGCACGCGCAGCATGAGCACCGCGTCGGCCGCGGGCAGTTCGGCG
TCCAGGTCATAGGACACGGTCACCGGCCAGTTCTCGACGCCCCTGGGGA
GCAGCGTCGGTGGGGACACCAGCACCACCTCGGCCCCGAGGGTGTGCAGCAGCGTCACGTTGGAGCGGGCCACGCG
GCTGTGCAGCACGTCGCCGACGATCACCACGCGCTTGCCCTCGACGCTG

Sun May 14 17:34:45 2006

Chris

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of chen li
> Sent: Sunday, May 14, 2006 12:15 PM
> To: bioperl-l at bioperl.org
> Subject: [Bioperl-l] no revcom method in Bio::Seq module?
> 
> Hi all,
> 
> I need to get a reverse-complemenary sequence out of a
> fasta sequence file. And the Synopsis of Bio::Seq
> points out I can do like this way:
> 
> $revcom=$seqobj->revcom();
> 
> I use the following script trying to get the job done
> but it doesn't work. Then I read documentation of
> Bio::Seq and it looks like it doesn't contain revcom
> method.
> 
> Any idea will be appreciated.
> 
> Li
> 
> 
> ###############################
> Here is the code:
> 
> #!c:/perl/bin/perl.exe
> use strict;
> use warnings;
> 
> use Bio::Seq;
> use Bio::SeqIO;
> 
> my $file='c:/perl/local/primer3_1.0.0/src/est.txt';
> 
> 
> my $seqIO=Bio::SeqIO->new(-file=>"<$file",
>                             -format=>'fasta' );
> 
>     my $seqobj=$seqIO->next_seq();#create object
> 
>   print "what attributes/keys are available:\n";
>   for my $key (sort keys %$seqobj){
>            my $value=$seqobj->{$key};
> 	    print "$key\t=>\t$value\n"
> 	    }
> # These are the output on the screen
> #primary_id =>      gi|54093|emb|X61809.1|
> #primary_seq =>     Bio::PrimarySeq=HASH(0x10492848)
> 
> #based on these results primary_id can get
> #access right away
> # as to primary_seq it is an object in
> #Bio::Primaryseq and it provides the following
> #methods after reading the documentaion:
>                 #new
> 		#seq
> 		#validate_seq
> 		#subseq
> 		#length
> 		#display_id
> 		#accession_number
> 		#primary_id
> 		#alphabet
> 		#desc
> 		#can_call_new
> 		#id
> 		#is_circular
> 		#object_id
> 		#version
> 		#authority
> 		#namespace
> 		#display_name
> 		#description
> 
> print "primary_id=",$seqobj->primary_id, "\n\n";
> print "id=",$seqobj->id, "\n\n";
> print "revcom=",$seqobj->revcom,"\n\n";
> 
>         my $now_time=localtime;
>         print  $now_time, "\n\n";
>         exit;
> 
>  #These are the output on the screen
> 	#primary_id=gi|54093|emb|X61809.1|
> 	#id=gi|54093|emb|X61809.1
> 	#revcom=Bio::Seq=HASH(0x10493304)
> 	#Sun May 14 12:45:20 2006
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> 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