Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atRegions fails when given dropNA argument #17

Open
jamorrison opened this issue Sep 4, 2019 · 0 comments
Open

atRegions fails when given dropNA argument #17

jamorrison opened this issue Sep 4, 2019 · 0 comments

Comments

@jamorrison
Copy link
Contributor

When calling atRegions(bsseq, regions, mappings, nm, ...), you can pass it either dropNA or impute, which will then be passed on to summarizeBsSeqOver. When trying to pass it dropNA, atRegions will fail because of an incorrect number of dimensions (see error message below). The issue is arising because summarizeBsSeqOver will return a numeric, rather than a matrix, when only one sample is given. Should summarizeBsSeqOver always return a matrix, and then let atRegions reduce this to a numeric if there is only one sample?

Code:
tcga_bed <- system.file("extdata", "TCGA_BLCA_A13J_chr11p15_merged.bed.gz",
package = "biscuiteer")
tcga_vcf <- system.file("extdata", "TCGA_BLCA_A13J_header_only.vcf.gz",
package = "biscuiteer")
bisc <- read.biscuit(BEDfile = tcga_bed, VCFfile = tcga_vcf,
merged = TRUE, genome = "hg38", verbose = TRUE)

reg <- Ranges(seqnames = rep("chr11",5),
strand = rep("*",5),
ranges = IRanges(start = c(0,2.8e6,1.17e7,1.38e7,1.69e7),
end= c(2.8e6,1.17e7,1.38e7,1.69e7,2.2e7))
)
regions <- atRegions(bsseq = bisc, regions = reg, dropNA = TRUE)

Error message:
Error in regional[as.character(regions), ] :
incorrect number of dimensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant