nprcgenekeepr1.0.8 package

Genetic Tools for Colony Management

addAnimalsWithNoRelative

Adds an NA value for all animals without a relative

addBackSecondParents

Add back single parents trimmed pedigree

addGenotype

Add genotype data to pedigree file

addIdRecords

addIdRecords Adds Ego records added having NAs for parent IDs

addParents

Add parents

addSexAndAgeToGroup

Forms a dataframe with Id, Sex, and current Age given a list of Ids an...

addUIds

Eliminates partial parentage situations by adding unique placeholder I...

alleleFreq

Calculates the count of each allele in the provided vector.

assignAlleles

Assign parent alleles randomly

calcA

Calculates a, the number of an individual's alleles that are rare in...

calcAge

Calculate animal ages.

calcFE

Calculates founder Equivalents

calcFEFG

Calculates Founder Equivalents and Founder Genome Equivalents

calcFG

Calculates Founder Genome Equivalents

calcGU

Calculates genome uniqueness for each ID that is part of the populatio...

calcRetention

Calculates Allelic Retention

calculateSexRatio

Calculates the sex ratio (number of non-males / number of males) given...

checkChangedColsLst

checkChangedColsLst examines list for non-empty fields

checkErrorLst

checkErrorLst examines list for non-empty fields

checkGenotypeFile

Check genotype file

checkParentAge

Check parent ages to be at least minParentAge

checkRequiredCols

Examines column names, cols for required column names

chooseAlleles

Combines two vectors of alleles by randomly selecting one allele or th...

chooseDate

Choose date based on earlier flag.

convertAncestry

Converts the ancestry information to a standardized code

convertDate

Converts date columns formatted as characters to be of type datetime

convertFromCenter

Converts the fromCenter information to a standardized code

convertRelationships

Converts pairwise kinship values to a relationship category descriptor...

convertSexCodes

Converts sex indicator for an individual to a standardized codes.

convertStatusCodes

Converts status indicators to a Standardized code

correctParentSex

Sets sex for animals listed as either a sire or dam.

countFirstOrder

Count first-order relatives.

countKinshipValues

Counts the number of occurrences of each kinship value seen for a pair...

countLoops

Count the number of loops in a pedigree tree.

create_wkbk

Creates an Excel workbook with worksheets.

createExampleFiles

Creates a folder with CSV files containing example pedigrees and ID li...

createPedTree

Create a pedigree tree (PedTree).

createSimKinships

Makes a list object of kinship matrices from simulated pedigrees of po...

cumulateSimKinships

Makes a list object containing kinship summary statistics using the li...

dataframe2string

dataframe2string converts a data.frame object to a character vector

fillGroupMembersWithSexRatio

Forms breeding group(s) with an effort to match a specified sex ratio

filterKinMatrix

Filters a kinship matrix to include only the egos listed in 'ids'

filterPairs

Filters kinship values from a long-format kinship table based on the s...

filterReport

Filters a genetic value report down to only the specified animals

filterThreshold

Filters kinship to remove rows with kinship values less than the speci...

findGeneration

Determines the generation number for each id.

findLoops

Find loops in a pedigree tree

findOffspring

Finds the number of total offspring for each animal in the provided pe...

findPedigreeNumber

Determines the generation number for each id.

fixColumnNames

fixColumnNames changes original column names and into standardized nam...

geneDrop

Gene drop simulation based on the provided pedigree information

get_and_or_list

Returns a one element character string with correct punctuation for a ...

get_elapsed_time_str

Returns the elapsed time since start_time.

getAncestors

Recursively create a character vector of ancestors for an individual I...

getAnimalsWithHighKinship

Forms a list of animal Ids and animals related to them

getChangedColsTab

getChangedColsTab skeleton of list of errors

getConfigFileName

getConfigFileName returns the configuration file name appropriate for ...

getCurrentAge

Age in years using the provided birthdate.

getDatedFilename

Returns a character vector with an file name having the date prepended...

getDateErrorsAndConvertDatesInPed

Converts columns of dates in text form to Date object columns

getDemographics

Get demographic data

getEmptyErrorLst

Creates a empty errorLst object

getErrorTab

getErrorTab skeleton of list of errors

getFocalAnimalPed

Get pedigree based on list of focal animals

getGenotypes

Get genotypes from file

getGVGenotype

Get Genetic Value Genotype data structure for reportGV function.

getGVPopulation

Get the population of interest for the Genetic Value analysis.

getIdsWithOneParent

getIdsWithOneParent extracts IDs of animals pedigree without either a ...

getIncludeColumns

Get the superset of columns that can be in a pedigree file.

getLkDirectAncestors

Get the direct ancestors of selected animals

getLkDirectRelatives

Get the direct ancestors of selected animals

getLogo

Get Logo file name

getOffspring

Get offspring to corresponding animal IDs provided

getParents

Get parents to corresponding animal IDs provided

getPedDirectRelatives

Get the direct ancestors of selected animals from supplied pedigree.

getPedigree

Get pedigree from file

getPedMaxAge

Get the maximum age of live animals in the pedigree.

getPossibleCols

Get possible column names for a studbook.

getPotentialParents

Get the lists of portential parents for all individuals born in the co...

getPotentialSires

Provides list of potential sires

getProbandPedigree

Gets pedigree to ancestors of provided group leaving uninformative anc...

getPyramidAgeDist

Get the age distribution for the pedigree

getPyramidPlot

Creates a pyramid plot of the pedigree provided.

getRequiredCols

Get required column names for a studbook.

getSiteInfo

Get site information

getTokenList

Gets tokens from character vector of lines

getVersion

getVersion Get the version number of nprcgenekeepr

groupAddAssign

Add animals to an existing breeding group or forms groups:

hasBothParents

hasBothParents checks to see if both parents are identified.

hasGenotype

Check for genotype data in dataframe

headerDisplayNames

Convert internal column names to display or header names.

is_valid_date_str

Returns TRUE if the string is a valid date.

kinMatrix2LongForm

Reformats a kinship matrix into a long-format table.

kinship

Generates a kinship matrix.

kinshipMatricesToKValues

Forms kValue matrix from list of kinship matrices

kinshipMatrixToKValues

Extracts a dataframe with a row for each kinship coeficient in the kin...

makeCEPH

Make a CEPH-style pedigree for each id

makeExamplePedigreeFile

Write copy of nprcgenekeepr::examplePedigree into a file

makeGroupMembers

Convenience function to make the initial groupMembers animal list

makeGrpNum

Convenience function to make the initial grpNum list

makeRelationClassesTable

Make relation classes table from kin dataframe.

makeSimPed

Makes a simulated pedigree using representative sires and dams

mapIdsToObfuscated

Map IDs to Obfuscated IDs

meanKinship

Calculates the mean kinship for each animal in a kinship matrix

nprcgenekeepr-package

Genetic Management Functions

nprcgenekeepr

Genetic Tools for Colony Management

obfuscateDate

obfucateDate adds a random number of days bounded by plus and minus ma...

obfuscateId

obfucateId creates a vector of ID aliases of specified length

obfuscatePed

obfuscatePed takes a pedigree object and creates aliases for all IDs a...

offspringCounts

Finds the total number of offspring for each animal in the pedigree

print

print.summary.nprcgenekeepr print.summary.nprcgenekeeprGV

qcStudbook

Quality Control for the Studbook or pedigree

rankSubjects

Ranks animals based on genetic value.

removeAutoGenIds

Remove automatically generated IDs from pedigree

removeDuplicates

Remove duplicate records from pedigree

removeEarlyDates

removeEarlyDates removes dates before a specified year

removePotentialSires

Removes potential sires from list of Ids

removeUninformativeFounders

Remove uninformative founders.

removeUnknownAnimals

removeUnknownAnimals Removes unknown animals added to pedigree that se...

reportGV

Generates a genetic value report for a provided pedigree.

runGeneKeepR

Allows running shiny application with `nprcgenekeepr::runGeneKeepR()...

saveDataframesAsFiles

Write copy of dataframes to either CSV, TXT, or Excel file.

set_seed

Work around for unit tests using sample() among various versions of R

setExit

Sets the exit date, if there is no exit column in the table

setPopulation

Population designation function

summarizeKinshipValues

Summary statistics for imputed kinship values

summary

summary.nprcgenekeeprErr Summary function for class nprcgenekeeprErr

toCharacter

Force dataframe columns to character

trimPedigree

Trim pedigree to ancestors of provided group by removing uninformative...

withinIntegerRange

Get integer within a range

Provides genetic tools for colony management and is a derivation of the work in Amanda Vinson and Michael J Raboin (2015) <https://pmc.ncbi.nlm.nih.gov/articles/PMC4671785/> "A Practical Approach for Designing Breeding Groups to Maximize Genetic Diversity in a Large Colony of Captive Rhesus Macaques ('Macaca' 'mulatto')". It provides a 'Shiny' application with an exposed API. The application supports five groups of functions: (1) Quality control of studbooks contained in text files or 'Excel' workbooks and of pedigrees within 'LabKey' Electronic Health Records (EHR); (2) Creation of pedigrees from a list of animals using the 'LabKey' EHR integration; (3) Creation and display of an age by sex pyramid plot of the living animals within the designated pedigree; (4) Generation of genetic value analysis reports; and (5) Creation of potential breeding groups with and without proscribed sex ratios and defined maximum kinships.

  • Maintainer: R. Mark Sharp
  • License: MIT + file LICENSE
  • Last published: 2025-07-26