This function loads the mtGATK output and save it to a H5 file.

parse_mgatk(dir, prefix, h5_file = "mut.h5")

Arguments

dir

a string of the mtGATK output final fold.

prefix

a string of the prefix of the mtGATK output directory.

h5_file

a string of the output h5 file directory.

Value

a string of the output h5 file directory.

Examples

## Use the allele count table data
f <- system.file("extdata", "mini_dataset.tsv.gz", package = "scMitoMut")
## Create a temporary h5 file
## In real case, we keep the h5 in project folder for future use
f_h5_tmp <- tempfile(fileext = ".h5")
## Load the data with parse_table function
f_h5 <- parse_table(f, sep = "\t", h5_file = f_h5_tmp)
f_h5
#> [1] "/tmp/RtmppwH5Ub/file2395d32f7ccbf.h5"
## Use the mgatk output
f <- system.file("extdata", "mini_mgatk_out", package = "scMitoMut")
f_h5_tmp <- tempfile(fileext = ".h5")
f_h5 <- parse_mgatk(paste0(f, "/final/"), prefix = "sample", h5_file = f_h5_tmp)
#> Allele count files are:
#> /home/wsun/Dropbox/scMitoMut/scMitoMut-devel/inst/extdata/mini_mgatk_out/final//sample.A.txt.gz/home/wsun/Dropbox/scMitoMut/scMitoMut-devel/inst/extdata/mini_mgatk_out/final//sample.C.txt.gz/home/wsun/Dropbox/scMitoMut/scMitoMut-devel/inst/extdata/mini_mgatk_out/final//sample.G.txt.gz/home/wsun/Dropbox/scMitoMut/scMitoMut-devel/inst/extdata/mini_mgatk_out/final//sample.T.txt.gz
f_h5
#> [1] "/tmp/RtmppwH5Ub/file2395d3cb3ee93.h5"
x <- open_h5_file(f_h5)
x
#> mtmutObj object
#> -------------------------------------------------
#> h5 file: /tmp/RtmppwH5Ub/file2395d3cb3ee93.h5
#> Available loci: 6
#> Selected loci: 6
#> Available cells: 4873
#> Selected cells: 4873
#> Loci passed the filter: 0
#> filter parameters: 
#> 	min_cell: 1
#> 	model: bb
#> 	p_threshold: 0.05
#> 	alt_count_threshold: 0
#> 	p_adj_method: fdr
##