gpr.gz
3
0
Entering edit mode
@rafael-a-irizarry-205
Last seen 10.3 years ago
hi! any recs on how to deal with gzipped gpr files? if possible id like to read them into bioc without unzipping them first. -r
• 1.6k views
ADD COMMENT
0
Entering edit mode
rgentleman ★ 5.5k
@rgentleman-7725
Last seen 9.6 years ago
United States
Hi, Does gzfile not do what you want? > apropos("gz") [1] "gzcon" "gzfile" Robert Rafael A. Irizarry wrote: > hi! any recs on how to deal with gzipped gpr files? if possible id like to > read them into bioc without unzipping them first. > -r > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > -- Robert Gentleman, PhD Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M2-B876 PO Box 19024 Seattle, Washington 98109-1024 206-667-7700 rgentlem at fhcrc.org
ADD COMMENT
0
Entering edit mode
yes, but then i need to hack the existing parsers. maybe instead of just me doing it, the maintainer(s) can do it for everybody? see Sean's email for what he suggests. -r On Thu, 13 Oct 2005, Robert Gentleman wrote: > Hi, > Does gzfile not do what you want? > > > apropos("gz") > [1] "gzcon" "gzfile" > > Robert > > Rafael A. Irizarry wrote: > > hi! any recs on how to deal with gzipped gpr files? if possible id like to > > read them into bioc without unzipping them first. > > -r > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor at stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > > >
ADD REPLY
0
Entering edit mode
FYI: I had some problems with GPR files, read.table, and an gzfile when I tried this out two years ago in aroma. I cannot remember what the exact problem was (some kind of read.table error), but I ended up gunzipping to temporary file in my parser/reader. My code is now doing if (regexpr("[.]gz$", filename) != -1) { tmpname <- tempfile(); n <- gunzip(filename, tmpname); filename <- tmpname; on.exit(file.remove(tmpname)); } gunzip() is simply a function that reads a gzfile and writes to a regular file connection. Less efficient for now, but at least you can keep you files gzipped. The read.table problem might been fixed now, I haven't tried. /Henrik Rafael A. Irizarry wrote: > yes, but then i need to hack the existing parsers. maybe instead of just > me doing it, the maintainer(s) can do it for everybody? see Sean's email > for what he suggests. > > -r > > On Thu, 13 Oct 2005, Robert Gentleman wrote: > > >>Hi, >> Does gzfile not do what you want? >> >> > apropos("gz") >>[1] "gzcon" "gzfile" >> >>Robert >> >>Rafael A. Irizarry wrote: >> >>>hi! any recs on how to deal with gzipped gpr files? if possible id like to >>>read them into bioc without unzipping them first. >>>-r >>> >>>_______________________________________________ >>>Bioconductor mailing list >>>Bioconductor at stat.math.ethz.ch >>>https://stat.ethz.ch/mailman/listinfo/bioconductor >>> >> >> > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > >
ADD REPLY
0
Entering edit mode
@sean-davis-490
Last seen 4 months ago
United States
On 10/13/05 2:39 PM, "Rafael A. Irizarry" <ririzarr at="" jhsph.edu=""> wrote: > hi! any recs on how to deal with gzipped gpr files? if possible id like to > read them into bioc without unzipping them first. Rafael, Look at ?gzfile. Will that do what you want? Txtfile <- readLines(gzfile('txtfile.gz')) Sean
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 4 months ago
United States
On 10/13/05 2:50 PM, "Rafael A. Irizarry" <ririzarr at="" jhsph.edu=""> wrote: > but then how to create an RGlist or marrayRaw? do i have to > rewrite or hack the gpr parsers? > > On Thu, 13 Oct 2005, Sean Davis wrote: > >> On 10/13/05 2:39 PM, "Rafael A. Irizarry" <ririzarr at="" jhsph.edu=""> wrote: >> >>> hi! any recs on how to deal with gzipped gpr files? if possible id like to >>> read them into bioc without unzipping them first. >> >> Rafael, >> >> Look at ?gzfile. Will that do what you want? >> >> Txtfile <- readLines(gzfile('txtfile.gz')) >> >> Sean >> > Rafael, I think that would be the case, yes. I haven't tried it, but I think you might be able to get away with modifying only three lines in the readGAL function (noted below). I may have missed some and I haven't tested, but I think these should work. galfile <- dir(path = path, pattern = "\\.gal$") galfile <- dir(path = path, pattern = "\\.gal.gz$") chunk <- readLines(galfile, n = 100) chunk <- readLines(gzfile(galfile), n = 100) gal <- read.table(galfile, header = header, sep = sep, quote = quote, skip = skip, as.is = as.is, comment.char = "", ...) gal <- read.table(gzfile(galfile), header = header, sep = sep, quote = quote, skip = skip, as.is = as.is, comment.char = "", ...) Sean
ADD COMMENT

Login before adding your answer.

Traffic: 768 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6