Eldan Aranye has asked for the wisdom of the Perl Monks concerning the following question:
Hi all! I'm executing a samtools command via Perl and it gives me this diagnostic message:
samopen SAM header is present: 66338 sequences.
Now, I need to incorporate the Perl script in Galaxy, but because this diagnostic message gets interpreted as an error by Galaxy, I cannot proceed to the next command. Is there a way that I could trap the diagnostic message given by samtools in my Perl script and redirect it to STDOUT? Below is my script:
open INP, "< $ARGV[0]" or die "Cannot read file: $!"; open OUT, "> $ARGV[1]" or die "Cannot open file: $!"; @out = `/home/applications/samtools-0.1.7a/samtools view -bS $ARGV[0]` +; print OUT @out; close INP; close OUT;
If there's something wrong with the construct of my Perl code, do please tell me, too. Thanks! Diana
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trapping diagnostic messages
by 2teez (Vicar) on Apr 25, 2012 at 04:40 UTC | |
by Eldan Aranye (Acolyte) on Apr 25, 2012 at 05:28 UTC | |
|
Re: Trapping diagnostic messages
by Mr. Muskrat (Canon) on Apr 25, 2012 at 18:13 UTC | |
by Eldan Aranye (Acolyte) on Apr 26, 2012 at 00:53 UTC |