Parent Directory | Revision Log
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 | } |
Name | Value |
---|---|
svn:executable | * |
ViewVC Help | |
Powered by ViewVC 1.1.26 |