3 thoughts on “Assignment #9 (homework)

  1. Hi all,
    I’m having a little trouble with using muscle in the last part of the assignment. It will alignment my test sequences, but wont create output files and instead give me the following error:
    sh: line 1: -out: command not found
    I’m using the following command in a for loop:
    system “muscle -in $dir1[$count1] -out muscle$count1.out”;
    and if I change “-out” to “-pout” or anything else I get the same error with “-pout” etc. instead of “-out” along with an alignment. Using system with muscle has worked fine for me in past assignments. Sorry if this is trivial, but I’ve spent a bunch of time failing to get it to work and figured it was better to ask yall. Thanks!

  2. From the error message it seems as if the shell is looking for a command called -out. A possible reason is that variable $dir1[$count1] that is interpolated contains a return at the end. If you don’t do it already, you could chomp the filenames before you put them into the array or into the command ( chomp($variable) removes the return at the end of a string stored in $variable. The only tricky thing with chomp is that it changes $variable. If you use it in an assignment the values is one or zero, depending if there was something to remove.
    Correct: chomp($variable)
    incorrect: $variable=chomp($variable) #$variable now is 0 or 1

    In Perl that are usually 1000 ways to do the same thing.
    One way to get filenames files from a directory that end on a given extension is to use glob. For example
    @fafiles = glob(“*.fa”); # assigns all names of files that have an fa extension to the array.
    An even shorter alternative is
    my @files=;

    Printing the array is a good idea to check for extra linefeeds:
    foreach (@files){print “$_\n”}

  3. Hi Prof. Gogarten,
    “chomping” the file names before using them in MUSCLE worked perfectly. Thanks for relieving that headache!

Comments are closed.