Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
...and the post-exercise script for 1.pl
authorpreecej <preecej@localhost>
Thu, 3 Jul 2014 00:31:34 +0000 (00:31 +0000)
committerpreecej <preecej@localhost>
Thu, 3 Jul 2014 00:31:34 +0000 (00:31 +0000)
svn path=/; revision=578

Personnel/preecej/perl_singletons/STEM_2014/STEM_2014_Script_1.after.pl [new file with mode: 0644]

diff --git a/Personnel/preecej/perl_singletons/STEM_2014/STEM_2014_Script_1.after.pl b/Personnel/preecej/perl_singletons/STEM_2014/STEM_2014_Script_1.after.pl
new file mode 100644 (file)
index 0000000..c939ad4
--- /dev/null
@@ -0,0 +1,42 @@
+# Welcome to your first Perl script! Any line preceded with a '#' sign is a "comment". Perl ignores these lines; they are for human eyes only.
+
+# Except for this one... This line tells the computer to run this script (file) using Perl.
+#!usr/bin/perl
+
+# -- VARIABLES --
+
+# This is a variable "declaration"; it creates a variable and stores a value in it.
+# Variables can hold words, numbers, and other data. You can change their value. This variable holds some sample DNA sequence.
+my $test_sequence = "CCGATG";
+
+# -- READING INPUT --
+
+# Let's read in user input from the command line and assign it to a variable.
+my $user_sequence = $ARGV[0];
+
+# -- ANALYSIS AND PRINTING OUTPUT --
+
+# The "print" statement will create output.
+print "User sequence: " . $user_sequence . "\n";
+
+# Make sure the user input is converted to upper-case for comparisons.
+$user_sequence = uc($user_sequence);
+
+# Is this user-entered sequence the reverse complement of our test sequence?
+my $reverse_sequence = reverse($user_sequence);
+print "Reverse sequence: " . $reverse_sequence . "\n";
+my $reverse_complement = $reverse_sequence;
+$reverse_complement =~ tr/ACGT/TGCA/;
+
+if ($reverse_complement eq $test_sequence)
+{
+    print "We have a match!\n";
+    print $user_sequence . " is the reverse complement of " . $test_sequence . "\n";
+}
+else
+{
+    print "No match.\n";
+    print $user_sequence . " is NOT the reverse complement of " . $test_sequence . "\n";
+}
+
+# -- THE END --
\ No newline at end of file