diff --git a/bio-seq/Cargo.toml b/bio-seq/Cargo.toml index dd28da7..7230250 100644 --- a/bio-seq/Cargo.toml +++ b/bio-seq/Cargo.toml @@ -23,7 +23,7 @@ serde = { version = "1", optional = true, features=["derive"] } serde_derive = { version = "1", optional = true } [features] -serde = ["dep:serde", "dep:serde_derive"] +serde = ["dep:serde", "dep:serde_derive", "bitvec/serde"] translation = [] #[[example]] diff --git a/bio-seq/src/seq/mod.rs b/bio-seq/src/seq/mod.rs index e5ea2a3..82c3c15 100644 --- a/bio-seq/src/seq/mod.rs +++ b/bio-seq/src/seq/mod.rs @@ -40,9 +40,13 @@ use crate::codec::{text, Codec}; use crate::error::ParseBioError; use crate::{Bs, Bv, Order}; + use bitvec::field::BitField; use bitvec::view::BitView; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; + use core::borrow::Borrow; use core::fmt; //use core::hash::Hash; @@ -56,6 +60,7 @@ use core::str::FromStr; /// /// Stored on the heap #[derive(Debug, Eq, PartialEq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[repr(transparent)] pub struct Seq { pub(crate) _p: PhantomData,