epigen / RnBeads

Git working Repo synced to the Bioconductor: http://bioconductor.org/packages/devel/bioc/html/RnBeads.html
https://rnbeads.org/
7 stars 8 forks source link

error: unsupported annotation type in 'annotation' function for hg38 #25

Closed ArashDepp closed 2 years ago

ArashDepp commented 2 years ago

Hi. While RnBeads2 claims to support the annotations for hg38, using RnBeads.hg38 package, I wonder if this is correctly supporting the use of hg38. I am facing one error and have one additional concern as explained below:

  1. I have RnBeadSet object named methyaltionData containing beta values, which I created using RnBeadSet command. The summary of this object is shown here:

image

Then I attempt to run annotation command as follows

gg1 <- annotation(methylationData, type = "sites", add.names = FALSE, include.regions = FALSE)

image

Please note that I had set the assembly type of this object as hg38 using methyaltionData@assembly = "hg38"

Could you take a look and help me to troubleshoot it. This works perfectly fine with hg19 assembly, which is assigned by default when I creased methyaltionData object using RnBeadSet.

  1. As I glanced the code on the source code page (https://rdrr.io/bioc/RnBeads/src/R/annotations.R), assembly was already set to hg19 in some of the functions. So I just wonder if hg38 support is properly implemented. Please let me know.

would appreciate your response and thank you.

schmic05 commented 2 years ago

Hi @ArashDepp,

This error does occur, when the associated annotation package RnBeads.hg38 is not available in your R libraries. You should be able to solve it by simply installing the package: BiocManager::install('RnBeads.hg38') To avoid further issues with missing packages, we recommend that you use our installation script from here: source('https://rnbeads.org/data/install.R') Further information can be found on our website rnbeads.org. Best, Michael

ArashDepp commented 2 years ago

Hi.

Thank you for the response. I do have 'RnBeads.hg38' installed on my system rnb.get.assemblies() shows that both hg19 and hg38 are present. But following your recommendation, i uninstalled and reinstalled the package from the github link that you shared, and it automatically installed the genome supports available. But despite that, I got the same error. To add more information, rnb.get.annotation is working for both hg19 and hg38 but annotation doesnt work.

I think problem lies in the annotation function itself, where if the assembly is hg38 (based on the information stored in methylationData@assembly, for my RnBeadSet object named methylationData), then function is not working properly. Please let me know. Thank you.

schmic05 commented 2 years ago

This is really odd and we never faced this issue. Could you somehow share your dataset with us such that we can dig into the problem?

ArashDepp commented 2 years ago

Hello Michael, Thanks for the reply. Please find the google drive link for a sample data. https://drive.google.com/file/d/1i1KGkB_9swToIsSmMHORcBhDCf6XNQyD/view?usp=sharing

You may use the following snippet for loading and testing the error. ` library(RnBeads) library(ff)

fileName <- "tempMethylationData.txt" phenoData <- "tempPhenoData.txt"

ff_matrix <- read.table.ffdf(file = fileName, sep = "\t", header = T, check.names = F, row.names = 1) phenoData <- read.table(phenoData, sep = "\t", header = T, check.names = T, row.names = 1) names(ff_matrix) <- gsub("\.", "-", names(ff_matrix))

ff_matrix <- ff_matrix[ ,names(ff_matrix) %in% phenoData$cases] ff_matrix <- data.matrix(ff_matrix) phenoData <- phenoData[phenoData$cases %in% colnames(ff_matrix), ]

methylationData <- RnBeadSet(pheno = phenoData, betas = ff_matrix, p.values = NULL, bead.counts = NULL, qc = NULL, platform = "450k", summarize.regions = TRUE, region.types = rnb.region.types.for.analysis("hg38"), useff = T

useff = rnb.getOption("disk.dump.big.matrices")

)

methylationData@assembly ##### SURPRISINGLY THIS DISPLAYS HG19, THOUGH I PASSED IN HG38 IN THE REGION.TYPES OPTION IN THE ABOVE CALL

methylationData@assembly <- "hg38" #### change assembly names as I want to work with hg38

following gives an error

annotation(methylationData, type = "sites", add.names = FALSE, include.regions = FALSE)

`

Please take a look and appreciate your help. thank you once again

schmic05 commented 2 years ago

Thanks for sending this. I now see the problem in your analysis. Analyzing Illumina microarray data is only possible with the RnBeads.hg19, since Illumina only provides its manifest file with hg19. If you want to map the sites to hg38, you'll have to use a tool such as UCSC liftover (https://genome.ucsc.edu/cgi-bin/hgLiftOver). We are not providing such an option in RnBeads, but have it on our list of things which are worth implementing. Sorry that I cannot offer a better solution at the moment.

ArashDepp commented 2 years ago

Okay.. Thank you. This is helpful 👍

alex-d13 commented 1 year ago

Hi @schmic05 ,

Are there any updates on the progress on a liftover implementation in RnBeads?

Cheers, Alex

schmic05 commented 1 year ago

Hi @alex-d13,

At the moment, unfortunately, no. We'll keep you posted about the progress.

Best,

Michael