seq_here/
lib.rs

1//!
2//! [![Version](https://img.shields.io/badge/version-0.1.0-yellow.svg)]()
3//! [![GitHub](https://img.shields.io/badge/github-bio--here%2Fseq--here-blue.svg)](https://github.com/bio-here/seq-here)
4//! [![Build Status](https://travis-ci.org/bio-here/seq-here.svg?branch=master)](https://travis-ci.org/bio-here/seq-here)
5//! [![Crates.io](https://img.shields.io/crates/v/seq-here.svg)](https://crates.io/crates/seq-here)
6//! [![Documentation](https://docs.rs/seq-here/badge.svg)](https://docs.rs/seq-here)
7//! [![License](https://img.shields.io/crates/l/MIT.svg)]()!
8//!
9//! This crate provides several functions for bio-sequence file processing. It is designed to be fast and easy to use.
10//!
11//! Use the crate in your project by adding the following to your `Cargo.toml`:
12//! ```toml
13//! seq-here = "0.1.0"
14//! ```
15//!
16//! There are 3 modules in this crate for different purposes:
17//! - **info**: Get basic information about the input sequence file(s).
18//! - **process**: Process incoming sequence file(s).
19//! - **extract**: Extract specified sequence segment or file data.
20//!
21//! ## Examples
22//!
23//! - Info module:
24//!
25//! ```rust
26//! use seq_here::info::{self, InfoOutput};
27//! use std::path::{Path, PathBuf};
28//!
29//! let paths = vec![PathBuf::from("tests/test.fa")];
30//! info::InfoFa::by_println(paths.clone());
31//! info::InfoFa::by_file(paths);
32//! ```
33//!
34//! - Process module:
35//!
36//! ```rust
37//! use seq_here::process::{self};
38//! use std::path::PathBuf;
39//!
40//! // Combine multiple files into one
41//! let input_files = vec![PathBuf::from("file1.txt"), PathBuf::from("file2.txt")];
42//! let output_file = PathBuf::from("combined.txt");
43//! seq_here::process::ConvertCombine::combine_all(input_files, output_file);
44//! ```
45//!
46//! - Extract module:
47//!
48//! ```rust
49//! use seq_here::extract::{ExtractSegment, ExtractExplain};
50//! use std::path::PathBuf;
51//!
52//! // Extract sequence by ID
53//! let input_files = vec![PathBuf::from("sequence.fasta")];
54//! let output_file = PathBuf::from("extracted.fasta");
55//! let id = "sequence_id".to_string();
56//! 
57//! // Extract full sequence matching the ID
58//! ExtractSegment::extract_id(input_files.clone(), id.clone(), output_file.clone(), None, None);
59//! 
60//! // Extract a specific segment (positions 10 to 50) from the sequence
61//! ExtractSegment::extract_id(input_files, id, output_file, Some(10), Some(50));
62//! 
63//! // Extract features from annotation files
64//! let seq_files = vec![PathBuf::from("genome.fasta")];
65//! let anno_files = vec![PathBuf::from("annotations.gff")];
66//! let output_dir = PathBuf::from("extracted_features");
67//! 
68//! // Extract all annotated features
69//! ExtractExplain::extract(seq_files.clone(), anno_files.clone(), output_dir.clone(), None);
70//! 
71//! // Extract only CDS and gene features
72//! let feature_types = Some(vec!["CDS".to_string(), "gene".to_string()]);
73//! ExtractExplain::extract(seq_files, anno_files, output_dir, feature_types);
74//! ```
75//!
76
77pub mod process;
78pub mod extract;
79pub mod info;
80
81pub mod error;
82pub mod utils;