[Bioperl-l] no revcom method in Bio::Seq module?
Christopher Fields
cjfields at uiuc.edu
Sun May 14 18:28:14 UTC 2006
I think the confusion lies in what revcom returns. This page
http://www.bioperl.org/wiki/Getting_Started
show a quick way of using revcom, (which I mentioned previously) while this
page
http://www.bioperl.org/wiki/HOWTO:Beginners
explains what is returned when you use revcom. '$seq_obj->revcom' returns a
sequence object (not a sequence string):
http://www.bioperl.org/wiki/HOWTO:Beginners#The_Sequence_Object
which is why you need to use the 'seq' method to get the string.
Hence, '$seq_obj->revcom->seq'.
Chris
---- Original message ----
>Date: Sun, 14 May 2006 11:08:49 -0700 (PDT)
>From: chen li <chen_li3 at yahoo.com>
>Subject: RE: [Bioperl-l] no revcom method in Bio::Seq module?
>To: Chris Fields <cjfields at uiuc.edu>
>Cc: bioperl-l at bioperl.org
>
>Hi Chris,
>
>Thank you very much. But could you please give me the
>link for this syntax: $seq->revcom->seq?
>
>Li
>
>
>
>--- Chris Fields <cjfields at uiuc.edu> wrote:
>
>> 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=GGAACGAGATCTCCATGCCGCGCACCATCGGCCCGGGATGCAGCACGAT
CGCGCGGTCCGGCAGCATCG
>> CCTGGCGCTTCTCGGACAATCCGTAGCGCACCGAGTACTCACGCGCGGA
>>
>CGGGAAGAAACTGCCGTTCATGCGTTCGGCCTGCACGCGCAGCATGAGCACCGCG
TCGGCCGCGGGCAGTTCGGCG
>> TCCAGGTCATAGGACACGGTCACCGGCCAGTTCTCGACGCCCCTGGGGA
>>
>GCAGCGTCGGTGGGGACACCAGCACCACCTCGGCCCCGAGGGTGTGCAGCAGCGT
CACGTTGGAGCGGGCCACGCG
>> 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
>>
>>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam? Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com
More information about the Bioperl-l
mailing list