diff --git a/Cargo.lock b/Cargo.lock index 9083ef8..abff80c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -449,7 +449,7 @@ dependencies = [ [[package]] name = "cli" -version = "1.2.0" +version = "1.3.0" dependencies = [ "colored", "fastq2comp", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index ed162f4..e5d5153 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cli" -version = "1.2.0" +version = "1.3.0" edition = "2018" authors = ["Kartavya Vashishtha "] description = "A tool to predict the sequencing library type from the base composition of a supplied FastQ file. Uncompresses .gz files when reading." diff --git a/cli/README.md b/cli/README.md index 6523fb7..b8de5ef 100644 --- a/cli/README.md +++ b/cli/README.md @@ -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. @@ -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 @@ -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 directory (eg. `output_dir/`) [default: ] @@ -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. diff --git a/cli/src/bin/librarian.rs b/cli/src/bin/librarian.rs index 04dc392..4d7aebf 100644 --- a/cli/src/bin/librarian.rs +++ b/cli/src/bin/librarian.rs @@ -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, @@ -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, diff --git a/docs/cli b/docs/cli new file mode 120000 index 0000000..928e56d --- /dev/null +++ b/docs/cli @@ -0,0 +1 @@ +../cli \ No newline at end of file diff --git a/docs/installation.md b/docs/installation.md index 1c7ac05..5584468 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -3,3 +3,9 @@ hide: - footer --- + +## CLI installation +View [CLI installation](cli/README.md#installation) for more details. + +## Server installation +View [Server installation](server/README.md#installation) for more details. \ No newline at end of file diff --git a/docs/server b/docs/server new file mode 120000 index 0000000..3e6e796 --- /dev/null +++ b/docs/server @@ -0,0 +1 @@ +../server \ No newline at end of file diff --git a/Dockerfile b/local-cli.dockerfile similarity index 91% rename from Dockerfile rename to local-cli.dockerfile index 7c3de39..86574e6 100644 --- a/Dockerfile +++ b/local-cli.dockerfile @@ -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 \ No newline at end of file diff --git a/server/README.md b/server/README.md index 2545d9a..6a49bed 100644 --- a/server/README.md +++ b/server/README.md @@ -1,21 +1,14 @@ # 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 @@ -23,12 +16,12 @@ apt-get install -y r-base-core r-base-dev libssl-dev libcurl4-openssl-dev libxml 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.