"genomdat must be numeric"error in DNAcopy Package (Solved)
1
0
Entering edit mode
@jinxinhao1988-14864
Last seen 6.2 years ago

Hi,

I am using Varscan2 to call CNV in tumor-normal samples. After the first two steps, an output.copynumber file and copynumber.called file have been generated. 

Then I followed the protocol to use the DNAcopy package to do the CBS segmentation,

My command line is as follows:

library(DNAcopy)

cn<-read.table("output.copynumber",header=F)

CNA.object <-CNA( genomdat = cn[,6], chrom = cn[,1], maploc = cn[,2], data.type = 'logratio')

But I got the error :

Error in CNA(genomdat = cn[, 6], chrom = cn[, 1], maploc = cn[, 2], data.type = "logratio") :
  genomdat must be numeric

But the data in the coloum 6 of "output.copynumber" are all decimal numbers, so I am confused why I got this error?

Could anybody gave me some suggestions? 

Thank you for your time.

DNAcopy Varscan • 1.7k views
ADD COMMENT
0
Entering edit mode

I was running the following command :

library(DNAcopy)

read.table <- function(file=x,header=FALSE,use.value.labels=TRUE,to.data.frame=TRUE,sep=",", widths=rep(1,36),f=NULL, filetype=tableau,...)

cn <- read.table(correct_copy), header=F)

CNA.object <-CNA( genomdat = as.numeric(cn[,36]), chrom = as.numeric(cn[,36]), maploc = as.numeric(cn[,36]), data.type = 'logratio',sampleid = "E47") ## as.numeric(cn[,36])

and I get rror: unexpected ',' in: " widths=rep(1,36),f=NULL, filetype=tableau,...) cn <- read.table(correct_copy),"

ADD REPLY
0
Entering edit mode
@jinxinhao1988-14864
Last seen 6.2 years ago

Hi,

After I change the "genomdat = cn[,6]" into "genomdat = as.numeric(cn[,6])" and "maploc = cn[,2]" into "maploc = as.numeric(cn[,2])". The problem has been solved.

Thank you.

ADD COMMENT
0
Entering edit mode

please, I have a question, I didn't get over a type of error that's need a genomdat be numeric, the genomdat must be a date frame ....., I'm using the output of HMMcopy " correctreadcount , but didn't work the command line is

genomdat <- sample(correct_copy)

genomdat<- as.data.frame(genomdat)

CNA.object <- CNA(cbind(genomdat$genomdat.E47), genomdat$Chromosome, genomdat$Position, data.type="logratio",sampleid=c("cE47")) could any body had some solutions

ADD REPLY

Login before adding your answer.

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