Friday, October 17, 2008

Frustrated rant

Well, today I need somewhere to complain, and I figured, where better than the internet? That's where everybody else does it, right?

I am in a genomics class at BYU, and it is frustrating. Very frustrating. Just in case you don't know what genomics is, here is a brief summary (and those of you who do know what it is, you should realize that I am sacrificing some accuracy for the sake of simplicity).

Genomics is the study of all the DNA in an organism, or its genome. Genomes contain huge amounts of data. Seriously huge. Imagine trying to publish the genome in a book. If you typed A, T, C, and G (the four types of data in DNA- think 1's and 0's for computers) in 12pt. font with one inch margins, your book of one human genome would be just over a million pages long. So, lots of data. To help search all this data, we use computer programs, and often scientists have to write their own.

Now we get to my complaining (the part I'm sure you've all been waiting for). In my genomics class, we are supposed to learn some basics of PERL, a computer programming language. After spending two days in the computer lab, I have learned how to log in, how to move a file from someone else's folder to mine, and how to run that file. We also learned how to look at the code for that file, but what we see looks like this:
#!/usr/bin/perl
print "ARGV=",@ARGV, "\n";
print "ARGV[0]=",$ARGV[0], "\n";
print "ARGV[1]=",$ARGV[1], "\n";
open(DNAFILE, $ARGV[0]) or die "cant open $ARGV[0]: $!";
while() {
print "line $_\n";
$str = $_;
print "string is $str\n";
So, it's not super-helpful.

Today they asked us to write a program, scavenging the bits of code we needed from other, already functional programs. To me, this sounded like giving me a bunch of sentences in Chinese and saying, "Now, using any words you need from those sentences, write a novel." I had no idea even of where to start an assignment like that. So I, being a very hard working, problem solving kind of guy, sat and stared at my screen for several minutes.

Close to the end of the time limit, the teachers saw that there were two groups in the class: those who were getting computer science degrees (who had finished the assignment in a few minutes and were bored) and those who were completely lost and had given up. The teachers got frustrated with our lack of trying, and we got frustrated with their lack of explaining, and everybody left the class in a bad mood.

The sad part of the story is that there's no satisfying conclusion. I'm still frustrated about it. If anybody out there happens to know a good PERL programming guide, let me know. Or if anybody wants to copy and paste Chinese characters into a novel, that would probably be fun, too.

3 comments:

Sam said...

yo d2,

it's the perl llama. http://oreilly.com/catalog/9780596001322/

It goes over basics, although if you've got no programming you might think it "basic." Programming is like alcohol, your first time it totally sucks. But once you force yourself to do it (because everyone else is) it's not really that bad. (Thanks Billy Renfro for the analogy).

Also keep in mind, perl is the ugliest and sloppiest language. You just have to deal with it.

Sam said...

Note: comments start with a # real code does not
see http://bix.ucsd.edu/InspectDocs/InspectTutorial.pdf in the glossary section for some lingo




#!/usr/bin/perl
# the pre-amble, necessary directives.


print "ARGV=",@ARGV, "\n";
#print the arguments to the screen
print "ARGV[0]=",$ARGV[0], "\n";
#print just the first argument.
#zero is the first number
print "ARGV[1]=",$ARGV[1], "\n";
#print the second argument
open(DNAFILE, $ARGV[0]) or die "cant open $ARGV[0]: $!";
#open a file (using the first argument
#as the location) or die (quit)
while() {
print "line $_\n";
$str = $_;
#print each line in succession
print "string is $str\n";
#print off all of the input file

David said...

Thanks, Sam.

I'm a Mormon.