Redirecting stderr

Posted in Add your tools by Mia Steinberg Fri May 27 2016 14:45:03 GMT+0000 (Coordinated Universal Time)·2·Viewed 533 times

What is the best way to redirect stderr in SBG? I see the option for stdout that adds a '>' to the command line, but what about when we want to add '2>'? Right now, I have the '2>' added as my last argument, but I get the error... This task ran into a problem during execution and did not finish. Command perl miRDeep2.pl /sbgenomics/Projects/5311483a-0df2-41d1-ba6e-361dc84bc31c/sample.reads.fa /sbgenomics/Projects/5311483a-0df2-41d1-ba6e-361dc84bc31c/hg19_bowtie.fa /sbgenomics/Projects/5311483a-0df2-41d1-ba6e-361dc84bc31c/sample.reads_vs_genome.arf /sbgenomics/Projects/5311483a-0df2-41d1-ba6e-361dc84bc31c/mature.fa none /sbgenomics/Projects/5311483a-0df2-41d1-ba6e-361dc84bc31c/hairpin.fa -P -t Human 2> report.log failed with exit code 2. ...and no error log, so I'm guessing that something is angry at my redirection. Is the shell bash? And if it is not, how do I log my stderr? Also, here is the documentation for the tool: https://www.mdc-berlin.de/36105849/en/research/research_teams/systems_biology_of_gene_regulatory_elements/projects/miRDeep/documentation#mirdeep2
Erik Lehnert
May 27, 2016

You should be able to redirect errors to a file by adding 2> stderr.txt (or some other file name) to the end of a command. You can chain this with stdout to get both outputs in separate files, such as with: command1 > stdout.txt 2> stderr.txt.

A caveat is that you need to grab these files using an output port, or they will not be transferred to your project's files. You can do this by creating an output port for stderr, such as by using a glob expression 'stderr.txt' (at least for the above expression).

Please let me know if you have any further questions about this issue.

Mia Steinberg
May 27, 2016

I double checked, and there is an output port that globs for report.log.

I'll rule out the redirect as a reason for the exit code 2 error and keep searching. Thanks!

  
Markdown is allowed