Eldan Aranye has asked for the wisdom of the Perl Monks concerning the following question:

Hi, all

I have this code that executes a script program:

$genes = $ARGV[3]; $isoforms = $ARGV[4]; $trans = $ARGV[0]; $left = $ARGV[1]; $right = $ARGV[2]; $directory = "/home/applications/galaxy-dist/tools/VELVET-OASES"; $transcript = "$directory/trans.fa"; $left_read = "$directory/left_read.fastq"; $right_read = "$directory/right_read.fastq"; symlink $trans, $transcript; symlink $left, $left_read; symlink $right, $right_read; @out = `perl /home/applications/galaxy-dist/tools/VELVET-OASES/run_rse +m.pl 2>&1`;

It's able to create the symlinks, but it fails to perform the command. Any ideas on why this is happening? I've used this pattern before, and it worked perfectly well. Is there anything wrong with the script?

Thanks in advance for any help!

Replies are listed 'Best First'.
Re: Command not executing
by toolic (Bishop) on Jun 22, 2012 at 01:31 UTC
    What makes you think it fails to perform the command? backticks capture the output of the command. You should look at the contents of the @out array (Basic debugging checklist):
    use Data::Dumper; print Dumper(\@out); print $? if $?;
Re: Command not executing
by BrowserUk (Patriarch) on Jun 22, 2012 at 01:43 UTC
    but it fails to perform the command.

    That is not much to go on.

    Given that a) the command is a perl script; b) you are capturing the output including that to the scripts stderr; aren't there any error messages or other clues contained in @out?

    If not, then the logical thing to do would be to add some tracing diagnostics into run_rsem.pl.

    Any ideas on why this is happening?

    There is no way for anyone to hazard a guess from the information supplied.

    On the other hand, you have all the tools available to you to trace the symptoms of the failure, even if you need our help in interpreting them.

    Help us help you.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      Thank you for the replies. I forgot to check the output in @out. Turns out the program rsem cannot find the trans.fa that I'm using as input (even though it's there). Oddly enough, when I run the code again using the konsole and not via Galaxy, it works fine.

        program rsem cannot find the trans.fa that I'm using as input (even though it's there). Oddly enough, when I run the code again using the konsole and not via Galaxy, it works fine.

        That sounds like a classic "permissions issue".

        One way to track such issues is to add a couple of lines to the top of the script (rsem.pl in this case), that display the permissions available for each component of the path(s). Eg.

        sub checkPathPermissions { my( $path, @bits ) = split '[/\\]', shift; $path = '/' . $path; while( @bits ) { print STDERR "$path: ", join ' : ', stat( $path ); $path .= '/' . shift @bits; } }

        Note: That untested code; to illustrate the suggestion only.

        If you add that to the top of rsem and call it on each of the input paths; then run it from your console and via galaxy, the difference between the two runs will probably go a long way to diagnosing the issue.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?