README.md

graphparse

Installation

# install.packages("devtools")
devtools::install_github("mailund/graphparse")

Example

Parsing a qpGraph file:

test_graph <- readr::read_file("data-raw/Basic_OngeEA_wArch.graph")
g <- graphparse::read_qpgraph(test_graph)
plot(g)
#> fminbnd:  Exiting: Maximum number of function evaluations has been exceeded
#>          - increase MaxFunEvals option.
#>          Current function value: 4498.90111965144

attr(g, "admixture_proportions")
#>                     K2_K                     P2_P     AdmixedNonAfr_AfrAnc 
#>                      0.5                      0.5                      0.5 
#> DenisovaAncAnc_SuperArch 
#>                      0.5

Parsing a dot file:

test_graph <- readr::read_file("data-raw/Basic_OngeEA_wArch.dot")
g <- graphparse::read_dot(test_graph)
plot(g)
#> fminbnd:  Exiting: Maximum number of function evaluations has been exceeded
#>          - increase MaxFunEvals option.
#>          Current function value: 9425.28944643173

attr(g, "admixture_proportions")
#>  Arch_DenisovaAncAnc NeaAnc_AdmixedNonAfr            NeaAnc_K2 
#>                 0.49                 0.03                 0.01 
#>       DenisovaAnc_P2 
#>                 0.03
test_graph <- readr::read_file("data-raw/test1.graph")
g <- graphparse::read_qpgraph(test_graph)
plot(g)

attr(g, "admixture_proportions")
#> numeric(0)
test_graph <- readr::read_file("data-raw/BosGraph.dot")
g <- graphparse::read_dot(test_graph)
plot(g)
#> fminbnd:  Exiting: Maximum number of function evaluations has been exceeded
#>          - increase MaxFunEvals option.
#>          Current function value: 7212.04015629442



mailund/graphparse documentation built on May 29, 2019, 11:05 p.m.