From 9fcbfe9f00d2d6725965c4916bab57baca65ec07 Mon Sep 17 00:00:00 2001 From: Rob Patro Date: Tue, 13 Jun 2023 13:23:29 -0400 Subject: [PATCH 1/3] try again --- .github/workflows/release-please.yml | 38 ++++++++++++++++++++++++++++ Cargo.toml | 29 +++++++++++++++++++-- README.md | 4 ++- 3 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..b3f7660 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,38 @@ +on: + push: + branches: + - main + +name: release-please + +jobs: + release-please: + if: github.repository_owner == 'COMBINE-lab' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: GoogleCloudPlatform/release-please-action@v3 + id: release_main + with: + release-type: rust + package-name: roers + bump-minor-pre-major: true + path: . + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + if: ${{ steps.release_main.outputs.release_created }} + with: + toolchain: stable + override: true + + - uses: Swatinem/rust-cache@v1.3.0 + if: ${{ steps.release_main.outputs.release_created }} + + - name: Publish roers + if: ${{ steps.release_main.outputs.release_created }} + uses: actions-rs/cargo@v1 + with: + command: publish + args: --token ${{ secrets.CRATES_IO_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index 48dd937..c52c0cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,31 @@ name = "roers" version = "0.1.0" edition = "2021" +authors = [ + "Dongze He ", + "Rob Patro ", +] +description = "A tool to prepare augmented annotations for single-cell RNA-seq analysis." +license-file = "LICENSE" +readme = "README.md" +repository = "https://github.com/COMBINE-lab/roers" +homepage = "https://github.com/COMBINE-lab/roers" +include = [ + "/src/lib/lib.rs", + "/src/main.rs", + "/Cargo.toml", + "/Cargo.lock", + "/README.md", + "/LICENSE", +] +keywords = [ + "genomics", + "GTF-GFF", + "splici", + "scRNA-seq", + "augmented-reference", +] +categories = ["science", "data-structures"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [[bin]] @@ -15,11 +40,11 @@ path = "src/lib/lib.rs" [dependencies] anyhow = "1.0.71" clap = { version = "4.3.3", features = ["derive", "wrap_help","cargo"] } -grangers = { git = "https://github.com/COMBINE-lab/grangers.git", branch="dev" } +grangers = { git = "https://github.com/COMBINE-lab/grangers.git", branch="dev", version = "0.1.4" } polars = { version = "0.30", features = ["lazy","dataframe_arithmetic","sort_multiple", "checked_arithmetic","rows","dtype-struct", "dtype-categorical", "list_eval","concat_str", "strings"]} peak_alloc = "0.2.0" tracing = "0.1.37" tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } noodles = { version = "0.41.0", features = ["fasta"] } -serde = {version = "1.0.163", features = ["derive"]} +serde = {version = "1.0.164", features = ["derive"]} serde_json = "1.0.96" diff --git a/README.md b/README.md index 55c4417..b77ec16 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# roers \ No newline at end of file +# roers + +A rust library for preparing expanded transcriptome references for quantification with [`alevin-fry`](https://alevin-fry.readthedocs.io/en/latest/). From d34434fa24380adf2502e7c6371432ce66861d72 Mon Sep 17 00:00:00 2001 From: Rob Patro Date: Tue, 13 Jun 2023 13:24:22 -0400 Subject: [PATCH 2/3] cargo fmt --- src/lib/lib.rs | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/src/lib/lib.rs b/src/lib/lib.rs index 7a06930..05cba9b 100644 --- a/src/lib/lib.rs +++ b/src/lib/lib.rs @@ -3,8 +3,8 @@ use clap::builder::{PossibleValuesParser, TypedValueParser}; use grangers::grangers::{options, Grangers}; use polars::lazy::dsl::concat_str; use polars::prelude::*; -use serde_json::json; use serde::Serialize; +use serde_json::json; use std::collections::HashSet; use std::ops::Add; use std::path::PathBuf; @@ -337,7 +337,7 @@ pub fn make_ref(aug_ref_opts: AugRefOpts) -> anyhow::Result<()> { info!("Processing {} intronic records", intron_gr.df().height(),); // no_flanking_merge decides when the order of merge and extend - // if no_flanking_merge is true, we merge first, then extend + // if no_flanking_merge is true, we merge first, then extend if no_flanking_merge { // Then, we merge the overlapping introns intron_gr = intron_gr.merge( @@ -349,12 +349,8 @@ pub fn make_ref(aug_ref_opts: AugRefOpts) -> anyhow::Result<()> { } // add flanking end to both side of each intron - intron_gr.extend( - flank_length, - &options::ExtendOption::Both, - false, - )?; - + intron_gr.extend(flank_length, &options::ExtendOption::Both, false)?; + // if no_flanking_merge is false, we merge after extend if !no_flanking_merge { // Then, we merge the overlapping introns @@ -471,7 +467,7 @@ pub fn make_ref(aug_ref_opts: AugRefOpts) -> anyhow::Result<()> { // we get the range (transcript body) of each transcript let mut tx_gr = exon_gr.transcripts(None, true)?; - // Then we append a -T to mark the sequence as transcript body + // Then we append a -T to mark the sequence as transcript body tx_gr.df = tx_gr .df .lazy() @@ -566,15 +562,11 @@ pub fn make_ref(aug_ref_opts: AugRefOpts) -> anyhow::Result<()> { "gene_id" => &names, )?; - if aug_type.is_some() { + if aug_type.is_some() { // if we are here, we need to add a column for splice_status cuz it is an augmented reference - extra_t2g.with_column(Series::new( - "splice_status", - vec!["S"; extra_t2g.height()], - ))?; - + extra_t2g.with_column(Series::new("splice_status", vec!["S"; extra_t2g.height()]))?; } - + t2g_map.extend(&extra_t2g)?; // extend gene_id_to_name for the custom spliced targets @@ -619,14 +611,11 @@ pub fn make_ref(aug_ref_opts: AugRefOpts) -> anyhow::Result<()> { "gene_id" => &names, )?; - if aug_type.is_some() { + if aug_type.is_some() { // if we are here, we need to add a column for splice_status cuz it is an augmented reference - extra_t2g.with_column(Series::new( - "splice_status", - vec!["U"; extra_t2g.height()], - ))?; + extra_t2g.with_column(Series::new("splice_status", vec!["U"; extra_t2g.height()]))?; } - + t2g_map.extend(&extra_t2g)?; // extend gene_id_to_name for the custom spliced targets From ea498209c8829bd7ff1fb122054d0a6f9451a968 Mon Sep 17 00:00:00 2001 From: Rob Patro Date: Tue, 13 Jun 2023 13:25:02 -0400 Subject: [PATCH 3/3] fix namespace --- src/lib/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/lib.rs b/src/lib/lib.rs index 05cba9b..ea7e8fb 100644 --- a/src/lib/lib.rs +++ b/src/lib/lib.rs @@ -1,6 +1,6 @@ use anyhow::Context; use clap::builder::{PossibleValuesParser, TypedValueParser}; -use grangers::grangers::{options, Grangers}; +use grangers::{options, Grangers}; use polars::lazy::dsl::concat_str; use polars::prelude::*; use serde::Serialize;