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

mm10 rmsk colname failure #6

Open
AMChalkie opened this issue Jan 23, 2019 · 1 comment
Open

mm10 rmsk colname failure #6

AMChalkie opened this issue Jan 23, 2019 · 1 comment

Comments

@AMChalkie
Copy link

R.3.5.2.>features.rmsk <- getFeatures(tables=c("rmsk"),genome="mm10", cachedir=cachedir,sync=TRUE)
|==================================================|
Error in setnames(x, c("chrom", "chromStart", "chromEnd"), c("chr", "start", :
Items of 'old' not found in column names: chrom,chromStart,chromEnd
R.3.5.2.>
R.3.5.2.>traceback()
6: stop("Items of 'old' not found in column names: ", paste(old[is.na(i)],
collapse = ","))
5: setnames(x, c("chrom", "chromStart", "chromEnd"), c("chr", "start",
"end"))
4: FUN(X[[i]], ...)
3: lapply(tab.dt, togr)
2: lapply(tab.dt, togr)
1: getFeatures(tables = c("rmsk"), genome = genome, cachedir = cachedir,
sync = TRUE)

Suggested partial fix:

if ("chrom" in colnames(x)){
setnames(x, c("chrom"), c("chr"))
} else {
stopifnot("chr" in colnames(x))
}
setnames(x, c("chromStart", "chromEnd"), c("start", "end"))

@jeffbhasin
Copy link
Owner

Hello,

I believe the rmsk table has a different schema, and causes this error. When I have needed rmsk I have used the underlying goldmine:::getUCSCTable() function. This can pull the table data, but will not adjust for 0-based start coordinates the way getFeatures() does. However, this way the rmsk data can still be pulled from within R and the column names could be changed manually. This is just a workaround, the code you have could also provide a fix. Please make a pull request if you think you could get getFeatures() working for the "rmsk" table in this manner.

Jeff

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

2 participants