ahartens/Alex_Sequence_Analysis — pull request #1 by bussec (2011-10-22 22:58:23+00:00)
Title: Mainly code layout/formating changes. Interpreter path fixed in addition.

Hy Alex

With the exception of the interpreter path (first line), re-enabling "warnings" and 6 "my" statements I didn't functionally change anything. The file diff screams because all the tabs were replaced by spaces and I deleted a lot of empty lines.

Since it works on the test files, you're 80% there. However, there are a couple of things that we should discuss next week:

1. Command line options: Interactive stuff is more user friendly, but not convenient if you want to batch it. Therefore the script should be able to work with command line options. My favorite for this is the "Getopt::Long" module, since it allows long names for the options, which makes it nearly as good as an interactive mode.

2. Data structures should represent the way you access them. If you think in term of the final CSV table, then you are currently pretty focus on columns, however what you are actually interested in are rows. Therefore it would be helpfull if you could access rows more easily. Whether this is a 2-D array, an array of hashes, a hash of hashes or a hash of arrays is up to your personal taste (well... partially). For further information see [Camel Book / Chapter 9](http://proquest.safaribooksonline.com/book/programming/perl/0596000278/the-gory-details/pperl3-chp-9). In addition working with references to anonymous arrays and hashes might be over-engineered at this point, but is a very powerful concept [Alpaca Book / Chapters 4&5](http://proquest.safaribooksonline.com/book/programming/perl/0596102062/introduction-to-references/intermediateperl-chp-4).

3. Sub insert_id: Several of your string variables are redundant, because you only use them once. For clarity direct string usage would be better, for flexibiliy the easiest thing would be a hash.

4. Sub early_termination_check: Sanitize "if ($stops[$file_count] ne $true)" statements that lead to a "Use of uninitialized value in string ne at..." warning. You can do that by checking first whether they are defined or not. In addition your stop codons show be a list that is interated through.

ATB Christian