3 # PROGRAM : rev_and_trans.pl
4 # PURPOSE : Simple driver for Bio::Seq revcom and translate
5 # AUTHOR : Ewan Birney birney@sanger.ac.uk
6 # CREATED : Tue Oct 27 1998
9 # If you have installed bioperl using the standard
10 # makefile system everything should be fine and
13 # if not edit the use lib "...." line to point the directory
14 # containing your Bioperl modules.
21 # new sequence from raw memory...
22 # it is *very* important to get the type right so it
23 # is translated correctly.
25 $seq = Bio
::Seq
->new ( -id
=> "myseq",
26 -seq
=> "CGCCGAAGAAGCATCGTTAAAGTCTCTCTTCACCCTGCCGTCATGTCTAAGTCAGAGTCTCCT",
29 $seqout = Bio
::SeqIO
->new('-format' => 'fasta', -fh
=> \
*STDOUT
);
31 # make a reverse complement sequence
33 $rev = $seq->revcom();
35 # the actual sequence is here
37 $actual_bases = $rev->seq();
39 print "Reversed sequence as a string is [$actual_bases]\n";
41 # we could also write it as fasta formatted output
43 $seqout->write_seq($rev);
47 $trans = $seq->translate();
49 print "Translated sequence!\n";
51 $seqout->write_seq($trans);