Giter Site home page Giter Site logo

gtonkinhill / fastbaps Goto Github PK

View Code? Open in Web Editor NEW
53.0 53.0 8.0 2.33 MB

A fast approximation to a Dirichlet Process Mixture model (DPM) for clustering genetic data

License: MIT License

R 50.78% C++ 40.35% C 8.87%
bayesian genetics hierarchical-clustering

fastbaps's People

Contributors

gtonkinhill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fastbaps's Issues

can fastbaps run in parallel?

hi, the software fastbaps is really fantastic.

but, I have a question. Can fastbaps run in multiple cpus. Recently, I have a fa file , the size of file was 900M, when I run optimise_prior step, it is so slow. so I ask whether the fastbaps can run in multiple cpus.

Hashes in filenames cause name match issues

Using the 'sanger' name format of run_lane#tag in input alignments or trees get converted to run_lane_tag, which then causes sample name mismatches if used in a pipeline. Would it be possible to escape the hashes and include them in the output?

I am running a command of the form:

run_fastbaps -p 'baps' -i input.aln -o fastbaps_clusters.txt -l 2 --phylogeny=input.tree -t 8

segfault from C stack overflow

I'm having an issue with the very first step reading in my fasta file using import_fasta_sparse_nt(). I'm getting the error:

Segfault from C stack overflow

My input fasta has ~350 sequences and ~700,000 SNPs. I tried inputting a smaller fasta with only the first 2 lines of my fasta, but got the same error.

Level 1 and 2 cluster

Hi Gerry,

I work on a project with about 200 Campylobacter isolates. I have created SNP based and cgMLST based distance matrices and phylogenies and clustered the isolates with fastbaps and hierCC.
My question is how the fastbaps level 1 and 2 compare to the levels of the multi-clustering scheme of hierCC software used by Enterobase. Are they comparable, and which software works best for which data set (SNPs or cgMLST alleles)?

Best,

Thorsten

crash with small data

Hi,
The following comands make R crash:

## simulate 9 DNA seqs with 5 sites:
x <- sample(c("A", "G"), size = 45, replace = TRUE)
dim(x) <- c(9, 5)
rownames(x) <- paste0("Ind", 1:9)
library(ape)
x <- as.DNAbin(x)

## load fastbaps and convert the data:
library(fastbaps)
x <- import_fasta_sparse_nt(x)
## so far so good

fast_baps(x)

with the output:

[1] "Calculating initial clustering..."
[1] "Calculating initial dk values..."
[1] "Clustering using hierarchical Bayesian clustering..."

error: Mat::operator(): index out of bounds
terminate called after throwing an instance of 'std::logic_error'
  what():  Mat::operator(): index out of bounds
Abandon

This is does not seem related to a specific data configuration as repetitions of the data simulation gave the same crash. I also tried optimise_prior before calling fast_baps with the same result. I'm not sure what is the reason since the examples provided with the package run correctly. My system is:

R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=fr_FR.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=fr_FR.UTF-8        LC_COLLATE=fr_FR.UTF-8    
 [5] LC_MONETARY=fr_FR.UTF-8    LC_MESSAGES=fr_FR.UTF-8   
 [7] LC_PAPER=fr_FR.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C       

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

loaded via a namespace (and not attached):
[1] compiler_3.6.1

Information on Symmetric Prior

Greetings,

I had a question about what the optimized symmetric prior is in relation to in the population clustering. I imagine that when it says that it is symmetric, this is based on the assumption that all groups will be engaging in gene flow 'symmetrically' but I also have no idea what it could mean! Can you please help understand what this prior is actually assuming in the bayesian HC?

Indexing error in fasta import

There is a 0/1 indexing problem for fasta import:

  #Remove columns where the consensus is gapped
  snp.matrix <- snp.matrix[, snp.data$consensus!=4]
  snp.data$consensus <- snp.data$consensus[snp.data$consensus!=4]

This removes columns where the consensus is T! 4 needs to be changed to 5.

Different results with "optimise.symmetric" and "optimised.symmetric"

Hello,

Thank you for the great tool.
When I use:
sparse.data <- optimise_prior(sparse.data, type = "optimise.symmetric")
I have 4 clusters.
when:
sparse.data <- optimise_prior(sparse.data, type = "optimised.symmetric")
I have 3 clusters.
with the same data.

What could be the reason?

A lot of thanks,
Valery

Index out of bounds

Trying to cluster an admittedly enourmous alignment (~2700 isolates, snps only) - I have succesfully done a slightly smaller version of this recently so I'm not sure what's wrong but I'm getting the following error - any ideas?

`

s<-read.FASTA('./out')
library(fastbaps)
s<-import_fasta_sparse_nt(s)
baps.hc<-fast_baps(s)
[1] "Calculating initial clustering..."
[1] "Calculating initial dk values..."
[1] "Clustering using hierarchical Bayesian clustering..."
Error in bhier_parallel(sparse.data, initial.partition, dk.initial, n.cores) :
Mat::operator(): index out of bounds
`

Inconsistencies with phylogeny

Hello,
I obtained similar results to those presented in Tokin-Hill et al, 2019 for Neisseria meningitidis, but they were even more dramatic.
A group containing many taxa from different clades is generated.

f2

My input data consists of a SNP alignment of the core genome, and I used a symmetric prior.
Additionally, I examined stability using boot_fast_baps (groups are well supported), and compared BAPS results with different phylogenetic reconstructions, but the inconsistencies remain.
The results are similar using rhierbaps, at the first level, at the second level the groups are more consistent with the phylogeny but too many for further analysis.

The reason behind this clustering is biological, or am I missing something about the procedure?

Problem in installing fastbaps (Ubuntu 20.0)

Hi,

I am facing the same issue as it was mentioned in previous issues. I have tried installing the Rcpp and Rcpp Armadillo packages in R. I am using Ubuntu 20.0 and R-studio.

`> install_git("https://github.com/gtonkinhill/fastbaps.git")
Error: Failed to install 'unknown package' from Git:
Error in 'git2r_remote_ls': there is no TLS stream available

install_github("https://github.com/gtonkinhill/fastbaps.git")
Downloading GitHub repo gtonkinhill/fastbaps@HEAD
✓ checking for file ‘/tmp/RtmpMfOBxB/remotes9cb45e28cd1c/gtonkinhill-fastbaps-6c8d6db/DESCRIPTION’ ...
─ preparing ‘fastbaps’:
✓ checking DESCRIPTION meta-information ... OK
─ cleaning src
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘fastbaps_1.0.4.tar.gz’

Installing package into ‘/home/honey/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package ‘fastbaps’ ...
** using staged installation
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I"/home/honey/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -I"/home/honey/R/x86_64-pc-linux-gnu-library/3.6/RcppArmadillo/include"  -fopenmp -DARMA_64BIT_WORD -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I"/home/honey/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -I"/home/honey/R/x86_64-pc-linux-gnu-library/3.6/RcppArmadillo/include"  -fopenmp -DARMA_64BIT_WORD -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c bhier.cpp -o bhier.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I"/home/honey/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -I"/home/honey/R/x86_64-pc-linux-gnu-library/3.6/RcppArmadillo/include"  -fopenmp -DARMA_64BIT_WORD -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c bhier_parallel.cpp -o bhier_parallel.o
bhier_parallel.cpp: In function ‘Rcpp::List bhier_parallel(Rcpp::List, Rcpp::List, Rcpp::NumericVector, int)’:
bhier_parallel.cpp:110:35: error: ‘n_snps’ not specified in enclosing ‘parallel’
  110 |   int consensus_counts_temp[n_snps];
      |                                   ^
bhier_parallel.cpp:107:9: error: enclosing ‘parallel’
  107 | #pragma omp parallel shared(term1, sp_partition_counts, initial_partition_llk, pre_lgamma, prior_index, p_tree, partition_sizes) default(none)
      |         ^~~
bhier_parallel.cpp:111:9: error: ‘n_partitions’ not specified in enclosing ‘parallel’
  111 | #pragma omp for
      |         ^~~
bhier_parallel.cpp:107:9: error: enclosing ‘parallel’
  107 | #pragma omp parallel shared(term1, sp_partition_counts, initial_partition_llk, pre_lgamma, prior_index, p_tree, partition_sizes) default(none)
      |         ^~~
make: *** [/usr/lib/R/etc/Makeconf:177: bhier_parallel.o] Error 1
ERROR: compilation failed for package ‘fastbaps’
* removing ‘/home/honey/R/x86_64-pc-linux-gnu-library/3.6/fastbaps’
Error: Failed to install 'fastbaps' from GitHub:
  (converted from warning) installation of package ‘/tmp/RtmpMfOBxB/file9cb467f4fa2e/fastbaps_1.0.4.tar.gz’ had non-zero exit status`

Please help me in this regard.
Thanks

Issue loading data

I ran this, ensuring I am in the correct working directory with my multi-fasta alignment file:

fasta.file.name <- system.file("exdata","test.fasta", package = "fastbaps")
sparse.data <- import_fasta_sparse_nt(fasta.file.name)

and it returns:

Error in import_fasta_sparse_nt(fasta.file.name) : Can't locate file

Please help.

Calculating assignment probabilities

Hi Gerry,

I would like to calculate the individual probabilities of assignment to each cluster, any tips on how these could be obtained with fastbaps

Thanks,

segfault - cause 'memory not mapped' when loading large alignment file

Hi,

We are trying to use fastbaps with a whole genome alignment of bacterial isolates (~4 meg genome). I have tried on two separate systems, both with the full alignment file (~9k genomes) and paired down versions (160, 3 genomes) and each time receive a memory segmentation error:

*** caught segfault ***
address 0x7fff2ca671f8, cause 'memory not mapped'

Traceback:
 1: import_fasta_to_vector_each_nt(fasta)
 2: import_fasta_sparse_nt(fasta.file.name)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 1
R is aborting now ...
Segmentation fault (core dumped)

This does not occur with the bundled data, which is imported successfully. I notice that the bundled alignment is a lot shorter than our input - Is fastbaps designed to work with whole genome alignments? If so is there anything you can suggest?

Apologies if this is the result of something obvious, I have attached an example of the alignment we are working from, and pasted the session details of the servers I have tested below.

seqs.fa.gz

Server 1 Session Info:

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS: /home/linuxbrew/.linuxbrew/Cellar/r/3.5.1/lib/R/lib/libRblas.so
LAPACK: /home/linuxbrew/.linuxbrew/Cellar/r/3.5.1/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] ape_5.2        fastbaps_1.0.0

loaded via a namespace (and not attached):
[1] compiler_3.5.1  Matrix_1.2-14   parallel_3.5.1  Rcpp_1.0.0     
[5] nlme_3.1-137    grid_3.5.1      lattice_0.20-35

Sever 2 Session Info:

R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.18.so

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] ape_5.2        fastbaps_1.0.0

loaded via a namespace (and not attached):
[1] compiler_3.5.1  Matrix_1.2-15   parallel_3.5.1  Rcpp_1.0.0     
[5] nlme_3.1-137    grid_3.5.1      lattice_0.20-38

Thanks!

Compilation failed

Hi Gerry,
I am trying to install the developmental version but I keep getting this error. Any idea on how to solve this?

Downloading GitHub repo gtonkinhill/fastbaps@master
from URL https://api.github.com/repos/gtonkinhill/fastbaps/zipball/master
Installing fastbaps
"C:/PROGRA~1/R/R-35~1.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  "C:/Users/Idowu/AppData/Local/Temp/Rtmpi2x6gS/devtools18887708483a/gtonkinhill-fastbaps-9b6e829f2e5d63a88daf6f09236fd3b0ec671453"  \
  --library="C:/Users/Idowu/Documents/R/win-library/3.5" --install-tests 

* installing *source* package 'fastbaps' ...
** libs
C:/RBuildTools/3.5/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -fopenmp -I"C:/Users/Idowu/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/Idowu/Documents/R/win-library/3.5/RcppArmadillo/include"        -O2 -Wall  -mtune=generic -c RcppExports.cpp -o RcppExports.o
C:/RBuildTools/3.5/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -fopenmp -I"C:/Users/Idowu/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/Idowu/Documents/R/win-library/3.5/RcppArmadillo/include"        -O2 -Wall  -mtune=generic -c bhier.cpp -o bhier.o
bhier.cpp: In function 'Rcpp::List bhier(Rcpp::List, Rcpp::List, Rcpp::NumericVector)':
bhier.cpp:38:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0; i<(n_isolates+2); i++){
             ^
bhier.cpp:39:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(j=0; j<lg_size; j++){
               ^
bhier.cpp:46:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(j=0; j<n_snps; j++){
               ^
bhier.cpp:55:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (j=0; j < n_snps; j++){
                 ^
bhier.cpp:66:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(p=0; p<n_partitions; p++){
             ^
bhier.cpp:84:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(p=0; p<n_partitions; p++){
             ^
bhier.cpp:93:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(i=0; i<n_snps; i++){
               ^
bhier.cpp:100:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(p1=0; p1<n_partitions; p1++){
               ^
bhier.cpp:101:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(p2=(p1+1); p2<n_partitions; p2++){
                      ^
bhier.cpp:113:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(i=0; i<n_snps; i++){
                 ^
bhier.cpp:135:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(j=0; j<(n_partitions-1); j++) {
             ^
bhier.cpp:180:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(p=0; p<n_partitions; p++){
               ^
bhier.cpp:182:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if(p==min_i) continue;
           ^
bhier.cpp:195:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(i=0; i<n_snps; i++){
                 ^
C:/RBuildTools/3.5/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -fopenmp -I"C:/Users/Idowu/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/Idowu/Documents/R/win-library/3.5/RcppArmadillo/include"        -O2 -Wall  -mtune=generic -c bhier_parallel.cpp -o bhier_parallel.o
bhier_parallel.cpp: In function 'Rcpp::List bhier_parallel(Rcpp::List, Rcpp::List, Rcpp::NumericVector, int)':
bhier_parallel.cpp:45:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(j=0; j<lg_size; j++){
               ^
bhier_parallel.cpp:52:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(j=0; j<n_snps; j++){
               ^
bhier_parallel.cpp:61:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (j=0; j < n_snps; j++){
                 ^
bhier_parallel.cpp:105:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(k=0; k<n_snps; k++){
                 ^
bhier_parallel.cpp:131:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(k=0; k<n_snps; k++){
                 ^
bhier_parallel.cpp:209:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if((used[pp]!=1) && (pp!=min_i)){
                              ^
bhier_parallel.cpp:222:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(k=0; k<n_snps; k++){
                   ^
bhier_parallel.cpp:167:5: warning: 'col_index' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if(row_index > col_index){
     ^
bhier_parallel.cpp:167:5: warning: 'row_index' may be used uninitialized in this function [-Wmaybe-uninitialized]
C:/RBuildTools/3.5/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -fopenmp -I"C:/Users/Idowu/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/Idowu/Documents/R/win-library/3.5/RcppArmadillo/include"        -O2 -Wall  -mtune=generic -c calc_ddk.cpp -o calc_ddk.o
calc_ddk.cpp: In function 'Rcpp::List calc_ddk(Rcpp::List, arma::imat)':
calc_ddk.cpp:30:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0; i<n_isolates; i++){
             ^
calc_ddk.cpp:35:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(m=0; m<n_merges; m++){
             ^
calc_ddk.cpp:19:7: warning: unused variable 'n_snps' [-Wunused-variable]
   int n_snps = snp_matrix.n_rows;
       ^
calc_ddk.cpp:22:18: warning: unused variable 'j' [-Wunused-variable]
   unsigned int i,j,m,partition_length,left,right;
                  ^
calc_ddk.cpp:22:22: warning: unused variable 'partition_length' [-Wunused-variable]
   unsigned int i,j,m,partition_length,left,right;
                      ^
calc_ddk.cpp:23:7: warning: unused variable 'count' [-Wunused-variable]
   int count = 0;
       ^
C:/RBuildTools/3.5/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -fopenmp -I"C:/Users/Idowu/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/Idowu/Documents/R/win-library/3.5/RcppArmadillo/include"        -O2 -Wall  -mtune=generic -c import_fasta_to_vector_each_nt.cpp -o import_fasta_to_vector_each_nt.o
In file included from import_fasta_to_vector_each_nt.cpp:2:0:
kseq.hpp:80:13: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
   ~kseq() = default;;
             ^
kseq.hpp: In instantiation of 'kstream<ret_t, ReadFunction>::kstream(ret_t, ReadFunction) [with ret_t = int; ReadFunction = FunctorRead]':
import_fasta_to_vector_each_nt.cpp:21:37:   required from here
kseq.hpp:235:22: warning: 'kstream<int, FunctorRead>::bufferSize' will be initialized after [-Wreorder]
   const unsigned int bufferSize;
                      ^
kseq.hpp:233:9: warning:   'int kstream<int, FunctorRead>::f' [-Wreorder]
   ret_t f;
         ^
kseq.hpp:93:3: warning:   when initialized here [-Wreorder]
   kstream(ret_t f, ReadFunction rf) : bufferSize(4096), f(f), is_eof(0), begin(0), end(0), readfunc(rf) {
   ^
kseq.hpp:233:9: warning: 'kstream<int, FunctorRead>::f' will be initialized after [-Wreorder]
   ret_t f;
         ^
kseq.hpp:232:7: warning:   'int kstream<int, FunctorRead>::is_eof' [-Wreorder]
   int is_eof;
       ^
kseq.hpp:93:3: warning:   when initialized here [-Wreorder]
   kstream(ret_t f, ReadFunction rf) : bufferSize(4096), f(f), is_eof(0), begin(0), end(0), readfunc(rf) {
   ^
kseq.hpp:232:7: warning: 'kstream<int, FunctorRead>::is_eof' will be initialized after [-Wreorder]
   int is_eof;
       ^
kseq.hpp:230:7: warning:   'int kstream<int, FunctorRead>::begin' [-Wreorder]
   int begin;
       ^
kseq.hpp:93:3: warning:   when initialized here [-Wreorder]
   kstream(ret_t f, ReadFunction rf) : bufferSize(4096), f(f), is_eof(0), begin(0), end(0), readfunc(rf) {
   ^
kseq.hpp: In instantiation of 'int kstream<ret_t, ReadFunction>::getc() [with ret_t = int; ReadFunction = FunctorRead]':
kseq.hpp:107:17:   required from 'int kstream<ret_t, ReadFunction>::read(kseq&) [with ret_t = int; ReadFunction = FunctorRead]'
import_fasta_to_vector_each_nt.cpp:23:18:   required from here
kseq.hpp:157:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (this->end < bufferSize)
                     ^
kseq.hpp: In instantiation of 'int kstream<ret_t, ReadFunction>::getuntil(int, std::string&, int*) [with ret_t = int; ReadFunction = FunctorRead; std::string = std::basic_string<char>]':
kseq.hpp:116:41:   required from 'int kstream<ret_t, ReadFunction>::read(kseq&) [with ret_t = int; ReadFunction = FunctorRead]'
import_fasta_to_vector_each_nt.cpp:23:18:   required from here
kseq.hpp:184:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
           if (this->end < bufferSize)
                         ^
C:/RBuildTools/3.5/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -fopenmp -I"C:/Users/Idowu/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/Idowu/Documents/R/win-library/3.5/RcppArmadillo/include"        -O2 -Wall  -mtune=generic -c log_add_sub.cpp -o log_add_sub.o
C:/RBuildTools/3.5/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -fopenmp -I"C:/Users/Idowu/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/Idowu/Documents/R/win-library/3.5/RcppArmadillo/include"        -O2 -Wall  -mtune=generic -c part_llks.cpp -o part_llks.o
part_llks.cpp: In function 'Rcpp::List part_llks(Rcpp::List, Rcpp::List)':
part_llks.cpp:20:13: warning: unused variable 'a' [-Wunused-variable]
   int i,j,p,a,partition_length,allele_count,temp_total;
             ^
part_llks.cpp:20:32: warning: unused variable 'allele_count' [-Wunused-variable]
   int i,j,p,a,partition_length,allele_count,temp_total;
                                ^
part_llks.cpp:20:45: warning: unused variable 'temp_total' [-Wunused-variable]
   int i,j,p,a,partition_length,allele_count,temp_total;
                                             ^
C:/RBuildTools/3.5/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -fopenmp -I"C:/Users/Idowu/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/Idowu/Documents/R/win-library/3.5/RcppArmadillo/include"        -O2 -Wall  -mtune=generic -c tree_llk.cpp -o tree_llk.o
tree_llk.cpp: In function 'Rcpp::List tree_llk(Rcpp::List, arma::imat)':
tree_llk.cpp:33:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0; i<(n_isolates+2); i++){
             ^
tree_llk.cpp:34:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(j=0; j<lg_size; j++){
               ^
tree_llk.cpp:41:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(j=0; j<n_snps; j++){
               ^
tree_llk.cpp:49:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (partition_length=1; partition_length<n_isolates+2; partition_length++){
                                            ^
tree_llk.cpp:50:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (j=0; j < n_snps; j++){
                 ^
tree_llk.cpp:60:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0; i<n_isolates; i++){
             ^
tree_llk.cpp:81:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0; i<n_isolates; i++){
             ^
tree_llk.cpp:92:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(j=0; j<n_snps; j++){
               ^
tree_llk.cpp:100:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(m=0; m<n_merges; m++){
             ^
tree_llk.cpp:129:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(j=0; j<n_snps; j++){
               ^
tree_llk.cpp:78:10: warning: unused variable 'pik' [-Wunused-variable]
   double pik;
          ^
C:/RBuildTools/3.5/mingw_64/bin/g++ -shared -s -static-libgcc -o fastbaps.dll tmp.def RcppExports.o bhier.o bhier_parallel.o calc_ddk.o import_fasta_to_vector_each_nt.o log_add_sub.o part_llks.o tree_llk.o -LC:/PROGRA~1/R/R-35~1.1/bin/x64 -lR
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIdE4initERKS1_[_ZN4arma5SpMatIdE4initERKS1_]+0x236): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIdE4initERKS1_[_ZN4arma5SpMatIdE4initERKS1_]+0x243): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIdE4initERKS1_[_ZN4arma5SpMatIdE4initERKS1_]+0x268): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIdE9steal_memERS1_[_ZN4arma5SpMatIdE9steal_memERS1_]+0x181): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIdE9steal_memERS1_[_ZN4arma5SpMatIdE9steal_memERS1_]+0x18e): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZNK4arma5SpMatIdE8sync_cscEv[_ZNK4arma5SpMatIdE8sync_cscEv]+0x24): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZNK4arma5SpMatIdE8sync_cscEv[_ZNK4arma5SpMatIdE8sync_cscEv]+0x31): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIjE4initERKS1_[_ZN4arma5SpMatIjE4initERKS1_]+0x221): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIjE4initERKS1_[_ZN4arma5SpMatIjE4initERKS1_]+0x22e): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIjE4initERKS1_[_ZN4arma5SpMatIjE4initERKS1_]+0x347): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIjEC1ERKS1_[_ZN4arma5SpMatIjEC1ERKS1_]+0x241): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIjEC1ERKS1_[_ZN4arma5SpMatIjEC1ERKS1_]+0x24e): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIjEC1ERKS1_[_ZN4arma5SpMatIjEC1ERKS1_]+0x278): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZNK4arma5SpMatIjE8sync_cscEv[_ZNK4arma5SpMatIjE8sync_cscEv]+0x34): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZNK4arma5SpMatIjE8sync_cscEv[_ZNK4arma5SpMatIjE8sync_cscEv]+0x41): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIjEC1IS1_S1_NS_11spglue_plusEEERKNS_6SpGlueIT_T0_T1_EE[_ZN4arma5SpMatIjEC1IS1_S1_NS_11spglue_plusEEERKNS_6SpGlueIT_T0_T1_EE]+0x45b): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIjEC1IS1_S1_NS_11spglue_plusEEERKNS_6SpGlueIT_T0_T1_EE[_ZN4arma5SpMatIjEC1IS1_S1_NS_11spglue_plusEEERKNS_6SpGlueIT_T0_T1_EE]+0x467): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPN4arma5SpMatIjEES5_EET0_T_S7_S6_[_ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPN4arma5SpMatIjEES5_EET0_T_S7_S6_]+0x2e4): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPN4arma5SpMatIjEES5_EET0_T_S7_S6_[_ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPN4arma5SpMatIjEES5_EET0_T_S7_S6_]+0x2f1): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPN4arma5SpMatIjEES5_EET0_T_S7_S6_[_ZNSt20__uninitialized_copyILb0EE13__uninit_copyIPN4arma5SpMatIjEES5_EET0_T_S7_S6_]+0x32d): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZNSt6vectorIN4arma5SpMatIjEESaIS2_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS2_S4_EERKS2_[_ZNSt6vectorIN4arma5SpMatIjEESaIS2_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS2_S4_EERKS2_]+0x416): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZNSt6vectorIN4arma5SpMatIjEESaIS2_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS2_S4_EERKS2_[_ZNSt6vectorIN4arma5SpMatIjEESaIS2_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS2_S4_EERKS2_]+0x423): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZNSt6vectorIN4arma5SpMatIjEESaIS2_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS2_S4_EERKS2_[_ZNSt6vectorIN4arma5SpMatIjEESaIS2_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS2_S4_EERKS2_]+0x46e): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIdEaSIS1_NS_11spop_symmatEEERS1_RKNS_4SpOpIT_T0_EE[_ZN4arma5SpMatIdEaSIS1_NS_11spop_symmatEEERS1_RKNS_4SpOpIT_T0_EE]+0x71): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZN4arma5SpMatIdEaSIS1_NS_11spop_symmatEEERS1_RKNS_4SpOpIT_T0_EE[_ZN4arma5SpMatIdEaSIS1_NS_11spop_symmatEEERS1_RKNS_4SpOpIT_T0_EE]+0x7e): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZN4arma10spdiagviewIdE4fillEd[_ZN4arma10spdiagviewIdE4fillEd]+0x1dc): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZN4arma10spdiagviewIdE4fillEd[_ZN4arma10spdiagviewIdE4fillEd]+0x1ee): undefined reference to `GOMP_critical_end'
bhier.o:bhier.cpp:(.text$_ZN4Rcpp6traits8ExporterIN4arma5SpMatIdEEE3getEv[_ZN4Rcpp6traits8ExporterIN4arma5SpMatIdEEE3getEv]+0xf30): undefined reference to `GOMP_critical_start'
bhier.o:bhier.cpp:(.text$_ZN4Rcpp6traits8ExporterIN4arma5SpMatIdEEE3getEv[_ZN4Rcpp6traits8ExporterIN4arma5SpMatIdEEE3getEv]+0xf46): undefined reference to `GOMP_critical_end'
bhier_parallel.o:bhier_parallel.cpp:(.text+0xe36): undefined reference to `omp_get_num_threads'
bhier_parallel.o:bhier_parallel.cpp:(.text+0xe3d): undefined reference to `omp_get_thread_num'
bhier_parallel.o:bhier_parallel.cpp:(.text+0x1025): undefined reference to `GOMP_barrier'
bhier_parallel.o:bhier_parallel.cpp:(.text+0x1252): undefined reference to `omp_get_num_threads'
bhier_parallel.o:bhier_parallel.cpp:(.text+0x125a): undefined reference to `omp_get_thread_num'
bhier_parallel.o:bhier_parallel.cpp:(.text+0x15b9): undefined reference to `GOMP_barrier'
bhier_parallel.o:bhier_parallel.cpp:(.text+0x1975): undefined reference to `omp_get_num_threads'
bhier_parallel.o:bhier_parallel.cpp:(.text+0x197c): undefined reference to `omp_get_thread_num'
bhier_parallel.o:bhier_parallel.cpp:(.text+0x1d4d): undefined reference to `GOMP_barrier'
bhier_parallel.o:bhier_parallel.cpp:(.text+0x1f38): undefined reference to `omp_set_num_threads'
bhier_parallel.o:bhier_parallel.cpp:(.text+0x2fdc): undefined reference to `GOMP_parallel'
bhier_parallel.o:bhier_parallel.cpp:(.text+0x305b): undefined reference to `GOMP_parallel'
bhier_parallel.o:bhier_parallel.cpp:(.text+0x399d): undefined reference to `GOMP_parallel'
part_llks.o:part_llks.cpp:(.text+0x1e88): undefined reference to `GOMP_critical_start'
part_llks.o:part_llks.cpp:(.text+0x1e9d): undefined reference to `GOMP_critical_end'
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'fastbaps'
* removing 'C:/Users/Idowu/Documents/R/win-library/3.5/fastbaps'
In R CMD INSTALL

shared object ‘fastbaps.dylib’ not found

Hi,
I am a novice in using R packages and apologies in advance if this is not an issue for this forum. I am having trouble with running fastbaps (Mac os High Sierra 10.13.6) after installing it with conda as per the instructions on Github. I have installed all the dependencies and I can load the rest of the packages in R with the exception of fastbaps. The error I get is as follows:
Loading required package: maps

library(fastbaps)
Error: package or namespace load failed for ‘fastbaps’ in library.dynam(lib, package, package.lib):
shared object ‘fastbaps.dylib’ not found
I removed fastbaps and re-installed it a couple of times but that did not solve the issue. The fastbaps.dylib file does not seem to exist amongst all the other .dylib files. Any advice would be appreciated on how to move forward.

Errors with small alignments as input

Running this as part of a pipeline, we end up with a tiny alignment:

>17059_6#10
AGCAC
>17059_6#22
AGCTG
>15995_1#182
AGCTG
>15995_1#150
TATTC
>15995_1#114
AGCTC
>17059_6#81
AGCTC

If I save this as small_fb.aln and import with sparse.data <- import_fasta_sparse_nt("~/Downloads/small_fb.aln") I get the following error:

Error in base::colSums(x, na.rm = na.rm, dims = dims, ...) : 
  'x' must be an array of at least two dimensions

backtrace is

6: stop("'x' must be an array of at least two dimensions")
5: base::colSums(x, na.rm = na.rm, dims = dims, ...)
4: colSums(snp.matrix == 1)
3: colSums(snp.matrix == 1)
2: matrix(c(rep(nrow(snp.matrix), ncol(snp.matrix)), colSums(snp.matrix == 
       1), colSums(snp.matrix == 2), colSums(snp.matrix == 3), colSums(snp.matrix == 
       4)), nrow = 5, byrow = TRUE)
1: import_fasta_sparse_nt("~/Downloads/small_fb.aln")

which I think is from here: https://github.com/gtonkinhill/fastbaps/blob/master/R/import_fasta_sparse_nt.R#L87-L91

At first I thought this was because we only have one non-singleton column, but adding more sites didn't immediately help. I haven't read through the code properly, but I am guessing this is because there needs to be at least one observation of the four bases in passing sites. When I get to every base being represented in non-singleton sites it works ok:

>17059_6#10
AGCACACTG
>17059_6#22
AGCTGACTG
>15995_1#182
AGCTGTAAG
>15995_1#150
TATTCTAAG
>15995_1#114
AGCTCTAAA
>17059_6#81
AGCTCTAAA

For these cases, is it still possible to set the prior and keep running?
If not, would it be possible to give a more informative error message?

(Sorry this is a bit of an edge case, it's just hard to work around from the error message we currently get)

Instalation failling on Windows

I have this issue:

collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'fastbaps'

  • removing 'C:/Users/user/Desktop/SPARTA_Windows-master/R_local/library_local/fastbaps'
    In R CMD INSTALL
    Error in i.p(...) :
    (converted from warning) installation of package ‘C:/Users/user/AppData/Local/Temp/Rtmps5b0zz/file1ef43330616e/fastbaps_1.0.0.tar.gz’ had non-zero exit status
    In addition: Warning messages:
    1: In untar2(tarfile, files, list, exdir) :
    skipping pax global extended headers
    2: In untar2(tarfile, files, list, exdir) :
    skipping pax global extended headers

Index out of bounds

Hi,

I was testing fastbaps with mitochondrial DNA sequences and these errors popped out when running some functions. Here's an example:

library(ape)
library(fastbaps)

data("woodmouse")

wood.sparse <- import_fasta_sparse_nt(woodmouse)
wood.sparse.optim <- optimise_prior(wood.sparse, type="optimise.baps")

Error in tree_llk(temp.sparse.data, temp.h$merge) :
Mat::operator(): index out of bounds

baps.res <- fast_baps(wood.sparse)

[1] "Calculating initial clustering..."
[1] "Calculating initial dk values..."
[1] "Clustering using hierarchical Bayesian clustering..."
Error in bhier_parallel(sparse.data, initial.partition, dk.initial, n.cores) :
Mat::operator(): index out of bounds

What can i do?

Compilation flags

I noticed the optimisation flags -O2 and -O3 are both used:

clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Users/leesj01/Library/R/3.4/library/Rcpp/include" -I"/Users/leesj01/Library/R/3.4/library/RcppArmadillo/include" -I/usr/local/include  -DARMA_64BIT_WORD -O3 -fPIC  -Wall -g -O2 -c tree_llk.cpp -o tree_llk.o

I presume this is unintentional - I'm not sure which will be favoured

Issues installing - compilation failure

Hello,
I'm trying to install fastbaps using the give code
devtools::install_github("gtonkinhill/fastbaps")
but it fails, and I cant figure out how to get it to work, everything is up to date.

Im working on a Mac, that is up to date, and in R v 3.6.0.

here is what prints:

Downloading GitHub repo gtonkinhill/fastbaps@master
Your system is ready to build packages!
✔ checking for file ‘/private/var/folders/16/dn_82z5s0hj1m8mlqj82w_jh0000gq/T/RtmpdskaR0/remotes82b61ec15bc2/gtonkinhill-fastbaps-cfe08b3/DESCRIPTION’ ...
─ preparing ‘fastbaps’:
✔ checking DESCRIPTION meta-information ...
─ cleaning src
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘fastbaps_1.0.0.tar.gz’

  • installing source package ‘fastbaps’ ...
    ** using staged installation
    ** libs
    clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppArmadillo/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -DARMA_64BIT_WORD -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
    clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot]
    In file included from RcppExports.cpp:4:
    In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppArmadillo/include/RcppArmadillo.h:31:
    In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:26:
    In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/RcppCommon.h:29:
    In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/Rcpp/r/headers.h:59:
    In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:100:
    In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:305:
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/math.h:301:15: fatal error: 'math.h' file not found
    #include_next <math.h>
    ^~~~~~~~
    1 error generated.
    make: *** [RcppExports.o] Error 1
    ERROR: compilation failed for package ‘fastbaps’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/fastbaps’
    Error: Failed to install 'fastbaps' from GitHub:
    (converted from warning) installation of package ‘/var/folders/16/dn_82z5s0hj1m8mlqj82w_jh0000gq/T//RtmpdskaR0/file82b6286f2d54/fastbaps_1.0.0.tar.gz’ had non-zero exit status

conda install stuck on solving environment in WSL2

I have been trying to do the conda install using the command suggested in the README.md, however, it has been stuck on solving the environment for several hours. I've been trying to download the package on the Windows Subsystem for Linux 2.

image

Compilation fails on Ubuntu 16.04

Hi @gtonkinhill

Installing from source on Ubuntu 16.04 is broken:

Downloading GitHub repo gtonkinhill/fastbaps@master
from URL https://api.github.com/repos/gtonkinhill/fastbaps/zipball/master
Installing fastbaps
'/usr/local/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore  \
  --quiet CMD INSTALL  \
  '/tmp/RtmpfuppPX/devtools1c9259fbea25/gtonkinhill-fastbaps-e2e5a3f0b4d620ddf9c4b6b968411d76e77feb4a'  \
  --library='/home/simon/R/x86_64-pc-linux-gnu-library/3.4' --install-tests 

* installing *source* package ‘fastbaps’ ...
** libs
g++  -I/usr/local/lib/R/include -DNDEBUG -DARMA_64BIT_WORD=1 -I"/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/simon/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include" -I/usr/local/include   -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from /home/simon/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/armadillo:54:0,
                 from /home/simon/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadilloForward.h:46,
                 from /home/simon/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadillo.h:31,
                 from RcppExports.cpp:4:
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:509:108: note: #pragma message: NOTE: suggest to enable C++14 mode for faster code; add -std=c++14 to compiler flags
     #pragma message ("NOTE: suggest to enable C++14 mode for faster code; add -std=c++14 to compiler flags")
                                                                                                            ^
In file included from /home/simon/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadillo.h:38:0,
                 from RcppExports.cpp:4:
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadilloAs.h: In instantiation of ‘Rcpp::traits::Exporter<arma::Cube<eT> >::cube_t Rcpp::traits::Exporter<arma::Cube<eT> >::get() [with T = long long int; Rcpp::traits::Exporter<arma::Cube<eT> >::cube_t = arma::Cube<long long int>]’:
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadilloAs.h:566:48:   required from here
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadilloAs.h:531:49: error: invalid cast from type ‘Rcpp::Vector<19>::iterator {aka Rcpp::internal::Proxy_Iterator<Rcpp::internal::generic_proxy<19> >}’ to type ‘long long int*’
                 dims[0], dims[1], dims[2], false);
                                                 ^
In file included from /home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/RcppCommon.h:166:0,
                 from /home/simon/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadilloForward.h:26,
                 from /home/simon/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadillo.h:31,
                 from RcppExports.cpp:4:
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/internal/export.h: In instantiation of ‘void Rcpp::internal::export_indexing(SEXP, T&) [with T = arma::Mat<long long int>; value_type = long long int; SEXP = SEXPREC*]’:
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/internal/Exporter.h:86:64:   required from ‘T Rcpp::traits::MatrixExporter<T, value_type>::get() [with T = arma::Mat<long long int>; value_type = long long int]’
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/as.h:89:33:   required from ‘T Rcpp::internal::as(SEXP, Rcpp::traits::r_type_generic_tag) [with T = arma::Mat<long long int>; SEXP = SEXPREC*]’
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/as.h:152:31:   required from ‘T Rcpp::as(SEXP) [with T = arma::Mat<long long int>; SEXP = SEXPREC*]’
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/InputParameter.h:34:43:   required from ‘Rcpp::InputParameter<T>::operator T() [with T = arma::Mat<long long int>]’
RcppExports.cpp:44:55:   required from here
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/internal/export.h:155:43: error: no matching function for call to ‘export_indexing__dispatch(SEXPREC*&, arma::Mat<long long int>&, Rcpp::traits::r_type_traits<long long int>::r_category)’
    export_indexing__dispatch<T,value_type>(
                                           ^
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/internal/export.h:131:8: note: candidate: template<class T, class value_type> void Rcpp::internal::export_indexing__dispatch(SEXP, T&, Rcpp::traits::r_type_primitive_tag)
   void export_indexing__dispatch( SEXP x, T& res, ::Rcpp::traits::r_type_primitive_tag ) {
        ^
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/internal/export.h:131:8: note:   template argument deduction/substitution failed:
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/internal/export.h:155:43: note:   cannot convert ‘Rcpp::traits::r_type_traits<long long int>::r_category()’ (type ‘Rcpp::traits::r_type_traits<long long int>::r_category {aka Rcpp::traits::r_type_generic_tag}’) to type ‘Rcpp::traits::r_type_primitive_tag’
    export_indexing__dispatch<T,value_type>(
                                           ^
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/internal/export.h:140:8: note: candidate: template<class T, class value_type> void Rcpp::internal::export_indexing__dispatch(SEXP, T&, Rcpp::traits::r_type_string_tag)
   void export_indexing__dispatch( SEXP x, T& res, ::Rcpp::traits::r_type_string_tag ) {
        ^
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/internal/export.h:140:8: note:   template argument deduction/substitution failed:
/home/simon/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/internal/export.h:155:43: note:   cannot convert ‘Rcpp::traits::r_type_traits<long long int>::r_category()’ (type ‘Rcpp::traits::r_type_traits<long long int>::r_category {aka Rcpp::traits::r_type_generic_tag}’) to type ‘Rcpp::traits::r_type_string_tag’
    export_indexing__dispatch<T,value_type>(
                                           ^
/usr/local/lib/R/etc/Makeconf:166: recipe for target 'RcppExports.o' failed
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘fastbaps’
* removing ‘/home/simon/R/x86_64-pc-linux-gnu-library/3.4/fastbaps’
* restoring previous ‘/home/simon/R/x86_64-pc-linux-gnu-library/3.4/fastbaps’
Installation failed: Command failed (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.