Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Consolidate CLI #650

Merged
merged 33 commits into from
Jan 30, 2025
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c0077ab
.
tedil Nov 28, 2024
cc28a90
use TranscriptSettings in test args
tedil Dec 16, 2024
2031dbd
lints
tedil Dec 16, 2024
133e7da
merge tx dbs separated by genome release
tedil Dec 16, 2024
e5fd61e
load csq predictors depending on genome release in the server subcmd
tedil Dec 16, 2024
0a29b1c
also skip freq and clinvar dbs if assembly does not match, more info …
tedil Dec 17, 2024
6e43c13
lint: explicit named lifetimes
tedil Dec 17, 2024
1f568f8
rephrase info about skipped databases
tedil Dec 17, 2024
8f4decb
check whether the predictor could be successfully instantiated, other…
tedil Dec 17, 2024
b6df08c
fix typo
tedil Dec 17, 2024
7f159db
rename fn seqvars to consequence
tedil Dec 17, 2024
d64eaad
remove databases.is_empty assertion because that is tested anyway
tedil Dec 17, 2024
d0672ab
update sources help texts
tedil Jan 2, 2025
eea025e
fmt
tedil Jan 2, 2025
e93b5f1
include strand in seqvars/csq
tedil Jan 2, 2025
ff126ce
add frequency endpoint (wip)
tedil Jan 2, 2025
551d6cf
update 'try: …' hints to openapi
tedil Jan 2, 2025
40796ab
do not initialize predictors/annotators multiple times
tedil Jan 2, 2025
9a70495
add frequency to apidocs
tedil Jan 2, 2025
cc07876
also allow multiple --frequencies and --clinvar options
tedil Jan 2, 2025
b0af0ea
whitespace
tedil Jan 2, 2025
4097675
add clinvar endpoint
tedil Jan 2, 2025
720b934
merge origin/main
tedil Jan 2, 2025
05784eb
update warning for multiple clinvar or freq dbs
tedil Jan 2, 2025
ed2b713
update openapi schema
tedil Jan 2, 2025
f1c010f
update entrypoint to match new server run cli
tedil Jan 3, 2025
ee9ebf1
fix server run clinvar docstrings
tedil Jan 3, 2025
5fd01b5
update openapi.schema.yaml accordingly
tedil Jan 3, 2025
78d646c
merge origin/main
tedil Jan 24, 2025
ec077dc
remove unused path_db from test
tedil Jan 24, 2025
61ee096
only print hints for available endpoints
tedil Jan 24, 2025
096c922
server: add exemplary Grch38 hints
tedil Jan 24, 2025
fa2cbeb
fix typo in fn name
tedil Jan 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update entrypoint to match new server run cli
tedil committed Jan 3, 2025
commit f1c010fe8dd74330d1293c47153e38ba35b4cb78
18 changes: 15 additions & 3 deletions utils/docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -7,16 +7,23 @@ set -euo pipefail
#
# PATH_DB -- path to the database directory containing,
# e.g., `grch3{7,8}/*.zst`.
# default: /data/hpo
# default: /data/mehari/db
# HTTP_HOST -- host to listen on
# default: 0.0.0.0
# HTTP_PORT -- port
# default: 8080

PATH_DB=${PATH_DB-/data/mehari}
PATH_DB=${PATH_DB-/data/mehari/db}
HTTP_HOST=${HTTP_HOST-0.0.0.0}
HTTP_PORT=${HTTP_PORT-8080}

PATH_TRANSCRIPTS_37=$PATH_DB/grch37/seqvars/txs.bin.zst
PATH_TRANSCRIPTS_38=$PATH_DB/grch38/seqvars/txs.bin.zst
PATH_FREQUENCIES_37=$PATH_DB/grch37/seqvars/freqs
PATH_FREQUENCIES_38=$PATH_DB/grch38/seqvars/freqs
PATH_CLINVAR_37=$PATH_DB/grch37/seqvars/clinvar
PATH_CLINVAR_38=$PATH_DB/grch38/seqvars/clinvar

first=${1-}

if [ "$first" == exec ]; then
@@ -26,7 +33,12 @@ else
exec \
mehari \
server run \
--path-db "$PATH_DB" \
$(test -e "$PATH_TRANSCRIPTS_37" && echo --transcripts "$PATH_TRANSCRIPTS_37") \
$(test -e "$PATH_TRANSCRIPTS_38" && echo --transcripts "$PATH_TRANSCRIPTS_38") \
$(test -e "$PATH_FREQUENCIES_37" && echo --frequencies "$PATH_FREQUENCIES_37") \
$(test -e "$PATH_FREQUENCIES_38" && echo --frequencies "$PATH_FREQUENCIES_38") \
$(test -e "$PATH_CLINVAR_37" && echo --clinvar "$PATH_CLINVAR_37") \
$(test -e "$PATH_CLINVAR_38" && echo --clinvar "$PATH_CLINVAR_38") \
--listen-host "$HTTP_HOST" \
--listen-port "$HTTP_PORT"
fi

Unchanged files with check annotations Beta

/// Path to the input TSV file.
#[arg(long)]
pub path_input_tsv: String,
/// Path to the reference FASTA file.

Check warning on line 33 in src/verify/seqvars.rs

GitHub Actions / clippy

empty line after doc comment

warning: empty line after doc comment --> src/verify/seqvars.rs:32:5 | 32 | / /// Path to the reference FASTA file. 33 | | | |_ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default = help: if the empty line is unintentional remove it
#[arg(long)]
pub path_reference_fasta: String,
/// Path to output TSV file.

Check warning on line 37 in src/verify/seqvars.rs

GitHub Actions / clippy

empty line after doc comment

warning: empty line after doc comment --> src/verify/seqvars.rs:36:5 | 36 | / /// Path to output TSV file. 37 | | | |_ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments = help: if the empty line is unintentional remove it
#[arg(long)]
pub path_output_tsv: String,
fn _extract_transcripts_by_txid(
container_tx_db: &TranscriptDb,
transcript_ids: &Vec<String>,

Check warning on line 228 in src/db/subset/mod.rs

GitHub Actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/db/subset/mod.rs:228:21 | 228 | transcript_ids: &Vec<String>, | ^^^^^^^^^^^^ help: change this to: `&[String]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
) -> (IndexSet<usize>, IndexSet<String>, IndexSet<String>) {
let transcript_ids = IndexSet::<String>::from_iter(transcript_ids.iter().cloned());
let (tx_idxs, gene_ids) = __extract_transcripts_from_db(container_tx_db, &transcript_ids);
fn _extract_transcripts_by_hgnc_id(
container_tx_db: &TranscriptDb,
gene_symbols: &Vec<String>,

Check warning on line 241 in src/db/subset/mod.rs

GitHub Actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/db/subset/mod.rs:241:19 | 241 | gene_symbols: &Vec<String>, | ^^^^^^^^^^^^ help: change this to: `&[String]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
) -> Result<(IndexSet<usize>, IndexSet<String>, IndexSet<String>)> {
let hgnc_ids = IndexSet::<String>::from_iter(gene_symbols.iter().cloned());
let mut tx_idxs = Vec::new();
}
pub(crate) fn load_transcript_dbs_for_assembly(
tx_sources: &Vec<String>,

Check warning on line 2119 in src/annotate/seqvars/mod.rs

GitHub Actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/annotate/seqvars/mod.rs:2119:17 | 2119 | tx_sources: &Vec<String>, | ^^^^^^^^^^^^ help: change this to: `&[String]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg = note: `#[warn(clippy::ptr_arg)]` on by default
assembly: Option<Assembly>,
) -> Result<Vec<TxSeqDatabase>, Error> {
let pb_assembly = assembly.as_ref().and_then(proto_assembly_from);