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
10 # If you have installed bioperl using the standard
11 # makefile system everything should be fine and
14 # if not edit the use lib "...." line to point the directory
15 # containing your Bioperl modules.
22 # new sequence from raw memory...
23 # it is *very* important to get the type right so it
24 # is translated correctly.
26 $seq = Bio
::Seq
->new ( -id
=> "myseq",
27 -seq
=> "CGCCGAAGAAGCATCGTTAAAGTCTCTCTTCACCCTGCCGTCATGTCTAAGTCAGAGTCTCCT",
30 $seqout = Bio
::SeqIO
->new('-format' => 'fasta', -fh
=> \
*STDOUT
);
32 # make a reverse complement sequence
34 $rev = $seq->revcom();
36 # the actual sequence is here
38 $actual_bases = $rev->seq();
40 print "Reversed sequence as a string is [$actual_bases]\n";
42 # we could also write it as fasta formatted output
44 $seqout->write_seq($rev);
48 $trans = $seq->translate();
50 print "Translated sequence!\n";
52 $seqout->write_seq($trans);