Hi, Thanks so much. Took me a couple tries but I got it to work. So much better now. Learning on the go is a slow process, but super excited got my first program to work :).
Catherine -----Original Message----- From: John Marshall [mailto:[email protected]] Sent: Wednesday, July 30, 2014 5:09 AM To: Sullivan, Catherine Cc: [email protected] Subject: Re: [Samtools-help] question about programming On 28 Jul 2014, at 20:49, Sullivan, Catherine <[email protected]> wrote: > Sorry new to programming. Just wrote my first perl script, and using > samtools piped into grep to get an calls at a specific location. However, > each time it run the script and it runs samtools, I get this in STDOUT: > > [mpileup] 1 samples in 1 input files > <mpileup> Set max per-sample depth to 8000 Samtools has always printed these messages to stderr, so to be precise I guess the problem is that these messages are appearing on your terminal. Perhaps your samtools/grep command looks something like system("samtools arg arg arg | grep pattern"); so you could suppress these two lines with system("samtools arg arg arg 2> /dev/null | grep pattern"); However that would also suppress any error messages output by samtools if anything went wrong. So it would be better to redirect to a temporary file ("2> foo.tmp") and then have your Perl script check that for any lines other than the two annoying ones and print them and exit if there are any. (There are also more advanced techniques, but not ones that are recommended for your first Perl script!) > Anyway to re-direct this or prevent this, so I just get the output from the > grep it is piped into? Doing this for multiple locations and want to create > a file of the results, but have these two lines between each result. One of these days we should probably add some sort of --quiet option to mpileup to silence these messages for situations like this one. John -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE. ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ Samtools-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/samtools-help
