mibig_taxa/
lib.rs

1// Copyright 2021 Danmarks Tekniske Universitet
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! NCBI taxdump handling for MIBiG
16//!
17//! ## Usage
18//!
19//! To build a taxon cache, use [`TaxonCache`]:
20//!
21//! ```no_run
22//! # use mibig_taxa::MibigTaxonError;
23//! #
24//! # fn main() -> Result<(), MibigTaxonError> {
25//! use std::path::PathBuf;
26//! use mibig_taxa::TaxonCache;
27//!
28//! let cachefile = PathBuf::from("path/to/cache");
29//! let taxdump = PathBuf::from("path/to/rankedlineage.dmp");
30//! let mergeddump = PathBuf::from("path/to/merged.dmp");
31//! let datadir = PathBuf::from("path/to/mibig/jsons/");
32//!
33//! let mut taxon_cache = TaxonCache::new();
34//! taxon_cache.initialise_from_paths(taxdump, mergeddump, datadir)?;
35//! taxon_cache.save_path(&cachefile)?;
36//! #
37//! #     Ok(())
38//! # }
39//! ```
40
41pub mod errors;
42pub mod mibig;
43pub mod taxa;
44
45pub use crate::errors::MibigTaxonError;
46pub use crate::mibig::TaxonCache;
47pub use crate::taxa::NcbiTaxEntry;