/[Perly]/examples/Code/03-complement-file.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /examples/Code/03-complement-file.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 45 - (hide annotations)
Sun Jun 8 18:09:07 2008 UTC (16 years ago) by dpavlin
File MIME type: text/plain
File size: 374 byte(s)
and examples
1 dpavlin 45 #!/usr/bin/perl -w
2     # Calculating the reverse complement of a strand of DNA
3    
4     # read lines from file or STDIN
5     while ( $DNA = <> ) {
6    
7     # remove line ending
8     chomp( $DNA );
9    
10     # Make a new (reverse) copy of the DNA
11     $revcom = reverse $DNA;
12    
13     # Translate A->T, C->G, G->C, T->A
14     $revcom =~ tr/ACGT/TGCA/;
15    
16     # Print the reverse complement DNA onto the screen
17     print "$revcom\n";
18     }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26