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

feat: move out assemblies to biocommons_bioutils crate (#134) #135

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0"
indexmap = { version = "2", features = ["serde"] }
biocommons-bioutils = "0.1.0"

[dev-dependencies]
anyhow = "1.0"
Expand Down
6 changes: 3 additions & 3 deletions src/data/cdot/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
self, GeneInfoRecord, TxExonsRecord, TxForRegionRecord, TxIdentityInfo, TxInfoRecord,
TxMappingOptionsRecord, TxSimilarityRecord,
},
static_data::{Assembly, ASSEMBLY_INFOS},
};
use biocommons_bioutils::assemblies::{Assembly, ASSEMBLY_INFOS};

use bio::data_structures::interval_tree::ArrayBackedIntervalTree;
use chrono::NaiveDateTime;
Expand Down Expand Up @@ -104,7 +104,7 @@

fn get_assembly_map(
&self,
assembly: crate::static_data::Assembly,
assembly: biocommons_bioutils::assemblies::Assembly,
) -> indexmap::IndexMap<String, String> {
self.inner.get_assembly_map(assembly)
}
Expand Down Expand Up @@ -625,7 +625,7 @@
.clone();
transcript_ids_for_gene
.entry(gene_symbol.clone())
.or_insert(Vec::new());

Check warning on line 628 in src/data/cdot/json.rs

View workflow job for this annotation

GitHub Actions / clippy

use of `or_insert` to construct default value

warning: use of `or_insert` to construct default value --> src/data/cdot/json.rs:628:22 | 628 | .or_insert(Vec::new()); | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default = note: `#[warn(clippy::unwrap_or_default)]` on by default
genes.insert(gene_symbol, gene.clone());
});
c_txs
Expand Down Expand Up @@ -1082,7 +1082,7 @@
};
use crate::mapper::assembly::{self, Mapper};
use crate::parser::HgvsVariant;
use crate::static_data::Assembly;
use biocommons_bioutils::assemblies::Assembly;

#[test]
fn test_sync() {
Expand Down
2 changes: 1 addition & 1 deletion src/data/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use chrono::NaiveDateTime;
use indexmap::IndexMap;

use crate::data::error::Error;
use crate::static_data::Assembly;
use biocommons_bioutils::assemblies::Assembly;

/// Information about a gene.
///
Expand Down
5 changes: 3 additions & 2 deletions src/data/uta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::fmt::Debug;
use std::sync::Mutex;

use crate::sequences::seq_md5;
use crate::static_data::{Assembly, ASSEMBLY_INFOS};
use biocommons_bioutils::assemblies::{Assembly, ASSEMBLY_INFOS};

use crate::data::{
error::Error, interface, interface::GeneInfoRecord, interface::TxExonsRecord,
Expand Down Expand Up @@ -604,8 +604,9 @@ impl interface::Provider for Provider {

#[cfg(test)]
mod test {
use crate::{data::interface::Provider as InterfaceProvider, static_data::Assembly};
use crate::data::interface::Provider as InterfaceProvider;
use anyhow::Error;
use biocommons_bioutils::assemblies::Assembly;

use super::{Config, Provider};

Expand Down
2 changes: 1 addition & 1 deletion src/data/uta_sr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl interface::Provider for Provider {

fn get_assembly_map(
&self,
assembly: crate::static_data::Assembly,
assembly: biocommons_bioutils::assemblies::Assembly,
) -> indexmap::IndexMap<String, String> {
self.inner.get_assembly_map(assembly)
}
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ pub mod mapper;
pub mod normalizer;
pub mod parser;
pub mod sequences;
pub mod static_data;
pub mod validator;
6 changes: 4 additions & 2 deletions src/mapper/assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use std::sync::Arc;
use crate::mapper::error::Error;
use crate::mapper::variant;
use crate::parser::HgvsVariant;
use crate::{data::interface::Provider, static_data::Assembly, validator::ValidationLevel};
use crate::{data::interface::Provider, validator::ValidationLevel};
use biocommons_bioutils::assemblies::Assembly;

#[derive(Debug, PartialEq, Eq, Default, Clone, Copy)]
pub enum InParAssume {
Expand Down Expand Up @@ -373,8 +374,9 @@ impl Mapper {

#[cfg(test)]
mod test {
use crate::{data::uta_sr::test_helpers::build_provider, static_data::Assembly};
use crate::data::uta_sr::test_helpers::build_provider;
use anyhow::Error;
use biocommons_bioutils::assemblies::Assembly;

use super::{Config, Mapper};

Expand Down
2 changes: 1 addition & 1 deletion src/mapper/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ mod test {

fn get_assembly_map(
&self,
_assembly: crate::static_data::Assembly,
_assembly: biocommons_bioutils::assemblies::Assembly,
) -> indexmap::IndexMap<String, String> {
panic!("for test use only");
}
Expand Down
Binary file removed src/static_data/_data/CHM1_1.0.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/CHM1_1.1.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh37.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh37.p10.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh37.p11.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh37.p12.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh37.p13.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh37.p2.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh37.p5.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh37.p9.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p1.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p10.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p11.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p12.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p2.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p3.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p4.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p5.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p6.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p7.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p8.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/GRCh38.p9.json.gz
Binary file not shown.
36 changes: 0 additions & 36 deletions src/static_data/_data/Makefile

This file was deleted.

Binary file removed src/static_data/_data/NCBI33.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/NCBI34.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/NCBI35.json.gz
Binary file not shown.
Binary file removed src/static_data/_data/NCBI36.json.gz
Binary file not shown.
98 changes: 0 additions & 98 deletions src/static_data/mod.rs

This file was deleted.

Loading