readProfiles: Read a set of profiles from a file

View source: R/readProfiles.R

readProfilesR Documentation

Read a set of profiles from a file

Description

Reads a set of profiles from a file

Usage

readProfiles(
  fileName,
  freqs = NULL,
  sep = "\t",
  header = FALSE,
  id = 1,
  discardMissing = TRUE
)

Arguments

fileName

a path to the profile file.

freqs

A list containing two lists labelled loci and freqs. The second list is a list of vectors containing the allele frequencies of each allele at each locus in the multiplex. If this is left NULL, then it is calculated from the profile file.

sep

a character that delimits the fields in the profile file.

header

a boolean which is TRUE if the profile file has a column header line.

id

a column number indicating which column the profile id's are stored. If id == -1, then this means there is no id information.

discardMissing

if TRUE, then all profiles which have alleles which cannot be matched to the frequency file are ommitted and returned in the return list.

Details

The alleles are recorded integers rather than the STR repeat numbers. This speeds up computation immensely when calculating any of the LRs or IBS.

Value

a list containing a data.frame of profiles where the alleles have been recoded to the allele index number, rather than the allele itself, and a set of frequencies in the same format as you would get from readFreqs. If freqs have been supplied, then this will just be the same set of frequencies, if they have not, then this will be calculated from the profiles. Given that the profiles generally do not have any locus name information the loci will just be labelled Locus1, Locus2, .... If there are missing values then the raw missing profiles are returned

Author(s)

James M. Curran


jmcurran/relSim documentation built on Jan. 13, 2024, 2:13 a.m.