read_happy.Rd
Read a directory of hap.py output files into an R data structure.
read_happy(happy_prefix, lazy = TRUE, quietly = FALSE)
happy_prefix | hap.py output prefix (and path) |
---|---|
lazy | store lesser-used output as unevaluated promises rather than reading everything at once |
quietly | inhibit logging messages as files are loaded |
A list structure containing hap.py output
# NOT RUN { # run hap.py from commandline: # hap.py truth.vcf query.vcf -o /output/path/prefix # load result into R happy <- read_happy('/output/path/prefix') # }# load demo data supplied with package happy_input <- system.file("extdata", "happy_demo.summary.csv", package = "happyR") happy_prefix <- sub(".summary.csv", "", happy_input) hapdata <- read_happy(happy_prefix)#>#>#>print(hapdata)#> Hap.py result containing: summary, extended, pr_curve #> Loaded from: /Users/mgonzalez/workspace/happyR_v2.0/inst/extdata/happy_demo (hap.py version: v0.3.9) #> #> # A tibble: 4 x 17 #> Type Filter TRUTH.TOTAL TRUTH.TP TRUTH.FN QUERY.TOTAL QUERY.FP QUERY.UNK #> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 INDEL ALL 8937 7839 1098 11812 343 3520 #> 2 INDEL PASS 8937 7550 1387 9971 283 1964 #> 3 SNP ALL 52494 52125 369 90092 582 37348 #> 4 SNP PASS 52494 46920 5574 48078 143 992 #> # … with 9 more variables: FP.gt <dbl>, METRIC.Recall <dbl>, #> # METRIC.Precision <dbl>, METRIC.Frac_NA <dbl>, METRIC.F1_Score <dbl>, #> # TRUTH.TOTAL.TiTv_ratio <dbl>, QUERY.TOTAL.TiTv_ratio <dbl>, #> # TRUTH.TOTAL.het_hom_ratio <dbl>, QUERY.TOTAL.het_hom_ratio <dbl>