This function closes the H5 file and remove mtmutObj object. Because the H5 file is not closed automatically when the mtmutObj object is removed. We need to close the H5 file manually. By using this function, we can remove the mtmutObj object and close the H5 file at the same time.

rm_mtmutObj(x, envir = .GlobalEnv)

Arguments

x

a mtmutObj object.

envir

the environment where the mtmutObj object is stored.

Value

no return value.

Examples

## Use the example 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/file2395d5dcee22b.h5"
## open the h5 file and create a mtmutObj object
x <- open_h5_file(f_h5)
x
#> mtmutObj object
#> -------------------------------------------------
#> h5 file: /tmp/RtmppwH5Ub/file2395d5dcee22b.h5
#> Available loci: 16
#> Selected loci: 16
#> Available cells: 1359
#> Selected cells: 1359
#> Loci passed the filter: 0
#> filter parameters: 
#> 	min_cell: 1
#> 	model: bb
#> 	p_threshold: 0.05
#> 	alt_count_threshold: 0
#> 	p_adj_method: fdr
rm_mtmutObj(x)
#> Variable 'x' removed successfully.