-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from cauliyang/dev
feat: Update dependencies versions and add new module
- Loading branch information
Showing
40 changed files
with
1,562 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[package] | ||
name = "deepbiop-fa" | ||
version = { workspace = true } | ||
authors = { workspace = true } | ||
edition = { workspace = true } | ||
homepage = { workspace = true } | ||
repository = { workspace = true } | ||
keywords = ["parquet", "fasta", "deep-learning"] | ||
license = { workspace = true } | ||
readme = "../../README.md" | ||
description = "Deep Learning Preprocessing Library for Fastq Format" | ||
|
||
[dependencies] | ||
thiserror = { workspace = true } | ||
anyhow = { workspace = true } | ||
noodles = { workspace = true } | ||
rayon = { workspace = true } | ||
log = { workspace = true } | ||
needletail = { workspace = true } | ||
ahash = { workspace = true } | ||
numpy = { workspace = true } | ||
ndarray = { workspace = true } | ||
serde = { workspace = true } | ||
serde_json = { workspace = true } | ||
derive_builder = { workspace = true } | ||
itertools = { workspace = true } | ||
lexical = { workspace = true } | ||
flate2 = { workspace = true } | ||
bstr = { workspace = true } | ||
walkdir = { workspace = true } | ||
|
||
parquet = { workspace = true } | ||
arrow = { workspace = true } | ||
candle-core = { workspace = true } | ||
|
||
pyo3 = { workspace = true } | ||
pyo3-stub-gen = { workspace = true } | ||
|
||
deepbiop-utils = { path = "../deepbiop-utils", version = "0.1" } | ||
|
||
[dev-dependencies] | ||
bio = { workspace = true } | ||
tempfile = { workspace = true } | ||
|
||
|
||
[features] | ||
python = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use ahash::HashMap; | ||
use ndarray::{Array2, Array3}; | ||
|
||
pub type Element = i32; | ||
pub type Matrix = Array2<Element>; | ||
pub type Tensor = Array3<Element>; | ||
pub type Kmer2IdTable = HashMap<Vec<u8>, Element>; | ||
pub type Id2KmerTable = HashMap<Element, Vec<u8>>; | ||
|
||
mod option; | ||
mod parquet; | ||
mod record; | ||
mod traits; | ||
|
||
pub use option::*; | ||
pub use parquet::*; | ||
pub use record::*; | ||
pub use traits::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
use derive_builder::Builder; | ||
use serde::{Deserialize, Serialize}; | ||
use std::fmt::{self, Display, Formatter}; | ||
|
||
use pyo3::prelude::*; | ||
use pyo3_stub_gen::derive::*; | ||
|
||
pub const BASES: &[u8] = b"ATCGN"; | ||
pub const QUAL_OFFSET: u8 = 33; | ||
|
||
#[gen_stub_pyclass] | ||
#[pyclass(module = "deepbiop.fa")] | ||
#[derive(Debug, Builder, Default, Clone, Serialize, Deserialize)] | ||
pub struct FaEncoderOption { | ||
#[pyo3(get, set)] | ||
#[builder(default = "QUAL_OFFSET")] | ||
pub qual_offset: u8, | ||
|
||
#[pyo3(get, set)] | ||
#[builder(default = "BASES.to_vec()")] | ||
pub bases: Vec<u8>, | ||
|
||
#[pyo3(get, set)] | ||
#[builder(default = "2")] | ||
pub threads: usize, | ||
} | ||
|
||
#[gen_stub_pymethods] | ||
#[pymethods] | ||
impl FaEncoderOption { | ||
#[new] | ||
fn py_new(qual_offset: u8, bases: String, threads: Option<usize>) -> Self { | ||
FaEncoderOptionBuilder::default() | ||
.qual_offset(qual_offset) | ||
.bases(bases.as_bytes().to_vec()) | ||
.threads(threads.unwrap_or(2)) | ||
.build() | ||
.expect("Failed to build FqEncoderOption from Python arguments.") | ||
} | ||
} | ||
|
||
impl Display for FaEncoderOption { | ||
fn fmt(&self, f: &mut Formatter) -> fmt::Result { | ||
write!( | ||
f, | ||
"FaEncoderOption {{ qual_offset: {}, bases: {:?}}}", | ||
self.qual_offset, self.bases | ||
) | ||
} | ||
} |
Oops, something went wrong.