diff options
| author | Joel Crosswhite <joel.crosswhite@ix.netcom.com> | 2020-12-11 20:17:24 -0700 |
|---|---|---|
| committer | Joel Crosswhite <joel.crosswhite@ix.netcom.com> | 2020-12-11 20:17:24 -0700 |
| commit | da09908bd7336a2c7db684b4efb3fb2f69ed3a88 (patch) | |
| tree | 356ef5ffccd04f8fa5a9d1b8038e9d378ffdd43b | |
| parent | d516a0c34ab55ccc6a4eb285757a5988ac6fb1a4 (diff) | |
| download | perlweeklychallenge-club-da09908bd7336a2c7db684b4efb3fb2f69ed3a88.tar.gz perlweeklychallenge-club-da09908bd7336a2c7db684b4efb3fb2f69ed3a88.tar.bz2 perlweeklychallenge-club-da09908bd7336a2c7db684b4efb3fb2f69ed3a88.zip | |
Added solution for week 90, challenge 1.
| -rw-r--r-- | challenge-090/jcrosswh/perl/ch-1.pl | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/challenge-090/jcrosswh/perl/ch-1.pl b/challenge-090/jcrosswh/perl/ch-1.pl new file mode 100644 index 0000000000..098fbf1f79 --- /dev/null +++ b/challenge-090/jcrosswh/perl/ch-1.pl @@ -0,0 +1,44 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +=head1 NAME + +PWC 090 Challenge 1 + +=head1 SYNOPSIS + + $ ch-1.pl + 67 + CATTTGGGGAAAAGTAAATCTGTCTAGCTGAGGAATAGGTAAGAGTCTCTACACAACGACCAGCGGC + +=head1 DESCRIPTION + +Given the DNA sequence, +GTAAACCCCTTTTCATTTAGACAGATCGACTCCTTATCCATTCTCAGAGATGTGTTGCTGGTCGCCG, this script +prints the nucleiobase count in the DNA sequence. This script also prints the +complementary sequence where Thymine (T) on one strand is always facing an +adenine (A) and vice versa; guanine (G) is always facing a cytosine (C) and vice +versa. + +=head1 AUTHORS + +Joel Crosswhite E<lt>joel.crosswhite@ix.netcom.comE<gt> + +=cut + +my $DNA_SEQUENCE = + 'GTAAACCCCTTTTCATTTAGACAGATCGACTCCTTATCCATTCTCAGAGATGTGTTGCTGGTCGCCG'; +my %dna_complement = ( + 'A' => 'T', + 'T' => 'A', + 'C' => 'G', + 'G' => 'C' +); + +print length($DNA_SEQUENCE) . " bases\n"; +print map { $dna_complement{$_} } split(//, $DNA_SEQUENCE); +print "\n"; + +exit 0;
\ No newline at end of file |
