This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to install packages "mapsnp" in R?

Hi, I found the article about how to draw snp map: https://scfbm.biomedcentral.com/articles/10.1186/s13029-016-0052-z

However, no matter how hard I tried, R still shows to me "package ‘mapsnp’ is not available (for R version 3.4.0)".

Please help me if you know how to solve the problem.

snp r software error

From this page (reference - 8 from paper), you should be able to install, it syays R > 2.15.*

Did you try downloading *tar.gz file and install ? May be it is not in CRAN. Download manually and install.

Hi Venu, I downloaded the *tar.gz file, but I don't know how to install in R. (I'm strange to Linux.) If you can teach me how to install, that would be great. Thank you.

1 answer

Ok, but first move your answer as a comment to original post. (moderate -> Move post to a comment on the top level post).

And check this, Installing an R package

In future, please use ADD COMMENT or ADD REPLY button to comment something.

UPDATE

Authors haven't configured the repository properly. Do the following

library("devtools")

install_github("csuzfq/mapsnp_pkg/mapsnp")

It works fine

Downloading GitHub repo csuzfq/mapsnp_pkg@master
from URL https://api.github.com/repos/csuzfq/mapsnp_pkg/zipball/master
Installing mapsnp
'/usr/local/Cellar/r/3.3.3/R.framework/Resources/bin/R' --no-site-file  \
  --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  '/private/var/folders/1z/4hxh0srn2c73cws8pc19_6ym0000gn/T/RtmpfTVCip/devtools16a41e50b597/csuzfq-mapsnp_pkg-cb6c8bf/mapsnp'  \
  --library='/usr/local/lib/R/3.3/site-library' --install-tests

* installing *binary* package ‘mapsnp’ ...
* DONE (mapsnp)

Hi venu

If it turns out that this solves the issue, please repost your solution (both comments together) as an answer, as such this solution can get accepted.

Cheers, Wouter

Hi venu,

I input

> install.packages("devtools")
> require(devtools)
> install_github("mapsnp","csuzfq")

Here are the address of the package:https://github.com/csuzfq/mapsnp_pkg

but R gives me :

Downloading GitHub repo csuzfq/mapsnp@master from URL https://api.github.com/repos/csuzfq/mapsnp/zipball/master Error: Does not appear to be an R package (no DESCRIPTION) In addition: Warning message: Username parameter is deprecated. Please use csuzfq/mapsnp


what is wrong with my code?

Thank you.

@pompompurin2004 - check the update.

Hi @venu, Thank you for your reply. It is really clear and helpful. I learn a lot. I followed what you have written to me. But R shows me:

Downloading GitHub repo csuzfq/mapsnp_pkg@master from URL https://api.github.com/repos/csuzfq/mapsnp_pkg/zipball/master Installing mapsnp Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) && : missing value where TRUE/FALSE needed

What happened to it? I don't understand what it means.

Could you help me? Thank you.

@Sherry, I don't know why this error is showing up. It installed properly in my machine. Try this

getOption("unzip")
options(unzip="internal")
install_github("csuzfq/mapsnp_pkg/mapsnp")

Also what R version are you using? Posting sessionInfo() output might help.

Hi @venu, I have tried the code you gave, but it seems not working. Here is my R version:

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 14393)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Traditional)_Hong Kong SAR.950 
[2] LC_CTYPE=Chinese (Traditional)_Hong Kong SAR.950   
[3] LC_MONETARY=Chinese (Traditional)_Hong Kong SAR.950
[4] LC_NUMERIC=C                                       
[5] LC_TIME=Chinese (Traditional)_Hong Kong SAR.950    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_1.12.0

loaded via a namespace (and not attached):
[1] httr_1.2.1     compiler_3.4.0 R6_2.2.0       tools_3.4.0    withr_1.0.2    curl_2.6      
[7] memoise_1.1.0  git2r_0.18.0   digest_0.6.12

Maybe my computer has too many problems, I can try it on my friend's computer tomorrow. Thank you. :))

When I run the code, the R shows:

> install_github("csuzfq/mapsnp_pkg/mapsnp")
Downloading GitHub repo csuzfq/mapsnp_pkg@master
from URL https://api.github.com/repos/csuzfq/mapsnp_pkg/zipball/master
Installing mapsnp
"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD  \
  INSTALL  \
  "C:/Users/user/AppData/Local/Temp/Rtmp0EekOl/devtools4186c8b64e8/csuzfq-mapsnp_pkg-cb6c8bf/mapsnp"  \
  --library="C:/Users/user/Documents/R/win-library/3.4" --install-tests 

* installing *binary* package 'mapsnp' ...
Warning: 執行中命令 'cp -R . "C:/Users/user/Documents/R/win-library/3.4/mapsnp" || ( internal cd - .| (cd "C:/Users/user/Documents/R/win-library/3.4/mapsnp" && internal -xf -))' 已有狀態 127
ERROR: installing binary package failed
* removing 'C:/Users/user/Documents/R/win-library/3.4/mapsnp'
Error: Command failed (1)

I'm strange to Linux

from this comment on original thread, I thought you are using Linux machine but from the error above it seems you are using windows machine. I don't know how to install these packages (atleast how to debug) in windows machine. I think you can't install from Github in a windows machine but I'm not sure.

P.S - Better switch to linux :)

I can confirm that your Linux solution works for me.

That's right. My teacher also uses window system, but he can not install it. Thank you for your clear and helpful reply and suggestion. :))

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

Log in to answer this question.