Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kartva committed Jan 8, 2024
2 parents 32182e6 + 42c9811 commit 0535545
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cli"
version = "1.2.0"
version = "1.3.0"
edition = "2018"
authors = ["Kartavya Vashishtha <[email protected]>"]
description = "A tool to predict the sequencing library type from the base composition of a supplied FastQ file. Uncompresses .gz files when reading."
Expand Down
14 changes: 10 additions & 4 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Queries the Babraham server (or your own!) with supplied FASTQ files and downloads plots.

```
Librarian CLI 1.2.0
Librarian CLI 1.3.0
A tool to predict the sequencing library type from the base composition of a supplied FastQ file. Uncompresses .gz files
when reading.
Expand All @@ -19,10 +19,14 @@ FLAGS:
installed, along with the `scripts` folder. See
https://github.com/DesmondWillowbrook/Librarian/blob/master/cli/README.md for more details.
This cannot be set together with `api`.
This cannot be set together with `--api`.
-q, --quiet
Suppresses all output except errors
--raw
Only output the librarian_heatmap.txt file used by MultiQC, and don't output any plots.
This option requires `local` to be set.
-V, --version
Prints version information
Expand All @@ -32,7 +36,7 @@ OPTIONS:
Specifies query URL to send prediction request to. Defaults to Babraham Bioinformatic's server. Passed
argument is given precedence over environment variable.
If --local is set, this argument is ignored. [env: LIBRARIAN_API_URL=] [default:
This cannot be set together with `--local`. [env: LIBRARIAN_API_URL=] [default:
https://www.bioinformatics.babraham.ac.uk/librarian/api/plot_comp]
-o, --output-dir <output-dir>
Output directory (eg. `output_dir/`) [default: ]
Expand All @@ -49,7 +53,9 @@ CLI binaries can be found in the [Github Releases](https://github.com/DesmondWil

The released binaries are statically linked with `musl`, so there shouldn't be too much in the way of system requirements for the CLI except running Linux.

Running with the `--local` option **requires additional dependencies** to be installed. Refer to the [server README's Runtime Dependencies section](../server/README.md#runtime-dependencies) for a list of the other dependencies. (The CLI tar file includes a copy of the `scripts` folder beside the binary)
Running with the `--local` option **requires additional dependencies** to be installed. Refer to the [server README's *Runtime Dependencies* section](../server/README.md#runtime-dependencies) for a list of the other dependencies. (The CLI tar file includes a copy of the `scripts` folder beside the binary)

You might find it useful to refer to [the CLI dockerfile](../local-cli.dockerfile) for a list of dependencies.

## Install from source
Requires a recent version of the [Rust](https://rust-lang.org) toolchain.
Expand Down
4 changes: 2 additions & 2 deletions cli/src/bin/librarian.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct Cli {
/// Defaults to Babraham Bioinformatic's server.
/// Passed argument is given precedence over environment variable.
///
/// If --local is set, this argument is ignored.
/// This cannot be set together with `--local`.
///
#[structopt(long, env = "LIBRARIAN_API_URL", default_value = "https://www.bioinformatics.babraham.ac.uk/librarian/api/plot_comp")]
pub api: String,
Expand All @@ -45,7 +45,7 @@ struct Cli {
/// Requires Rscript and other dependencies to be installed, along with the `scripts` folder.
/// See https://github.com/DesmondWillowbrook/Librarian/blob/master/cli/README.md for more details.
///
/// This cannot be set together with `api`.
/// This cannot be set together with `--api`.
///
#[structopt(short, long, conflicts_with("api"))]
pub local: bool,
Expand Down
1 change: 1 addition & 0 deletions docs/cli
6 changes: 6 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ hide:
- footer
---

<!--if you edit this, make sure you also edit -->
## CLI installation
View [CLI installation](cli/README.md#installation) for more details.

## Server installation
View [Server installation](server/README.md#installation) for more details.
1 change: 1 addition & 0 deletions docs/server
5 changes: 3 additions & 2 deletions Dockerfile → local-cli.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ LABEL org.opencontainers.image.source https://github.com/DesmondWillowbrook/Libr
ENTRYPOINT ["./librarian", "--local", "--raw", "--output-dir", "/app/out/"]

# example command to run this image:
# docker run -v \
# ~/Babraham_Projects/Librarian/frontend/example_inputs/example_inputs/:/app/in # volume mapping from host to container
# docker run \
# -v $(pwd):/app/in # volume mapping from host to container
# -v $(pwd)/out:/app/out # volume mapping from host to container
# -e RUST_LOG='trace' # set the log level to trace
# -t desmondwillowbrook/librarian-server # image name
# /app/in/RNA.example.fastq # path of file relative to mapped volume
17 changes: 5 additions & 12 deletions server/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
# Server
Serves the webpages in `frontend/dist` along with running backend services.

## Setup:
## Installation

```bash
docker pull docker.io/desmondwillowbrook/librarian-server
docker run -dp 8186:8186 desmondwillowbrook/librarian-server
```

### Non-Docker setup

#### Build dependencies
### Build dependencies
- [`npm`](https://www.npmjs.com/get-npm)
- [`Rust (with Cargo)`](https://www.rust-lang.org/)
- [`wasm-pack`](https://rustwasm.github.io/wasm-pack/installer/)

#### Runtime dependencies
### Runtime dependencies
The `scripts` folder included with the binary should be in the same directory as the binary. `Rscript` should be present in $PATH.

```bash
apt-get install -y r-base-core r-base-dev libssl-dev libcurl4-openssl-dev libxml2-dev
Rscript -e 'install.packages(c("tidyverse", "umap", "ggrastr", "pins", "rmarkdown"))'
```

#### Building from source
### Building from source

```bash
git clone https://github.com/DesmondWillowbrook/Librarian.git
cd Librarian
./run.sh
./run-server.sh
```

Alternatively, in case you haven't made any changes to the frontend, you can just run the server binary without rebuilding the frontend website.
Expand Down

0 comments on commit 0535545

Please sign in to comment.