Skip to content

Commit

Permalink
MISC: for several problems
Browse files Browse the repository at this point in the history
1. remove renv.lock since it only work for Apple Silicon because the hash sum
2. ignore the R files in pre-commit since renv::restore() will modify it.
3. Update the documentation for R package installation.
  • Loading branch information
tcztzy committed Feb 20, 2024
1 parent ff85dfd commit 76cc8ea
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 359 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ __pycache__/
# Rust files
/Cargo.lock
/target/

# renv
/renv.lock
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ repos:
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: .*\.R
- id: end-of-file-fixer
- id: check-toml
- id: check-yaml
Expand Down
40 changes: 40 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
1. [rustup](https://rustup.rs/)
2. (Optional) [samtools](http://www.htslib.org/) and
[bedops](https://bedops.readthedocs.io/en/latest/) for executing `smc2bed-all`
3. (Optional) R for plotting

```bash
# Install rustup
Expand All @@ -15,12 +16,51 @@ brew install samtools bedops
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
conda install -c bioconda samtools bedops
# Install R
sudo apt-get install r-base
# Or
brew install r
# Restore the environment
R -e "renv::restore()"
R -e "renv::install('./R/argweaver')"
# And then, install
pip install argweavers+git://github.com/tcztzy/argweaver
# OR from pypi
pip install argweavers
```

## Notions for R package

### `ape`
If you are using macOS with Apple Silicon, you may also face the following error while install `ape`:

```
fatal error: pcre.h: No such file or directory
```

You can fix it by installing `pcre` using homebrew:

```bash
brew install pcre
```

And then export `CFLAGS`:
```bash
export CFLAGS="-I/opt/homebrew/include"
```

### `RPHAST`

Since the RPHAST package is not available on CRAN, you need to install it from
GitHub. Since the original RPHAST package is not compatible with the latest
version of R, you need to install the coregenomics/RPHAST@bugfix/f77_call branch from GitHub. [See here for the details](https://github.com/CshlSiepelLab/RPHAST/pull/6).

```R
devtools::install_github("coregenomics/RPHAST@bugfix/f77_call")
```



## Build from source

```console
Expand Down
109 changes: 0 additions & 109 deletions renv.lock

This file was deleted.

Loading

0 comments on commit 76cc8ea

Please sign in to comment.