diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 790b671b..ab414d31 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -102,6 +102,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: + key: "${{ matrix.label }}" cache-directories: | ~/.cargo/registry/src/**/librocksdb-sys-* @@ -109,14 +110,14 @@ jobs: uses: actions-rs/tarpaulin@v0.1 with: version: 0.21.0 - args: "-- --test-threads 1" + args: "--skip-clean -- --test-threads 1" if: ${{ matrix.label == 'fast' }} - name: Run cargo-tarpaulin with full tests uses: actions-rs/tarpaulin@v0.1 with: version: 0.21.0 - args: "--release --timeout=180 -- --include-ignored" + args: "--skip-clean --release --timeout=180 -- --include-ignored" if: ${{ matrix.label == 'full' }} - name: Codecov submission of fast test results diff --git a/src/common.rs b/src/common.rs index a6b39484..a030ac1a 100644 --- a/src/common.rs +++ b/src/common.rs @@ -29,7 +29,7 @@ pub fn trace_rss_now() { #[derive( clap::ValueEnum, serde::Serialize, serde::Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash, )] -#[serde(rename_all = "kebab-case")] +#[serde(rename_all = "snake_case")] pub enum GenomeRelease { Grch37, Grch38, @@ -95,7 +95,7 @@ pub fn version() -> &'static str { /// Version information that is returned by the HTTP server. #[derive(serde::Serialize, serde::Deserialize, Default, Debug, Clone)] #[serde_with::skip_serializing_none] -#[serde(rename_all = "kebab-case")] +#[serde(rename_all = "snake_case")] pub struct Version { /// Version of the transcript database data. pub tx_db: Option, diff --git a/src/server/actix_server/mod.rs b/src/server/actix_server/mod.rs index 33dfe957..ec64eaea 100644 --- a/src/server/actix_server/mod.rs +++ b/src/server/actix_server/mod.rs @@ -5,8 +5,8 @@ use actix_web::ResponseError; use crate::annotate::strucvars::csq::ConsequencePredictor as StrucvarConsequencePredictor; use crate::{annotate::seqvars::csq::ConsequencePredictor, common::GenomeRelease}; +pub mod seqvars_csq; pub mod strucvars_csq; -pub mod tx_csq; #[derive(Debug)] struct CustomError { @@ -47,7 +47,7 @@ pub async fn main( actix_web::HttpServer::new(move || { actix_web::App::new() .app_data(data.clone()) - .service(tx_csq::handle) + .service(seqvars_csq::handle) .service(strucvars_csq::handle) .wrap(actix_web::middleware::Logger::default()) }) diff --git a/src/server/actix_server/tx_csq.rs b/src/server/actix_server/seqvars_csq.rs similarity index 96% rename from src/server/actix_server/tx_csq.rs rename to src/server/actix_server/seqvars_csq.rs index a6781b53..99ec5808 100644 --- a/src/server/actix_server/tx_csq.rs +++ b/src/server/actix_server/seqvars_csq.rs @@ -1,4 +1,4 @@ -//! Implementation of `/tx/csq` endpoint. +//! Implementation of `/seqvars/csq` endpoint. use actix_web::{ get, @@ -16,10 +16,10 @@ use crate::{ common::GenomeRelease, }; -/// Parameters for `/tx/csq`. +/// Parameters for `/seqvars/csq`. /// #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)] -#[serde(rename_all = "kebab-case")] +#[serde(rename_all = "snake_case")] #[serde_with::skip_serializing_none] struct Query { /// The assembly. @@ -38,7 +38,7 @@ struct Query { /// Result entry for the API. #[derive(Debug, serde::Serialize, serde::Deserialize)] -#[serde(rename_all = "kebab-case")] +#[serde(rename_all = "snake_case")] struct ResultEntry { /// The consequences of the allele. pub consequences: Vec, @@ -85,7 +85,7 @@ struct Container { /// Query for consequence of a variant. #[allow(clippy::unused_async)] -#[get("/tx/csq")] +#[get("/seqvars/csq")] async fn handle( data: Data, _path: Path<()>, diff --git a/src/server/mod.rs b/src/server/mod.rs index 6b02104e..cd3e030d 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -50,14 +50,21 @@ pub fn print_hints(args: &Args) { // The endpoint `/tx/csq` to comput ethe consequence of a variant; without and with filtering // for HGNC gene ID. tracing::info!( - " try: http://{}:{}/tx/csq?genome-release=grch37\ + " try: http://{}:{}/seqvars/csq?genome_release=grch37\ &chromosome=17&position=48275363&reference=C&alternative=A", args.listen_host.as_str(), args.listen_port ); tracing::info!( - " try: http://{}:{}/tx/csq?genome-release=grch37\ - &chromosome=17&position=48275363&reference=C&alternative=A&hgnc-id=HGNC:2197", + " try: http://{}:{}/seqvars/csq?genome_release=grch37\ + &chromosome=17&position=48275363&reference=C&alternative=A&hgnc_id=HGNC:2197", + args.listen_host.as_str(), + args.listen_port + ); + // The endpoint `/strucvars/csq` computes the consequence of an SV. + tracing::info!( + " try: http://{}:{}/strucvars/csq?genome_release=grch37\ + &chromosome=17&start=48275360&&stop=48275370&sv_type=DEL", args.listen_host.as_str(), args.listen_port );