igvtools count output

403 views
Skip to first unread message

PKIDNA

unread,
Apr 29, 2013, 1:43:02 PM4/29/13
to igv-...@googlegroups.com
Quick question...can the igvtools count function output data to STDOUT using one of the formats rather than output to the file?

I would like to use it in a pipe to generate on the fly coverage graphs and would like to save on creating file, reading filed, deleting file steps....

much thanks!


Jim Robinson

unread,
Apr 30, 2013, 10:59:13 PM4/30/13
to igv-...@googlegroups.com
That's not possible currently, we have added it to our list.

PKIDNA

unread,
May 2, 2013, 2:17:01 PM5/2/13
to igv-...@googlegroups.com
Great, as usual you guys rock with helping out.  But if you can give me a rough estimate of when it might be worked on let me know. 

PKIDNA

unread,
Jun 4, 2013, 2:41:32 PM6/4/13
to igv-...@googlegroups.com
Jim, you had mentioned this was now "beta", I have just download igvtools 2.3.7.....I am not seeing anything in help with respect to STDOUT, I have tried a couple of guesses.  Do I need to get the "nightly build"?

Thanks

PKIDNA

unread,
Jun 4, 2013, 2:48:36 PM6/4/13
to igv-...@googlegroups.com
Just an update, I did download the "EA" version of igvtools, have that installed now as well...


On Monday, April 29, 2013 1:43:02 PM UTC-4, PKIDNA wrote:

Jacob Silterra

unread,
Jun 5, 2013, 9:53:12 AM6/5/13
to igv-...@googlegroups.com
The most recent version of IGV, 2.3.8, has this functionality for "count" and "sort" commands. Use the string "stdout" for an output file name. e.g.

>igvtools count myfile.sam stdout hg18

Just an FYI, the latest nightly build of IGV is always available at http://www.broadinstitute.org/software/igv/download_snapshot.


--
 
---
You received this message because you are subscribed to the Google Groups "igv-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to igv-help+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jacob Silterra
Software Engineer
Broad Institute

PKIDNA

unread,
Jun 5, 2013, 10:19:11 AM6/5/13
to igv-...@googlegroups.com
Ok great, I see the version in the downloads area has been updated, downloading now.  I will let you know how it works....

PKIDNA

unread,
Jun 5, 2013, 11:28:17 AM6/5/13
to igv-...@googlegroups.com
Jacob,

I dl'd the 2.3.8 version but adding 'stdout'  just creates a file stdout.tdf

Also, if output would stream to stdout I assume you will be using the .wig text output, correct?

thanks

edward



On Wednesday, June 5, 2013 9:53:12 AM UTC-4, Jacob Silterra wrote:

Jacob Silterra

unread,
Jun 5, 2013, 5:03:17 PM6/5/13
to igv-...@googlegroups.com
Looks like there was an issue with our build process. Try igvtools 2.3.9

You are correct about the format, it will be wiggle text output.

-Jacob

PKIDNA

unread,
Jun 6, 2013, 11:13:06 AM6/6/13
to igv-...@googlegroups.com
It is working....

My only suggestion/comment would be for data piping applications I would have preferred an un-buffered output stream, but for small query windows the performance seems good.  A "no headers" option might be nice (aka "quiet mode") limiting the outputted stream to just the data sans messages and headers.

I think (though I realize I am a small audience) this type of functionality will be really helpful in many situations.  Generating live coverage metrics from the BAM file outside of the viewer is going to be helpful

Again, really appreciate the efforts the team there puts into these utilities.....

edward

Jacob Silterra

unread,
Jun 6, 2013, 11:19:40 AM6/6/13
to igv-...@googlegroups.com
>just the data sans messages and headers

What type of messages are you talking about? If you mean the header lines which go with a wiggle file, that's definitely something we'll consider. If you're seeing stuff that looks like a log statement (e.g. Loading genome: ~/genomes/hg18.chrom.sizes) that's a bug; give us specifics and we'll fix it. Messages like that should currently be piped to stderr.

-Jacob


--
 
---
You received this message because you are subscribed to the Google Groups "igv-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to igv-help+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

PKIDNA

unread,
Jun 6, 2013, 11:27:02 AM6/6/13
to igv-...@googlegroups.com
Here is the sample output, I bolded the command to distinguish from the data (how I will be using it)...and indicated in blue the data which I would be interested in grabbing for next stage of processing....

[sge@bfdvpc10002m run_2149]$ /opt/pipe/igvtools/igvtools count --strands read --windowSize 1 --query 1:43815031-43815165 B1040_ATCACG_L002.recal.bam stdout /opt/ras/ref/human_GRCh37.68/bwa/genome.fa
Computing coverage.  File = B1040_ATCACG_L002.recal.bam
Max zoom = 7
Window size = 1
Window functions: mean
Ext factor = 0
Loading genome: /opt/ras/ref/human_GRCh37.68/bwa/genome.fa
IGV Directory: /home/sge/igv
Genome loaded.  id= /opt/ras/ref/human_GRCh37.68/bwa/genome.fa
track type=wiggle_0
#Columns: Pos, Positive Strand, Negative Strand
variableStep chrom=1 span=1
43815031        23.0    30.0
43815032        23.0    30.0
43815033        24.0    30.0
43815034        24.0    31.0
43815035        24.0    31.0
43815036        24.0    30.0
43815037        24.0    29.0
43815038        23.0    29.0
43815039        22.0    28.0
43815040        21.0    30.
0

Jacob Silterra

unread,
Jun 6, 2013, 11:36:35 AM6/6/13
to igv-...@googlegroups.com
Have you tried actually piping this output somewhere? e.g

>/opt/pipe/igvtools/igvtools count --strands read --windowSize 1 --query 1:43815031-43815165 B1040_ATCACG_L002.recal.bam stdout /opt/ras/ref/human_GRCh37.68/bwa/genome.fa > coverage.wig

Those info messages in the beginning will print to the console, as will the output, if it's not piped anywhere, because both stdout and stderr get written to the console. However only stdout should get piped to a different tool. Different shells might also behave differently, what platform are you on?

The header lines:

track type=wiggle_0
#Columns: Pos, Positive Strand, Negative Strand
variableStep chrom=1 span=1

would still be included, currently we're just mimicking the wiggle output.

Thanks,
-Jacob


--
 
---
You received this message because you are subscribed to the Google Groups "igv-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to igv-help+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

PKIDNA

unread,
Jun 6, 2013, 11:49:03 AM6/6/13
to igv-...@googlegroups.com
You are correct, my apologies, should have tested in a real pipe (I am on linux OS) rather than just assess the output on the command line. 

I am looking at two mechanisms for processing the data, either direct pipe, or capturing the output inside a PERL wrapper using backticks.  In the second case, it is not so much as problem as I can just ignore lines that do not start with a numeric....

edward
Reply all
Reply to author
Forward
0 new messages