read_var_file: Read in a variant file.

Description Usage Arguments Value Warning See Also Examples

Description

read_var_file reads in a variant file output by the MPS pipeline i.e. merged_collab.txt. Note that it can be a subset of the original (raw) file; the main thing is that its column headers should not be processed beforehand. It is basically a wrapper around read.delim, but the na.strings is an 'empirical' parameter that specifies strings used throughout the file to denote NAs.

Usage

1

Arguments

fname

The full file path to the variant file.

...

Additional arguments to be passed to read.delim.

Value

The variant file as a data frame with dplyr's tbl_df class.

Warning

This function takes more than 10mins to read in a data frame with > 7 million rows and 150 variables. data.table's fread function is considerably faster, but I've found that it automatically converts column classes that were supposed to be numeric to character. I haven't figured out why it's doing this yet.

See Also

read.table, tbl_df for more details.

Examples

1
2
3
4
5
## Not run: 
full_path <- "~/Desktop/Fam1_merged_collab.txt"
DF <- read_var_file(file.path(full_path))

## End(Not run)

bahlolab/varpr documentation built on May 11, 2019, 5:26 p.m.