Version 3.5.2 of the fingerprint package has been pushed to CRAN. This update includes a contribution from Abhik Seal that significantly speeds up similarity matrix calculations using the Tanimoto metric.
His patch led to a 10-fold improvement in running time. However his code involved the use of nested for loops in R. This is a well known bottleneck and most idiomatic R code replaces for loops with a member of the sapply/lapply/tapply family. In this case however, it was easier to write a small piece of C code to perform the loops, resulting in a 4- to 6-fold improvement over Abhiks observed running times (see figure summarizing Tanimoto similarity matrix calculation for 1024 bit fingerprints, with 256 bits randomly selected to be 1). As always, the latest code is available on Github.
Hi Rajarshi,
If it’s a similarity matrix hen it’s symmetric right? In the github code it looks as though every entry is being computed when you only need to half of them.
J
You’re correct. Fixed in github
I have an error when I try installing it. Below is the error.
install.packages(“C:/Users/jubilant/Downloads/fingerprint_3.5.7.tar.gz”, repos = NULL, type = “source”)
Installing package into ‘C:/Users/jubilant/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
* installing *source* package ‘fingerprint’ …
** package ‘fingerprint’ successfully unpacked and MD5 sums checked
** libs
*** arch – i386
Warning: running command ‘make -f “C:/PROGRA~1/R/R-34~1.2/etc/i386/Makeconf” -f “C:/PROGRA~1/R/R-34~1.2/share/make/winshlib.mk” SHLIB=”fingerprint.dll” OBJECTS=”fpdistance.o readfps.o registerDynamicSymbol.o”‘ had status 127
ERROR: compilation failed for package ‘fingerprint’
* removing ‘C:/Users/jubilant/Documents/R/win-library/3.4/fingerprint’
* restoring previous ‘C:/Users/jubilant/Documents/R/win-library/3.4/fingerprint’
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
problem copying C:\Users\jubilant\Documents\R\win-library\3.4\00LOCK-fingerprint\fingerprint\libs\x64\fingerprint.dll to C:\Users\jubilant\Documents\R\win-library\3.4\fingerprint\libs\x64\fingerprint.dll: Permission denied
Warning in install.packages :
running command ‘”C:/PROGRA~1/R/R-34~1.2/bin/x64/R” CMD INSTALL -l “C:\Users\Sundar\Documents\R\win-library\3.4” “C:/Users/jubilant/Downloads/fingerprint_3.5.7.tar.gz”‘ had status 1
Warning in install.packages :
installation of package ‘C:/Users/jubilant/Downloads/fingerprint_3.5.7.tar.gz’ had non-zero exit status
Help me get this installed.
Jubilant