Paste Search Dynamic
Calculating strand of DNA
  1. #!/usr/bin/perl
  2. # Calculating the reserve complement of a strand of DNA
  3. $DNA = 'ACGGGAGGACGGGAAAATTACTACGGCATTAGC' ;
  4. print "here is the starting DNA:\n\n";
  5. print "$DNA\n\n" ;
  6. $revcom = reverse $DNA;
  7. $revcom =~ s/A/T/g;
  8. $revcom =~ s/T/A/g;
  9. $revcom =~ s/G/C/g;
  10. $revcom =~ s/C/G/g;
  11. print "$revcom \n";
  12. print "\nThat was a bad algorithm, and the reverse complement was wrong! \n";
  13. print "Try again ... \n\n";
  14. print "$revcom\n";
  15. print "\nThis time it worked!\n\n";
Parsed in 0.006 seconds