[Bioc-devel] Reading FASTQ/BAM from open file handle?

Martin Morgan mtmorgan at fhcrc.org
Tue Dec 4 23:47:56 CET 2012

On 12/04/2012 01:27 PM, Ryan C. Thompson wrote:
> Hi all,
> I'm currently experimenting with using quip
> (https://github.com/dcjones/quip#readme) to save disk space when storing FASTQ
> and BAM files. One thing that would be nice is to read quip-compressed FASTQ or
> BAM files directly into R. Obviously direct support for reading quip compression
> would be ideal, but in the short term, quip supports decompression to standard
> output, so if I could have R read FASTQ or BAM data from an open file handle, I
> could pipe the decompressed output to R's FASTQ or BAM reader functions. Does
> anyone know if this is possible?

ShortRead::FastqStreamer works with R connections, so for instance after 

   cmd = sprintf("cat %s", fl)
   p = pipe(cmd)
   strm = FastqStreamer(p, 50)

Rsamtools::scanBam is really expecting to read from an (indexed) bam file with 
random access.


> -Ryan Thompson
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel

Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793

More information about the Bioc-devel mailing list