Entering edit mode
El
•
0
@el-24188
Last seen 4.0 years ago
I was running this function
CNA <- function(genomdat, chrom, maploc, data.type=c("logratio","binary"),
sampleid=NULL, presorted=FALSE)
{
if (is.data.frame(genomdat)) genomdat <- as.matrix(genomdat)
if (!is.numeric(genomdat)) stop("genomdat must be numeric")
if (!is.numeric(maploc)) stop("maploc must be numeric")
data.type <- match.arg(data.type)
ina <- (!is.na(chrom) & is.finite(maploc))
if (sum(!ina)>0)
warning("markers with missing chrom and/or maploc removed\n")
if (!presorted) {
sortindex <- which(ina)[order(chrom[ina], maploc[ina])]
} else {
sortindex <- which(ina)
}
if (is.factor(chrom)) chrom <- as.character(chrom)
# added to allow arrays of single dimension - results from data.frame ops
if (is.array(genomdat)) {
if (length(dim(genomdat)) == 1) {
genomdat <- as.matrix(genomdat)
}
}
if (is.vector(genomdat)) genomdat <- as.matrix(genomdat)
if (!missing(sampleid)) {
if (length(sampleid) != ncol(genomdat)) {
warning("length(sampleid) and ncol(genomdat) differ, names ignored\n")
sampleid <- paste("Sample", 1:ncol(genomdat))
}
} else {
sampleid <- paste("Sample", 1:ncol(genomdat))
}
colnames(genomdat) <- sampleid
zzz <- data.frame(chrom=I(chrom), maploc=maploc, genomdat)
zzz <- zzz[sortindex,]
# check for duplicate probes (i.e. repeated maploc within a chromosome)
if (length(ii <- which(diff(maploc)==0)) > 0) {
if (any(chrom[ii]==chrom[ii+1])) warning("array has repeated maploc positions\n")
}
attr(zzz, "data.type") <- data.type
class(zzz) <- c("CNA","data.frame")
zzz
}
# Lead the RDocumentaion packages
library(RDocumentation)
readfile <- function(file=NULL,header=TRUE,use.value.labels=TRUE,to.data.frame=TRUE,sep=",",
widths=rep(1,36),f=NULL, filetype=NULL,...)
cn <- readfile("/Users/mac/Desktop/NGS-/ERR439247-pe.wig",header=TRUE)
CNA.object <-CNA( genomdat = cn[1,36], chrom = cn[1,36], maploc = cn[1,36], data.type = 'logratio',sampleid = "E47") ## cn[1,36]`
and I get "genomdat must be numeric"
"Error in cn[1, 36] : incorrect number of dimensions
Called from: is.data.frame(genomdat)"
how should I fix it thanks after all
i get list of 1 $ ch: chr(0)
So, it's empty?
Can you please re-check:
CNA()
CNA()
(via https://www.rdocumentation.org/packages/DNAcopy/versions/1.46.0/topics/CNA)If it helps, please first follow the manual of DNAcopy and / or the vignette, so that you can be sure how to first successfully run the package with the authors' test data. For example, there is some useful code to test here: https://bioconductor.org/packages/release/bioc/vignettes/DNAcopy/inst/doc/DNAcopy.pdf
Kevin
I was running the following command: (DNAcopy)
how should I fix it Thank you for all
Please confirm that you have successfully completed the example(s) in the manual for this package.
please, one question ? I have used the output of correctReadCount of HMMcopy like an input of DNAcopy, it's gonna workable, I got some modification like convert the data.table to data frame.....
As you fail to answer my simple questions, I cannot help you anymore.
thank you
hello Mr Kevin I hope you doing good, I got a file " 1106 observations of 11 variable " is output corrected read's HMMcopy package, for leading to CNV I need segmentation step for my data, I was trying to get it input of DNA copy but it didn't work, if someone can help with getting over thank you so much
Sorry, I had asked you twice already if you had successfully completed the examples in the manual? - https://www.rdocumentation.org/packages/DNAcopy/versions/1.46.0/topics/CNA
By successfully completing these steps, it will help you to understand how the package functions work.
thank you so much it's gonna help, and thank you for your time Mr