# BioGraph Function

## Read GFA

`BioGraph.read_from_gfa`

— Function`read_from_gfa(filename::String; weight_file::String)`

Read graph from GFA file and optional weight_file (contains two column `node`

and `weight`

) and return `GFAResult`

struct which has `g`

- the graph, `w`

- weight array, `l`

- node label array, `e`

- edge label array and `p`

- path array.

## Graph Component

`BioGraph.find_graph_component`

— Function`find_graph_component(gfa_result::BioGraph.GFAResult)`

Return graph components of `GFAResult`

:

- Simple Graphs
- Lone Cycles
- Lone Nodes

`BioGraph.get_summary`

— Method`get_summary(g_coms::BioGraph.GraphComponent)`

Summary of `GraphComponent`

.

`BioGraph.get_summary`

— Method`get_summary(g_coms::BioGraph.GraphResult)`

Summary of `GraphResult`

:

- No of vertices
- No of edges
- No of source nodes
- No of end nodes
- No of path

`BioGraph.get_terminus`

— Method`get_terminus(g_result::BioGraph.GraphResult; outfile::String)`

Get all source and sink nodes of `GraphResult`

. Write to CSV, including data from GFA.

`BioGraph.get_gfa`

— Method`get_gfa(g_result::BioGraph.GraphResult; outfile::String)`

Get GFA output of `GraphResult`

.

## Longest Path

`BioGraph.find_longest_path`

— Function`find_longest_path(graph_result::BioGraph.GraphResult, optimizer_factory; is_weighted::Bool, source_node::Int64, sink_node::Int64, has_path::String)`

Find longest path in graph. Input:

`GraphResult`

- JuMP optimizer_factory such as
`CPLEX.Optimizer`

`has_path`

: optional string that indicates the path must have in longest path.`is_weighted`

: if`true`

find shortest path which is weighted`source_node`

,`sink_node`

: find longest path which has source and sink nodes.

`BioGraph.get_gfa`

— Method`get_gfa(g_result::BioGraph.LongestPath; outfile::String)`

Get GFA output of `LongestPath`

.

`BioGraph.get_fasta`

— Method`get_fasta(g_result::BioGraph.LongestPath; header::String="linear_path", outdir::String="")`

Get FastA and Bed output of `LongestPath`

. Will not generate files if `outdir`

was not specified.