difficulties installing poppr and vcfR

367 views
Skip to first unread message

Nathan Rank

unread,
Aug 12, 2020, 1:43:36 PM8/12/20
to poppr
Greetings,

I am working with mitochondrial data from montane beetle populations. I have mapped reads from several poolseq files to a reference using bwa mem and processed them via SAMtools and freebayes to make a vcf file that I would like to examine further with respect to allele frequencies and geographic differentiation. It looks like these tools might do the trick. But I am a newbie to R and so the installations aren't working.

With respect to vcfR, the files seem to be removed from the CRAN repository, so I tried to download the file and import into R studio. I got the following messages:

> install.packages("~/Desktop/vcfR_1.11.0.tar", repos = NULL, type="source")
ERROR: dependencies ‘ape’, ‘memuse’, ‘pinfsc50’, ‘vegan’ are not available for package ‘vcfR’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/vcfR’
Warning in install.packages :
  installation of package ‘/Users/nathanrank/Desktop/vcfR_1.11.0.tar’ had non-zero exit status
> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.6

So then I checked Poppr and realized that it hadn't installed either.

It started out promising and seemed to collect the dependencies.

> install.packages(c("poppr", "mmod", "magrittr", "treemap"), repos = "http://cran.rstudio.com", dependencies = TRUE)
also installing the dependencies ‘htmltools’, ‘sourcetools’, ‘later’, ‘promises’, ‘fastmap’, ‘commonmark’, ‘pracma’, ‘adegenet’, ‘vegan’, ‘phangorn’, ‘ape’, ‘igraph’, ‘ade4’, ‘pegas’, ‘polysat’, ‘shiny’, ‘progressr’, ‘poweRlaw’, ‘RClone’, ‘gridBase’

But then it landed with a thud and said:

Error in install.packages : cannot remove prior installation of package ‘htmltools’

How can I get past these obstacles?

best, Nathan Rank



Brian Knaus

unread,
Aug 12, 2020, 4:12:11 PM8/12/20
to Nathan Rank, poppr
Hi Nathan,

This is a general question about R and not really specific to poppr or
vcfR. A good feature of R is that it attempts to handle a packages
dependency chain for you when you install a package. That is, when the
package you're trying to install calls functions from other R packages
R tries to install these other packages for you. Usually this works
great. But we don't live in a perfect world and we sometimes end up
where you're at. A package that vcfR depends on is not installing
correctly and that breaks everything downstream of that. It is
possible that some of that packages that are failing to install are
failing for the same reason (they depend on the same package that is
not installing correctly). I suggest the following.

Focus on one package at a time. I suggest the first that is reported
by R. Here this appears to be 'htmltools.'

Go to the package's site on CRAN

https://cran.r-project.org/web/packages/htmltools/index.html

see the link to it's CRAN checks which I'm also providing below.

https://cran.r-project.org/web/checks/check_results_htmltools.html

This gives you a dashboard on whether this package is passing tests.
This is particularly important these days because CRAN released a
"major" release in April 2020, which broke some of our packages.

Today, "htmltools" appears to be building fine. So I'd suggest you
retry your install as above but with only htmltools.

If you still get the ERROR above you might need to try something like
the following.

remove.packages("htmltools")

If that is not successful you might try to manually remove the package
by looking for it in your library paths.

.libPaths()

And forcefully remove it by deleting it's directory. This last option
is not ideal, but sometimes you just need a larger hammer.

Good luck!
Brian
> --
> You received this message because you are subscribed to the Google Groups "poppr" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/561254cf-0386-41c6-a7aa-83b7e7f4f812n%40googlegroups.com.



--
Brian J. Knaus, Ph.D.
he/him/his
Corvallis, Oregon, USA
brianknaus.com
Brian's blog
vcfR Documentation
Population_Genetics_in_R

Zhian N. Kamvar

unread,
Aug 12, 2020, 8:28:03 PM8/12/20
to po...@googlegroups.com

Hi Nathan,

Installing a package from a downloaded tar file is a bit of a pain to say the least and I have avoided it entirely. One thing I would highly recommend is to make sure that your R session is in a clean state every time you start it up by following the instructions here: https://r4epis.netlify.app/welcome/#configuring-rstudio


If you are willing, you can install {vcfR} directly from its source on GitHub with the {remotes} package. Because {vcfR} needs a C++ compiler, you will need to install XCode to get things to work: https://developer.apple.com/xcode/resources/

After you install XCode, you can install the {remotes} package from CRAN and then use remote::install_github("knausb/vcfR") to install from the source on GitHub (https://github.com/knausb/vcfR#readme)

This will ask you if you want to install and or update the dependencies necessary for vcfR and then install vcfR from source, which will take a couple of minutes.

Otherwise, you can wait to install vcfR once it's available on CRAN again (maybe a week or two).

Best,

Zhian

Nathan Rank

unread,
Aug 13, 2020, 1:07:18 AM8/13/20
to poppr
thanks. I already have Xcode. I tried the changes to configurations that you suggested. And I tried some suggestions Brian made earlier. Unfortunately my R version is stubbornly refusing to delete old versions of packages in response to the suggestions that both of you made. It's frustrating since I have some other genomics packages installed and part of me wants to just wipe the R installation clean since I did it right at the time that the transition to R 4.0 was happening in April but it would be nice to just get to work on the package without these problems. What a drag.

best, Nathan Rank

Nathan Rank

unread,
Aug 13, 2020, 2:08:16 AM8/13/20
to poppr
update. got poppr installed but even when I tried to delete everything (by finding the folders containing the packages and deleting them), and redownloading vcfR from the  githup site I still get errors. Seems like I might have to wait for it to return to the CRAN repository. 

best, Nathan Rank

Reply all
Reply to author
Forward
0 new messages