git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/affxparser@74592 bc3139a8-67e5-0310-9ffc-ced21a209358
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/affxparser@22355 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -1,13 +1,53 @@ |
1 |
+#########################################################################/** |
|
2 |
+# @RdocFunction writeCdfHeader |
|
3 |
+# |
|
4 |
+# @title "Writes a CDF header" |
|
5 |
+# |
|
6 |
+# @synopsis |
|
7 |
+# |
|
8 |
+# \description{ |
|
9 |
+# @get "title". |
|
10 |
+# \emph{This method is not indended to be used explicitly. |
|
11 |
+# To write a CDF, use @see "writeCdf" instead.} |
|
12 |
+# } |
|
13 |
+# |
|
14 |
+# \arguments{ |
|
15 |
+# \item{con}{An open @connection to which nothing has been written.} |
|
16 |
+# \item{cdfHeader}{A CDF header @list structure.} |
|
17 |
+# \item{unitNames}{A @character @vector of all unit names.} |
|
18 |
+# \item{qcUnitLengths}{An @integer @vector of all the number of bytes |
|
19 |
+# in each of the QC units.} |
|
20 |
+# \item{unitLengths}{An @integer @vector of all the number of bytes |
|
21 |
+# in each of the (ordinary) units.} |
|
22 |
+# \item{verbose}{An @integer specifying how much verbose details are |
|
23 |
+# outputted.} |
|
24 |
+# } |
|
25 |
+# |
|
26 |
+# \value{ |
|
27 |
+# Returns nothing. |
|
28 |
+# } |
|
29 |
+# |
|
30 |
+# @author |
|
31 |
+# |
|
32 |
+# \seealso{ |
|
33 |
+# This method is called by @see "writeCdf". |
|
34 |
+# See also @see "writeCdfQcUnits" and @see "writeCdfUnits". |
|
35 |
+# } |
|
36 |
+# |
|
37 |
+# @keyword "file" |
|
38 |
+# @keyword "IO" |
|
39 |
+# @keyword "internal" |
|
40 |
+#*/######################################################################### |
|
1 | 41 |
writeCdfHeader <- function(con, cdfHeader, unitNames, qcUnitLengths, unitLengths, verbose=0) { |
2 | 42 |
if (verbose >= 1) |
3 | 43 |
cat(" Writes CDF header and unit names...\n"); |
4 | 44 |
|
5 | 45 |
.initializeCdf(con = con, |
6 |
- nunits = cdfHeader$nunits, |
|
7 |
- nqcunits = cdfHeader$nqcunits, |
|
8 |
- refseq = cdfHeader$refseq, |
|
9 |
- nrows = cdfHeader$nrows, |
|
10 |
- ncol = cdfHeader$ncols, |
|
46 |
+ nRows = cdfHeader$nrows, |
|
47 |
+ nCols = cdfHeader$ncols, |
|
48 |
+ nUnits = cdfHeader$nunits, |
|
49 |
+ nQcUnits = cdfHeader$nqcunits, |
|
50 |
+ refSeq = cdfHeader$refseq, |
|
11 | 51 |
unitnames = unitNames, |
12 | 52 |
qcUnitLengths = qcUnitLengths, |
13 | 53 |
unitLengths = unitLengths |
... | ... |
@@ -20,6 +60,8 @@ writeCdfHeader <- function(con, cdfHeader, unitNames, qcUnitLengths, unitLengths |
20 | 60 |
|
21 | 61 |
############################################################################ |
22 | 62 |
# HISTORY: |
63 |
+# 2007-02-01 /HB |
|
64 |
+# o Added Rdoc comments. |
|
23 | 65 |
# 2007-01-10 /HB |
24 | 66 |
# o Added writeCdfHeader(), writeCdfQcUnits() and writeCdfUnits(). With |
25 | 67 |
# these it is now possible to build up the CDF in chunks. |
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/affxparser@21888 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,62 @@ |
1 |
+writeCdfHeader <- function(con, cdfHeader, unitNames, qcUnitLengths, unitLengths, verbose=0) { |
|
2 |
+ if (verbose >= 1) |
|
3 |
+ cat(" Writes CDF header and unit names...\n"); |
|
4 |
+ |
|
5 |
+ .initializeCdf(con = con, |
|
6 |
+ nunits = cdfHeader$nunits, |
|
7 |
+ nqcunits = cdfHeader$nqcunits, |
|
8 |
+ refseq = cdfHeader$refseq, |
|
9 |
+ nrows = cdfHeader$nrows, |
|
10 |
+ ncol = cdfHeader$ncols, |
|
11 |
+ unitnames = unitNames, |
|
12 |
+ qcUnitLengths = qcUnitLengths, |
|
13 |
+ unitLengths = unitLengths |
|
14 |
+ ); |
|
15 |
+ |
|
16 |
+ if (verbose >= 1) |
|
17 |
+ cat(" Writes CDF header and unit names...done\n"); |
|
18 |
+} # writeCdfHeader() |
|
19 |
+ |
|
20 |
+ |
|
21 |
+############################################################################ |
|
22 |
+# HISTORY: |
|
23 |
+# 2007-01-10 /HB |
|
24 |
+# o Added writeCdfHeader(), writeCdfQcUnits() and writeCdfUnits(). With |
|
25 |
+# these it is now possible to build up the CDF in chunks. |
|
26 |
+# o Removed obsolete arguments 'addName' and 'addPositions' and all related |
|
27 |
+# code. Internal variable 'positions' is not needed anymore. |
|
28 |
+# There are no more seek():s in the code. |
|
29 |
+# o Removed obsolete .writeCdfUnit2(). |
|
30 |
+# o Now only every 1000th unit (instead of 100th) is reported. It is now |
|
31 |
+# also a count down. |
|
32 |
+# 2006-12-18 /KS |
|
33 |
+# o Make global replacement "block" -> "group" to maintain consistency |
|
34 |
+# with other code, pursuant to communication from KH. |
|
35 |
+# 2006-10-25 /HB (+KS) |
|
36 |
+# o BUG FIX: .initializeCdf() was writing false file offset for QC units |
|
37 |
+# when the number QC nunits were zero. This would core dump readCdfNnn(). |
|
38 |
+# 2006-09-21 /HB |
|
39 |
+# o BUG FIX: The 'atom' and 'indexpos' fields were swapped. |
|
40 |
+# o Now suppressing warnings "writeChar: more characters requested..." in |
|
41 |
+# writeCdf(). |
|
42 |
+# 2006-09-11 /HB |
|
43 |
+# o BUG FIX: nrows & ncols were swapped in the CDF header. |
|
44 |
+# 2006-09-09 /HB |
|
45 |
+# o Updated writeCdf() has been validate with compareCdfs() on a few arrays. |
|
46 |
+# o With the below "optimizations" writeCdf() now writes Hu6800.CDF with |
|
47 |
+# units in 130s compared to 140s. |
|
48 |
+# o Now initializeCdf() dumps all unit names at once by first building a |
|
49 |
+# raw vector. This is now much faster than before. |
|
50 |
+# o Now writeCdf() does not seek() around in the file anymore. This should |
|
51 |
+# speed up writing at least a bit. |
|
52 |
+# o Made some optimization, which speeds up the writing a bit. Jumping |
|
53 |
+# around in the file with seek() is expensive and should be avoided. |
|
54 |
+# o Rename writeUnit() to writeCdfUnit() and same for the QC function. |
|
55 |
+# o Added more verbose output and better errror messages for writeCdf(). |
|
56 |
+# 2006-09-07 /HB |
|
57 |
+# o Maybe initalizeCdf(), writeUnit(), and writeQcUnit() should be made |
|
58 |
+# private functions of this package. |
|
59 |
+# o Removed textCdf2binCdf() skeleton. See convertCdf() instead. |
|
60 |
+# o Updated writeCdf() such that the connection is guaranteed to be closed |
|
61 |
+# regardless. |
|
62 |
+############################################################################ |