Skip to content

Commit

Permalink
Continue getting closer.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Oct 14, 2024
1 parent f4da0db commit eb9b7f1
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 20 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- master
pull_request:

name: Build the tool

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Update NPM packages
run: npm i --include=dev

- name: Cache installed
id: installed
uses: actions/cache@v4
with:
path: extern/installed
key: deps-${{ hashFiles('extern/**/build.sh') }}

- name: Build igraph
if: steps.installed.outputs.cache-hit != 'true'
run: |
cd extern/igraph
bash build.sh
- name: Build the tool
run: |
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=extern/igraph
cmake --build build
- name: Add knncolle tagfile
uses: wei/wget@v1
with:
args: -O matrix.mtx.gz https://github.com/kanaverse/random-test-files/releases/download/zeisel-brain-v1.0.0/matrix.mtx.gz

- name: Run the tool
run: ./build/scran --mito-list 19972-20005 matrix.mtx.gz
41 changes: 22 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CLI for single-cell analyses

![Unit tests](https://github.com/libscran/scran-cli/actions/workflows/run-tests.yaml/badge.svg)

## Overview

This repository implements a command-line tool for single-cell RNA-seq data analysis from a Matrix Market file.
Expand Down Expand Up @@ -33,30 +35,31 @@ This will produce a `scran` executable in `build`, which can be run on the comma
```bash
./build/scran --help
## Single-cell RNA-seq analyses on the command-line
## Usage: ./build/scran [OPTIONS] path
## Usage: ./build/scran [OPTIONS] counts
##
## Positionals:
## path TEXT REQUIRED Path to the Matrix Market file
## counts TEXT REQUIRED Path to the MatrixMarket file containing the counts.
##
## Options:
## -h,--help Print this help message and exit
## -t,--nthreads FLOAT=1 Number of threads to use (+2 for UMAP and t-SNE, which use their own threads)
## -o,--output TEXT=output Path to the output directory
## --skip-output BOOLEAN=0 Run the analysis but do not save results
## --qc-nmads FLOAT=3 Number of MADs to use for filtering
## --hvg-span FLOAT=0.4 LOWESS span for variance modelling
## --hvg-num INT=2500 Number of HVGs to use for PCA
## --pca-num INT=25 Number of PCs to keep
## --nn-approx BOOLEAN=1 Whether to use an approximate neighbor search
## --snn-neighbors INT=10 Number of neighbors to use for the SNN graph
## --snn-scheme ENUM:value in {jaccard->2,number->1,ranked->0} OR {2,1,0}=0
## Edge weighting scheme: ranked, number or jaccard
## --snn-res FLOAT=1 Resolution to use in multi-level community detection
## --tsne-perplexity FLOAT=30 Perplexity to use in t-SNE
## --tsne-iter INT=500 Number of iterations to use in t-SNE
## --umap-neighbors INT=15 Number of neighbors to use in the UMAP
## --umap-mindist FLOAT=0.01 Minimum distance to use in the UMAP
## --umap-epochs INT=500 Number of epochs to use in the UMAP
## -o,--output TEXT [output] Path to the output directory. If empty, results are not saved.
## --mito-list TEXT Comma-separated list of the 0-based row indices of the mitochondrial genes. Closed intervals are also accepted as 'X-Y'.
## --num-mads FLOAT [3] Number of MADs to use for defining QC thresholds.
## --fit-span FLOAT [0.3] LOWESS span for fitting the mean-variance trend.
## --num-hvgs INT [2500] Number of HVGs to use for PCA.
## --num-pcs INT [25] Number of PCs to keep.
## --nn-approx INT [1] Whether to use an approximate neighbor search.
## --snn-neighbors INT [10] Number of neighbors to use for the SNN graph.
## --snn-scheme TEXT:{ranked,number,jaccard} [ranked]
## Edge weighting scheme for SNN graph construction.
## --snn-res FLOAT [0.5] Resolution to use in multi-level community detection.
## --tsne-perplexity FLOAT [30]
## Perplexity to use in t-SNE.
## --tsne-iter FLOAT [500] Number of iterations to use in t-SNE.
## --umap-neighbors INT [15] Number of neighbors to use in the UMAP.
## --umap-mindist FLOAT [0.1] Minimum distance to use in the UMAP.
## --umap-epochs INT [500] Number of epochs to use in the UMAP.
## -t,--nthreads INT [1] Number of threads to use (+2 for UMAP and t-SNE, which use their own threads).
```

## Usage instructions
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int main(int argc, char* argv []) {
app.add_option("counts", all_opt.file_path, "Path to the MatrixMarket file containing the counts.")->required();
app.add_option("-o,--output", all_opt.output, "Path to the output directory. If empty, results are not saved.")->default_val("output");

app.add_option("--mito-list", all_opt.mito_list, "Comma-separated list of the 0-based row indices of the mitochondrial genes")->default_val("");
app.add_option("--mito-list", all_opt.mito_list, "Comma-separated list of the 0-based row indices of the mitochondrial genes. Closed intervals are also accepted as 'X-Y'.")->default_val("");
app.add_option("--num-mads", all_opt.num_mads, "Number of MADs to use for defining QC thresholds.")->default_val(3);

app.add_option("--fit-span", all_opt.fit_span, "LOWESS span for fitting the mean-variance trend.")->default_val(0.3);
Expand Down

0 comments on commit eb9b7f1

Please sign in to comment.