This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to install the Mapsnp package into R?

I am new to R but I would like to explore this package. I read a similar posted question about installing this package using a Linux machine, but I was not able to successfully use the information posted there.

The paper describing this tool links to https://github.com/csuzfq/mapsnp_pkg/tree/master/mapsnp, but I am not sure what to do with files from github.

Thank you for any help.

snp r gene

That is the similar post I referred to in my question. When I try doing what is suggested there, it does not work:

> install_github("csuzfq/mapsnp_pkg/mapsnp")
Downloading GitHub repo csuzfq/mapsnp_pkg@master
Skipping 2 packages not available: Gviz, TxDb.Hsapiens.UCSC.hg19.knownGene
√  checking for file 'C:\Users\Admin\AppData\Local\Temp\RtmpsVB7op\remotes5a0844921198\csuzfq-mapsnp_pkg-cb6c8bf\mapsnp/DESCRIPTION' ... 
-  preparing 'mapsnp':
√  checking DESCRIPTION meta-information ... 
   Warning in file(con, "r") :
     cannot open file 'man': No such file or directory
    ERROR
   computing Rd index failed:cannot open the connection
Error: Failed to install 'mapsnp' from GitHub:
  System command error, exit status: 1, stdout + stderr:
E> * checking for file 'C:\Users\Admin\AppData\Local\Temp\RtmpsVB7op\remotes5a0844921198\csuzfq-mapsnp_pkg-cb6c8bf\mapsnp/DESCRIPTION' ... OK
E> * preparing 'mapsnp':
E> * checking DESCRIPTION meta-information ... OK
E> Warning in file(con, "r") :
E>   cannot open file 'man': No such file or directory
E>  ERROR
E> computing Rd index failed:cannot open the connection

1 answer

Next time please post the error when you ask for help and also any material you used.

There's 2 errors your getting and I can replicate them on my system (macos). So the good (or bad) news is that it's not just you. First, the two packages skipped are on Bioconductor, if you google you'll find out how to install them.

Second, I think this is an issue with how devtools is trying to install. Something has gone wrong probably with how the authors have setup the package on github (badly). I suggest you download the source files and install manually like this:

install.packages("~/Downloads/mapsnp_0.1.tar.gz", repos = NULL, type = "source")

This is how I installed the package.

Source files from here: https://github.com/csuzfq/mapsnp_pkg/blob/master/mapsnp_0.1.tar.gz

P.S Make sure you install the two bioconductor packages before installing mapsnp. Then load the two bioc packages first then load mapsnp just to be sure.

Thank you! Here is all I needed to enter to get it to install:

> if (!requireNamespace("BiocManager", quietly = TRUE))
+     install.packages("BiocManager")
> 
> BiocManager::install("Gviz")

> if (!requireNamespace("BiocManager", quietly = TRUE))
+     install.packages("BiocManager")
> 
> BiocManager::install("TxDb.Hsapiens.UCSC.hg19.knownGene")

> install.packages("~/mapsnp_pkg-master/mapsnp_0.1.tar.gz", repos = NULL, type = "source")

Log in to answer this question.