marcomilanesi / BITE

BITE: BioInformatics tools for everyone
19 stars 9 forks source link

How to install package in R #9

Closed HangweiXi closed 1 year ago

HangweiXi commented 1 year ago

Hi, I'm wondering how to install the BITE package in R? I've tried "install.packages("BITE")" but it can't find the package.

Cheers, Hangwei

capemaster commented 1 year ago

Hi, the package can be installed from source, please follow the instruction on the main page. Cheers

kcairns commented 1 year ago

I am also having issues with installing BITE because of the GENabel dependancy. GENabel won't install, despite using the code devtools::install_url("https://cran.r-project.org/src/contrib/Archive/GenABEL/GenABEL_1.8-0.tar.gz")

I get the following error:

clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include  -DCOMPILE_WITH_R -fPIC  -Wall -g -O2  -c export_plink.cpp -o export_plink.o
export_plink.cpp:116:39: warning: array subscript is of type 'char' [-Wchar-subscripts]
            fileWoA << " " << Genotype[gtMatrix[i][csnp]];
                                      ^~~~~~~~~~~~~~~~~~
1 warning generated.
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c fexact.c -o fexact.o
fexact.c:1025:6: error: use of undeclared identifier 'PROBLEM'
            PROBLEM "Bug in FEXACT: gave negative key" RECOVER(NULL_ENTRY);
            ^
fexact.c:1806:5: error: use of undeclared identifier 'PROBLEM'
    PROBLEM "FEXACT error %d.\n%s", icode, mes RECOVER(NULL_ENTRY);
    ^
2 errors generated.
make: *** [fexact.o] Error 1
ERROR: compilation failed for package ‘GenABEL’
* removing ‘/Users/kyliecairns/Library/R/x86_64/4.2/library/GenABEL’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/y7/rpt5qcnj4ggf_dxzfd_646z80000gn/T//RtmpAabixH/filebd3d1ba0b70/GenABEL_1.8-0.tar.gz’ had non-zero exit status
HangweiXi commented 1 year ago

Downgrade R version to 4.1.2 might help

capemaster commented 1 year ago

Hi we are aware of problem of installation with old packages. BITE is going to be extensively rewritten to avoid dependencies as much as possible. In the meantime please use a previous R version that may help.