git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/branches/RELEASE_2_6/madman/Rpacks/crlmm@49103 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -939,28 +939,35 @@ preprocessInfinium2 <- function(XY, mixtureSampleSize=10^5, |
939 | 939 |
SMEDIAN <- getVarInEnv("SMEDIAN") |
940 | 940 |
theKnots <- getVarInEnv("theKnots") |
941 | 941 |
gns <- getVarInEnv("gns") |
942 |
- |
|
943 |
- # separate out copy number probes |
|
944 |
- npIndex = getVarInEnv("npProbesFid") |
|
945 |
- nprobes = length(npIndex) |
|
946 | 942 |
narrays = ncol(XY) |
947 |
- A <- matrix(as.integer(exprs(channel(XY, "X"))[npIndex,]), nprobes, narrays) |
|
948 |
- B <- matrix(as.integer(exprs(channel(XY, "Y"))[npIndex,]), nprobes, narrays) |
|
949 |
- |
|
950 |
- # new lines below - useful to keep track of zeroed out probes |
|
951 |
- zero <- matrix(as.integer(exprs(channel(XY, "zero"))[npIndex,]), nprobes, narrays) |
|
952 |
- |
|
953 |
- colnames(A) <- colnames(B) <- colnames(zero) <- sns |
|
954 |
- rownames(A) <- rownames(B) <- rownames(zero) <- names(npIndex) |
|
955 | 943 |
|
956 |
- cnAB = list(A=A, B=B, zero=zero, sns=sns, gns=names(npIndex), cdfName=cdfName) |
|
957 | 944 |
if(save.it & !missing(cnFile)) { |
958 |
- t0 <- proc.time() |
|
959 |
- save(cnAB, file=cnFile) |
|
960 |
- t0 <- proc.time()-t0 |
|
961 |
- if(verbose) message("Used ", round(t0[3],1), " seconds to save ", cnFile, ".") |
|
945 |
+ ## separate out copy number probes |
|
946 |
+ npIndex = getVarInEnv("npProbesFid") |
|
947 |
+ nprobes = length(npIndex) |
|
948 |
+ if(length(nprobes > 0)){ |
|
949 |
+ open(XY@assayData$X) |
|
950 |
+ open(XY@assayData$Y) |
|
951 |
+ open(XY@assayData$zero) |
|
952 |
+ |
|
953 |
+ A <- matrix(as.integer(exprs(channel(XY, "X"))[npIndex,]), nprobes, narrays) |
|
954 |
+ B <- matrix(as.integer(exprs(channel(XY, "Y"))[npIndex,]), nprobes, narrays) |
|
955 |
+ |
|
956 |
+ ## new lines below - useful to keep track of zeroed out probes |
|
957 |
+ zero <- matrix(as.integer(exprs(channel(XY, "zero"))[npIndex,]), nprobes, narrays) |
|
958 |
+ |
|
959 |
+ colnames(A) <- colnames(B) <- colnames(zero) <- sns |
|
960 |
+ rownames(A) <- rownames(B) <- rownames(zero) <- names(npIndex) |
|
961 |
+ |
|
962 |
+ cnAB = list(A=A, B=B, zero=zero, sns=sns, gns=names(npIndex), cdfName=cdfName) |
|
963 |
+ |
|
964 |
+ t0 <- proc.time() |
|
965 |
+ save(cnAB, file=cnFile) |
|
966 |
+ t0 <- proc.time()-t0 |
|
967 |
+ if(verbose) message("Used ", round(t0[3],1), " seconds to save ", cnFile, ".") |
|
968 |
+ rm(cnAB, B, zero) |
|
969 |
+ } |
|
962 | 970 |
} |
963 |
- rm(cnAB, B, zero) |
|
964 | 971 |
|
965 | 972 |
# next process snp probes |
966 | 973 |
snpIndex = getVarInEnv("snpProbesFid") |