Hi,
I am trying to run ChiPseeker for ENCODE datasets and been getting the following error:
"Error in unlist(metadata(TXDB)) :
error in evaluating the argument 'x' in selecting a method for function 'unlist': Error in sqliteSendQuery(con, statement, bind.data) :
expired SQLiteConnection"
The code I have been running is:
> files=read.table("epiGenomeEncodeFiles")
> files=as.vector(files[,1])
>
> peakAn=function(x = files){
+ library(ChIPseeker)
+ library(org.Hs.eg.db)
+ library(TxDb.Hsapiens.UCSC.hg19.knownGene)
+
+ getGenomicAnnoStat <- function(peakAnno) {
+ if ( class(peakAnno) == "GRanges" )
+ peakAnno <- as.data.frame(peakAnno)
+ anno <- peakAnno$annotation
+ anno <- sub(" \\(.+", "", anno)
+
+ ## count frequency
+ anno.table <- table(anno)
+
+ ## calculate ratio
+ anno.ratio <- anno.table/ sum(anno.table) * 100
+ anno.df <- as.data.frame(anno.ratio)
+ colnames(anno.df) <- c("Feature", "Frequency")
+ return(anno.df)
+ }
+
+
+ annotatedPeak <- annotatePeak(x, tssRegion = c(-4000, 4000), TxDb = TxDb.Hsapiens.UCSC.hg19.knownGene, annoDb = "org.Hs.eg.db")
+
+ outF = gsub("Peak4_4", ".CSpeaks", x)
+ write.table(as.data.frame(annotatedPeak), file=outF, sep="\t")
+ }
>
> data1=lapply(files, peakAn)
Please suggest if the error am getting is due to the difference in the format of input files (ENCODE files), I am trying to run the code for , or it is an issue with annotatedPeak function. Any suggestions in this regard would be helpful.
Thanks,
Snigdha.