Source code comments / read_abatch
2
0
Entering edit mode
Arkady ▴ 60
@arkady-2936
Last seen 10.2 years ago
This is probably a pretty trivial question. I know that if I type a function name in R, it'll print the function for me. Unfortunately, it does so without comments. Is there a way to get the function with comments? A related question: how can I access the documentation/comments for internal .Call functions? I tried looking through my R libs dir, but no luck. Particularly, I was wondering about this chunk of code in read.affybatch: headdetails <- .Call("ReadHeader", as.character(filenames[[1]]), PACKAGE = "affyio") dim.intensity <- headdetails[[2]] ref.cdfName <- headdetails[[1]] if (is.null(cdfname)) cdfname <- ref.cdfName # ... exprs <- .Call("read_abatch", filenames, rm.mask, rm.outliers, rm.extra, ref.cdfName, dim.intensity, verbose, PACKAGE = "affyio") ## HERE #1 colnames(exprs) <- samplenames if (!sd) { return(new("AffyBatch", exprs = exprs, cdfName = cdfname, phenoData = phenoData, nrow = dim.intensity[1], ncol = dim.intensity[2], annotation = cleancdfname(cdfname, addcdf = FALSE), description = description, notes = notes)) ## HERE #2 } else { # ... } Shouldn't the line marked HERE #1 be using cdfname, NOT ref.cdfName? The line marked HERE #2 uses cdfname as it (I think) should. I'm guessing this is just me not understanding the code (usually the case). Your help is greatly appreciated. Cheers, John Woods
cdf cdf • 940 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 3 days ago
United States
Arkady wrote: > This is probably a pretty trivial question. > > I know that if I type a function name in R, it'll print the function > for me. Unfortunately, it does so without comments. Is there a way to > get the function with comments? If you want the comments, the easiest way is to download the package source and look at the files in the R directory. > > A related question: how can I access the documentation/comments for > internal .Call functions? I tried looking through my R libs dir, but > no luck. These will be in the src directory of the package source. > > > Particularly, I was wondering about this chunk of code in read.affybatch: > > headdetails <- .Call("ReadHeader", as.character(filenames[[1]]), > PACKAGE = "affyio") > dim.intensity <- headdetails[[2]] > ref.cdfName <- headdetails[[1]] > if (is.null(cdfname)) cdfname <- ref.cdfName > # ... > exprs <- .Call("read_abatch", filenames, rm.mask, rm.outliers, > rm.extra, ref.cdfName, dim.intensity, verbose, PACKAGE = "affyio") ## > HERE #1 > colnames(exprs) <- samplenames > if (!sd) { > return(new("AffyBatch", exprs = exprs, cdfName = cdfname, phenoData > = phenoData, nrow = dim.intensity[1], ncol = dim.intensity[2], > annotation = cleancdfname(cdfname, addcdf = FALSE), description = > description, notes = notes)) ## HERE #2 > } > else { > # ... > } > > > Shouldn't the line marked HERE #1 be using cdfname, NOT ref.cdfName? > The line marked HERE #2 uses cdfname as it (I think) should. I don't think it matters at that point. All that is happening is the raw data are being read into the AffyBatch object. If one is using a non-standard cdf then it is when you compute expression values that it is important to know what cdfenv to use, and as you note, the AffyBatch gets the correct cdfname. Best, Jim > > I'm guessing this is just me not understanding the code (usually the case). > > Your help is greatly appreciated. > > > Cheers, > John Woods > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Hildebrandt Lab 8220D MSRB III 1150 W. Medical Center Drive Ann Arbor MI 48109-0646 734-936-8662
ADD COMMENT
0
Entering edit mode
This got taken off-list (please don't do that!). Here is the further exchange: John O. Woods wrote: >> You wrote: >> >> If you want the comments, the easiest way is to download the package >> source and look at the files in the R directory. >> > > This is why this is such a trivial question. > > How do I download the package source? Naturally I could just go get > the tarball, but is there an R command to do it? LOL. This reminds me of a particular fortune: > fortune("Yoda") Evelyn Hall: I would like to know how (if) I can extract some of the information from the summary of my nlme. Simon Blomberg: This is R. There is no if. Only how. -- Evelyn Hall and Simon 'Yoda' Blomberg R-help (April 2005) So the answer is 'yes, of course'. You want: setRepositories() #choose bioc software then download.packages("affy", ".", type = "source") Best, Jim James W. MacDonald wrote: > Arkady wrote: >> This is probably a pretty trivial question. >> >> I know that if I type a function name in R, it'll print the function >> for me. Unfortunately, it does so without comments. Is there a way to >> get the function with comments? > > If you want the comments, the easiest way is to download the package > source and look at the files in the R directory. > >> >> A related question: how can I access the documentation/comments for >> internal .Call functions? I tried looking through my R libs dir, but >> no luck. > > These will be in the src directory of the package source. > >> >> >> Particularly, I was wondering about this chunk of code in read.affybatch: >> >> headdetails <- .Call("ReadHeader", as.character(filenames[[1]]), >> PACKAGE = "affyio") >> dim.intensity <- headdetails[[2]] >> ref.cdfName <- headdetails[[1]] >> if (is.null(cdfname)) cdfname <- ref.cdfName >> # ... >> exprs <- .Call("read_abatch", filenames, rm.mask, rm.outliers, >> rm.extra, ref.cdfName, dim.intensity, verbose, PACKAGE = "affyio") ## >> HERE #1 >> colnames(exprs) <- samplenames >> if (!sd) { >> return(new("AffyBatch", exprs = exprs, cdfName = cdfname, phenoData >> = phenoData, nrow = dim.intensity[1], ncol = dim.intensity[2], >> annotation = cleancdfname(cdfname, addcdf = FALSE), description = >> description, notes = notes)) ## HERE #2 >> } >> else { >> # ... >> } >> >> >> Shouldn't the line marked HERE #1 be using cdfname, NOT ref.cdfName? >> The line marked HERE #2 uses cdfname as it (I think) should. > > I don't think it matters at that point. All that is happening is the raw > data are being read into the AffyBatch object. If one is using a > non-standard cdf then it is when you compute expression values that it > is important to know what cdfenv to use, and as you note, the AffyBatch > gets the correct cdfname. > > Best, > > Jim > > > >> >> I'm guessing this is just me not understanding the code (usually the >> case). >> >> Your help is greatly appreciated. >> >> >> Cheers, >> John Woods >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor > -- James W. MacDonald, MS Biostatistician UMCCC cDNA and Affymetrix Core University of Michigan 1500 E Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623
ADD REPLY
0
Entering edit mode
Ben Bolstad ★ 1.2k
@ben-bolstad-1494
Last seen 7.3 years ago
It is doing the right thing. Or at least what I think is the right thing, since I (hazardly) wrote/designed that code. What it is attempting to do is pass down a string identifying the CDF file used to generate the CEL files (not the one you associate it with as an AffyBatch for work in BioC), so that each and every file read agrees (ie you are not trying to mix and match CEL files that should not be grouped together). Ben > > > Particularly, I was wondering about this chunk of code in read.affybatch: > > headdetails <- .Call("ReadHeader", as.character(filenames[[1]]), > PACKAGE = "affyio") > dim.intensity <- headdetails[[2]] > ref.cdfName <- headdetails[[1]] > if (is.null(cdfname)) cdfname <- ref.cdfName > # ... > exprs <- .Call("read_abatch", filenames, rm.mask, rm.outliers, > rm.extra, ref.cdfName, dim.intensity, verbose, PACKAGE = "affyio") ## > HERE #1 > colnames(exprs) <- samplenames > if (!sd) { > return(new("AffyBatch", exprs = exprs, cdfName = cdfname, phenoData > = phenoData, nrow = dim.intensity[1], ncol = dim.intensity[2], > annotation = cleancdfname(cdfname, addcdf = FALSE), description = > description, notes = notes)) ## HERE #2 > } > else { > # ... > } > > > Shouldn't the line marked HERE #1 be using cdfname, NOT ref.cdfName? > The line marked HERE #2 uses cdfname as it (I think) should. > > I'm guessing this is just me not understanding the code (usually the case). > > Your help is greatly appreciated. > > > Cheers, > John Woods > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENT

Login before adding your answer.

Traffic: 508 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