On Mon, Aug 3, 2009 at 7:17 PM, Aleksandr Levchuk <alevchuk@gmail.com>wrote:

> Dear BioC developers,
>
> Some of my sequences come from non-disk sources:
>  Network
>  Un-compressors
>  Other tool arranged as piplines
>
> I was able to stream such sources into R without touching the disk:
> =========================
> #!/usr/bin/env Rscript
>
> library(Biostrings)
> s <- read.AAStringSet("/dev/stdin", "fasta")
>
> #
> # operate on s
> #
> =========================
>
> Assuming the above file is called my.R, I can run:
>  chmod +x my.R
>  cat my.fasta.gz |  gzip -dc | ./my.R
>
> Very powerful and flexible.
>
>
> But I would like to would eliminate my "hackish" /dev/stdin fifo approach.
>

What about R connections? There's a gzfile() connection that would handle
the case above, as well as network connections, url().

Just as untested example:
s <- read.AAStringSet(gzfile("my.fasta.gz"), "fasta")


>
> I noticed that functions 'write.XStringSet' and 'write.XStringViews'
> have an official documented way that allows writing to standard
> output.
>
>
> Would it be difficult to add an argument to the Biostrings read
> functions to allow reading sequences from standard input?
>
>
> Alex
>
> --
> ---------------------------------------------------------------
> Aleksandr Levchuk
> Bioinformatic Systems and Databases
>
> University of California, Riverside
> Institute for Integrative Genome Biology
>
> _______________________________________________
> Bioc-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>

	[[alternative HTML version deleted]]

