methylKit icon indicating copy to clipboard operation
methylKit copied to clipboard

Problemns when annotating

Open iramai opened this issue 4 years ago • 2 comments
trafficstars

Hi! I have followed the protocol of methylkit, but when I arrive to the annotation step, I have an error, related to themethylobject conversion to GRanges. I write here, few lines of the followed commands if it helps finding the reason of the error.

library("methylKit") file.list <- list(("D:/Met-Seq.Analisia/5-methylDackel/R1C_1/R1C_1_sorted_CpG.methylKit"), ("D:/Met-Seq.Analisia/5-methylDackel/R2C_1/R2C_1_sorted_CpG.methylKit"), ("D:/Met-Seq.Analisia/5-methylDackel/R1C_1/R1C_1_sorted_CpG.methylKit"), ("D:/Met-Seq.Analisia/5-methylDackel/R2C_1/R2C_1_sorted_CpG.methylKit")) myobjDB=methRead(file.list, sample.id=list("C1", "C2", "M1", "M2"), assembly="mm10", treatment=c(0,0,1,1), context="CpG", mincov = 10, dbtype="tabix", dbdir="methylDB") filtered.myobj=filterByCoverage(myobj,lo.count=10,lo.perc=NULL, hi.count=NULL,hi.perc=99.9) newObj.median=normalizeCoverage(filtered.myobj, method="median") meth.norm=unite(newObj.median, destrand=FALSE) PCASamples(meth.norm, screeplot=TRUE) myDiff.meth=calculateDiffMeth(meth.norm)

--> Then I have downloaded the gene annotation file fron the table browser of UCSC

  • Genome: Mouse
  • Assembly: mm10
  • Group: Genes and Gene predictions
  • Track: NCBI RefSeq (there is not only a RefSeq gene option)
  • Output format: BED-browser extensible data
  • Output file: mm10.refseq.genes.bed.txt
  • Get ouptut

--> And followed the annotation steps:

library(genomation) gene.obj=readTranscriptFeatures(system.file("extdata", "mm10.refseq.genes.bed.txt", package = "methylKit")) Reading the table... Calculating intron coordinates... Calculating exon coordinates... Calculating TSS coordinates... Calculating promoter coordinates... Outputting the final GRangesList... annotateWithGeneParts(as(myDiff.meth.norm,"GRanges"),gene.obj) Uncompressing file. Reading file. Error in h(simpleError(msg, call)) : error in evaluating the argument 'target' in selecting a method for function 'annotateWithGeneParts': 'seqnames' must have the length of the object to construct (3900663) or length 1 Además: Warning message: In data.table::fread(file = filepath, ...) : Detected 1 column names but the data has 7 columns (i.e. invalid file). Added 6 extra default column names at the end.

And this is the error. Please can you help me solving it? Thanks in advance.

Iraia

iramai avatar Feb 05 '21 07:02 iramai

Hi @iramai

Could you please send us the output of your session info, so we know which version of methylKit you are using.

Best, Alex

alexg9010 avatar Apr 14 '21 01:04 alexg9010

Hi alex, I had not realized that you had answered me! I did not finally solve the problem with the annotation, but I have been working without them and comparing the start-end positions in the genome of more interesting regions to identified which gene do they belong. When I have a while I will try again the that pipeline and try to write you with the session info. Thanks!

iramai avatar Jun 02 '21 14:06 iramai