f.create.snp.names: Intern function for creating column names for genotype data

View source: R/f.create.snp.names.R

f.create.snp.namesR Documentation

Intern function for creating column names for genotype data

Description

Creating column names either from a .map file or generating dummy names

Usage

f.create.snp.names(map.file, ncol, format, design)

Arguments

map.file

Filename (with path if the file is not in current directory) of the .map file holding the SNP names, if available (see Details).

ncol

Number of columns IN TOTAL in the dataset containing only the genotype data

format

Format of data (will influence how data is processed) - choose from:

  • haplin - data already in one row per family,

  • ped - data from .ped file, each row represents an individual.

.

design

The design used in the study - choose from:

  • triad - (default), data includes genotypes of mother, father and child;

  • cc - classical case-control;

  • cc.triad - hybrid design: triads with cases and controls

.

Details

If the .map file is given, the SNP names are read in, if not dummy names are created by attaching numbers to "m" prefix. Then, a "_a" and "_b" suffix is attached to each allele, respectively. Finally, if the design is "triad" or "cc.triad", the following suffixes are attached: "_m" for the mother's alleles, "_f" for the father's, and "_c" for the child's.

Value

A list containing:

  • gen.data.colnames - a vector with names of columns, length equal to the number of columns in the genotype dataset (i.e., depending on the format and design).

  • marker.names - a vector containing the names of markers, as read in from 'map.file', or dummy names.

Details

The .map file should contain at least two columns, where the second one contains SNP names. Any additional columns should be separated by a whitespace character, but will be ignored. The file should contain a header.


Haplin documentation built on May 20, 2022, 5:07 p.m.