This is a test version of Biostars. For the public version, visit https://www.biostars.org.
VARScan2 Error, CBS segmentation by "DNACopy"

I am analysing copy number from from a sample through VARScan2 following this manual where for doing "Segmentation and classification" I am using DNACopy and following below mentioned commands:

library(DNAcopy)
cn <- read.table("your.cn.file",header=F)
CNA.object <-CNA( genomdat = cn[,6], chrom = cn[,1], maploc = cn[,2], data.type = 'logratio')
CNA.smoothed <- smooth.CNA(CNA.object)

but it shows me error:

Error in CNA(genomdat = cn[, 6], chrom = cn[, 1], maploc = cn[, 2], data.type = "logratio") : 
  could not find function "CNA"

So I installed CNA by install.packages("cna") but still received the same error. It could be a silly fix, but it will be great if I can get some help. Thank you

r cnv

1 answer

It would be more advisable to install from Bioconductor:

source("http://bioconductor.org/biocLite.R")

#Secure http
#source("https://bioconductor.org/biocLite.R")

#Install
biocLite("DNAcopy")

#Load the package
require(CNA)

#Check if the function now exists (typing it this way will show the function code)
CNA

#Implicitly specify CNA function from DNAcopy package
DNAcopy::CNA

The last way of using the function, i.e., DNAcopy::CNA, may be necessary if some other loaded package has a function by the same name (namespace issue).

Kevin

Log in to answer this question.