two_column2kinship: read in a two-column formatted genotype file and turn it into...

Description Usage Arguments Details Value Examples

View source: R/two_column2kinship.R

Description

Nothing very cool about this. Just some formatting. It will read a file in and then create a new file in the same spot as the other one with "_kinship_input" appended to it.

Usage

1
two_column2kinship(TCF, outdir = NULL)

Arguments

TCF

path to the two-column formatted file

outdir

name of output directory to write the kinship file to. If this is left unspecified (or is passed in as NULL), then the output directory is the same as that of the input two-column genotype file.

Details

Note that some of the files I have gotten from Libby have empty columns on the end (probably a microsoft excel thing.) So, I will drop any columns that start with X followed by a number.

Value

Invisibly returns the data frame formatted for Kinship. But, also writes the thing out, so typically you won't use the return value.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# get path to example file in package directory
tcffile <- system.file("extdata", "WSH_W1718_v5_two_column_data.txt", package = "CohoBroodstock")

# print it to see what that looks like:
tcffile

# now make a Kinship input version in the current directory
two_column2kinship(tcffile, outdir = ".")

# Note that when you do this you will get a few error messages:
# 1. missing column names filled in --- This is because the input file has two
# empty columns in it (i.e., it has the tabs but no content).
# 2. The two column names for each locus are the same and they get deduplicated.
# 3. See #1.

eriqande/CohoBroodstock documentation built on June 2, 2020, 3:09 a.m.