Gfa

Struct Gfa 

Source
pub struct Gfa<T: OptFields> {
    pub header: Header,
    pub segments: Vec<Segment<T>>,
    pub paths: Vec<Path>,
    pub links: Option<Vec<Link<T>>>,
    pub containments: Vec<Containment<T>>,
    pub walk: Vec<Walk>,
    pub jumps: Vec<Jump<T>>,
    pub edges: Vec<Edges<T>>,
    pub fragments: Vec<Fragment<T>>,
    pub groups: Vec<Group>,
    pub gaps: Vec<Gap<T>>,
    pub string2index: HashMap<String, usize>,
}
Expand description

A representation of a GFA file (v1 + v2)

GFA v1 + 1.1/1.2 + v2

Comment: This implementation should be able to parse any kind of GFA file, but has increased memory consumption, since most node ids are stored at Strings which are a minimum of 24 bytes. This is only maintained, since it is not of further use in any of my projects.

Fields§

§header: Header§segments: Vec<Segment<T>>§paths: Vec<Path>§links: Option<Vec<Link<T>>>§containments: Vec<Containment<T>>§walk: Vec<Walk>§jumps: Vec<Jump<T>>§edges: Vec<Edges<T>>§fragments: Vec<Fragment<T>>§groups: Vec<Group>§gaps: Vec<Gap<T>>§string2index: HashMap<String, usize>

Implementations§

Source§

impl<T: OptFields> Gfa<T>

Source

pub fn new() -> Self

Graph constructor

§Example
use gfa_reader::Gfa;
let graph: Gfa<()> = Gfa::new();
Source

pub fn check_nc(&mut self) -> Option<Vec<usize>>

Check if the nodes in the graph are

  • Nodes are present
  • Numeric
  • Compact
  • Start at 1

Returns: - Option<Vec>: Nodes ids in usize (from String) - Option: The minimum node id

Source

pub fn parse_gfa_file(&mut self, file_name: &str, edges: bool)

Read the graph from a file

§Example
use gfa_reader::Gfa;
let mut graph = Gfa::new();
graph.parse_gfa_file("/path/to/graph");
´´´
Source

pub fn to_file(self, file_name: &str)

Write the graph to a file

Source

pub fn convert_to_ncgraph(&self, graph: &Gfa<T>) -> NCGfa<T>

Trait Implementations§

Source§

impl<T: Debug + OptFields> Debug for Gfa<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Gfa<T>

§

impl<T> RefUnwindSafe for Gfa<T>
where T: RefUnwindSafe,

§

impl<T> Send for Gfa<T>
where T: Send,

§

impl<T> Sync for Gfa<T>
where T: Sync,

§

impl<T> Unpin for Gfa<T>
where T: Unpin,

§

impl<T> UnwindSafe for Gfa<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.