Skip to content

Commit

Permalink
Merge branch 'master' into newick
Browse files Browse the repository at this point in the history
  • Loading branch information
delehef committed Jan 6, 2021
2 parents 7179417 + 168ca94 commit 75d302e
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bio-types"
version = "0.8.0-alpha.0"
version = "0.9.1-alpha.0"
authors = ["Johannes Köster <johannes.koester@tu-dortmund.de>"]
description = "A collection of common biomedical types for use in rust-bio and rust-htslib."
homepage = "https://rust-bio.github.io"
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ pub mod genome;
#[cfg(feature = "phylogeny")]
pub mod phylogeny;
pub mod sequence;
pub mod sequencing;
pub mod strand;
pub mod variant;
39 changes: 38 additions & 1 deletion src/sequence.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Copyright 2021 Johannes Köster.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.

#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use strum_macros::{AsRefStr, Display};

/// A DNA base
pub type Base = u8;
/// An amino acid
Expand All @@ -10,5 +19,33 @@ pub trait SequenceRead {
fn base(&self, i: usize) -> u8;
fn base_qual(&self, i: usize) -> u8;
fn len(&self) -> usize;
fn is_empty() -> bool;
fn is_empty(&self) -> bool;
}

/// Representation of sequence read pair orientation
/// (e.g. F1R2 means that the forward read comes first on the reference contig,
/// followed by the reverse read, on the same contig).
///
/// This enum can be pretty-printed into a readable string repesentation:
///
/// ```rust
/// use bio_types::sequence::SequenceReadPairOrientation;
///
/// // format into string
/// println!("{}", SequenceReadPairOrientation::F1R2);
/// // obtain string via `AsRef<&'static str>`
/// assert_eq!(SequenceReadPairOrientation::R1F2.as_ref(), "R1F2");
/// ```
#[derive(Debug, Clone, Copy, PartialEq, Eq, AsRefStr, Display)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum SequenceReadPairOrientation {
F1R2,
F2R1,
R1F2,
R2F1,
F1F2,
R1R2,
F2F1,
R2R1,
None,
}
8 changes: 0 additions & 8 deletions src/sequencing/mod.rs

This file was deleted.

39 changes: 0 additions & 39 deletions src/sequencing/read_pair_orientation.rs

This file was deleted.

0 comments on commit 75d302e

Please sign in to comment.