Skip to contents
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 and a pedigree
addUIds()
Eliminates partial parentage situations by adding unique placeholder IDs for the unknown parent.
alleleFreq()
Calculates the count of each allele in the provided vector.
appServer()
Main Application Server for nprcgenekeepr
appUI()
Main Application UI for nprcgenekeepr
assignAlleles()
Assign parent alleles randomly
calcA()
Calculates a, the number of an individual's alleles that are rare in each simulation.
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 population.
calcRetention()
Calculates Allelic Retention
calculateSexRatio()
Calculates the sex ratio (number of non-males / number of males) given animal Ids and their pedigree
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 the other at each position.
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 of individuals in a series of simulated pedigrees.
countLoops()
Count the number of loops in a pedigree tree.
createExampleFiles()
Creates a folder with CSV files containing example pedigrees and ID lists used to demonstrate the package.
createPedTree()
Create a pedigree tree (PedTree).
createSimKinships()
Makes a list object of kinship matrices from simulated pedigrees of possible parents for animals with unknown parents
create_wkbk()
Creates an Excel workbook with worksheets.
cumulateSimKinships()
Makes a list object containing kinship summary statistics using the list object from createSimKinships .
dataframe2string()
dataframe2string converts a data.frame object to a character vector
exampleNprcgenekeeprConfig
exampleNprcgenekeeprConfig is a loadable version of the example configuration file example_nprcgenekeepr_config
examplePedigree
examplePedigree is a pedigree object created by qcStudbook
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 sexes of the two animals involved.
filterReport()
Filters a genetic value report down to only the specified animals
filterThreshold()
Filters kinship to remove rows with kinship values less than the specified threshold
finalRpt
finalRpt is a list object created from the list object rpt prepared by reportGV. It is created inside orderReport. This version is at the state just prior to calling rankSubjects inside orderReport.
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 pedigree.
findPedigreeNumber()
Determines the generation number for each id.
fixColumnNames()
fixColumnNames changes original column names and into standardized names.
focalAnimals
focalAnimals is a dataframe with one column (id ) containing the of animal Ids from the examplePedigree pedigree.
geneDrop()
Gene drop simulation based on the provided pedigree information
getAncestors()
Recursively create a character vector of ancestors for an individual ID.
getAnimalsWithHighKinship()
Forms a list of animal Ids and animals related to them
getAutoIdFormat()
Get the auto-generated unknown-ID format
getBoxWhiskerDescription()
Get Box and Whisker Plot Description
getChangedColsTab()
getChangedColsTab skeleton of list of errors
getConfigFileName()
getConfigFileName returns the configuration file name appropriate for the system.
getCurrentAge()
Age in years using the provided birthdate.
getDateErrorsAndConvertDatesInPed()
Converts columns of dates in text form to Date object columns
getDatedFilename()
Returns a character vector with an file name having the date prepended.
getDemographics()
Get demographic data
getDescendantPedigree()
Gets pedigree with descendants of provided group.
getEmptyErrorLst()
Creates a empty errorLst object
getErrorTab()
getErrorTab skeleton of list of errors
getFocalAnimalPed()
Get pedigree based on list of focal animals
getFounders()
Gets the founder ids from a pedigree
getGVGenotype()
Get Genetic Value Genotype data structure for reportGV function.
getGVPopulation()
Get the population of interest for the Genetic Value analysis.
getGenotypes()
Get genotypes from file
getIdsWithOneParent()
getIdsWithOneParent extracts IDs of animals pedigree without either a sire or a dam
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
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.
getPedMaxAge()
Get the maximum age of live animals in the pedigree.
getPedigree()
Get pedigree from file
getPossibleCols()
Get possible column names for a studbook.
getPotentialParents()
experimental
Get the lists of portential parents for all individuals born in the colony with one or two unknown parents.
getPotentialSires()
Provides list of potential sires
getProbandPedigree()
Gets pedigree to ancestors of provided group leaving uninformative ancestors.
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
get_and_or_list()
Returns a one element character string with correct punctuation for a list made up of the elements of the character vector argument.
get_elapsed_time_str()
Returns the elapsed time since start_time.
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.
isFounder()
Identifies the founders in a pedigree
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 kinship matrix
lacy1989Ped
lacy1989Ped small hypothetical pedigree
lacy1989PedAlleles
lacy1989PedAlleles is a dataframe produced by geneDrop on lacy1989Ped with 5000 iterations.
loadSiteConfig()
Load the site configuration for the modular Shiny application
logModuleEvent()
Log Module Events
makeCEPH()
Make a CEPH-style pedigree for each id
makeExamplePedigreeFile()
Write copy of nprcgenekeepr::examplePedigree into a file
makeFounderStatsTable()
Create Founder Statistics HTML Table
makeGeneticSummaryTable()
Create Genetic Summary Statistics HTML Table
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
modBreedingGroupsServer()
Breeding Groups Module - Server Function
modBreedingGroupsUI()
Breeding Groups Module - UI Function
modGeneticValueServer()
Genetic Value Analysis Module - Server Function
modGeneticValueUI()
Genetic Value Analysis Module - UI Function
modGvAndBgDescServer()
Genetic Value and Breeding Group Description Module - Server Function
modGvAndBgDescUI()
Genetic Value and Breeding Group Description Module - UI Function
modInputServer()
Data Input and Quality Control Module - Server Function
modInputUI()
Data Input and Quality Control Module - UI Function
modORIPReportingServer()
ORIP Reporting Module - Server Function
modORIPReportingUI()
ORIP Reporting Module - UI Function
modPedigreeServer()
Pedigree Browser Module - Server Function
modPedigreeUI()
Pedigree Browser Module - UI Function
modPotentialParentsServer()
Potential Parents Module - Server Function
modPotentialParentsUI()
Potential Parents Module - UI Function
modPyramidServer()
Age-Sex Pyramid Module - Server Function
modPyramidUI()
Age-Sex Pyramid Module - UI Function
modSummaryStatsServer()
Summary Statistics Module - Server Function
modSummaryStatsUI()
Summary Statistics Module - UI Function
nprcgenekeepr
Genetic Tools for Colony Management
obfuscateDate()
obfucateDate adds a random number of days bounded by plus and minus max delta
obfuscateId()
obfucateId creates a vector of ID aliases of specified length
obfuscatePed()
obfuscatePed takes a pedigree object and creates aliases for all IDs and adjusts all date within a specified amount.
offspringCounts()
Finds the total number of offspring for each animal in the pedigree
ped1Alleles
ped1Alleles is a dataframe created by the geneDrop function
pedDuplicateIds
pedDuplicateIds is a dataframe with 9 rows and 5 columns (ego_id, sire, dam_id, sex, birth_date) representing a full pedigree with a duplicated record.
pedFemaleSireMaleDam
pedFemaleSireMaleDam is a dataframe with 8 rows and 5 columns (ego_id, sire, dam_id, sex, birth_date) representing a full pedigree with the errors of having a sire labeled as female and a dam labeled as male.
pedGood
pedGood is a dataframe with 8 rows and 5 columns (ego_id, sire, dam_id, sex, birth_date) representing a full pedigree with no errors.
pedInvalidDates
pedInvalidDates is a dataframe with 8 rows and 5 columns (ego_id, sire, dam_id, sex, birth_date) representing a full pedigree with values in the birth_date column that are not valid dates.
pedMissingBirth
pedMissingBirth is a dataframe with 8 rows and 5 columns (ego_id, sire, dam_id, sex, birth_date) representing a full pedigree with no errors.
pedOne
pedOne is a loadable version of a pedigree file fragment used for testing and demonstration
pedSameMaleIsSireAndDam
pedSameMaleIsSireAndDam is a dataframe with 8 rows and 5 columns (ego_id, sire, dam_id, sex, birth_date) representing a full pedigree with no errors.
pedSix
pedSix is a loadable version of a pedigree file fragment used for testing and demonstration
pedWithGenotype
pedWithGenotype is a dataframe produced from qcPed by adding made up genotypes.
pedWithGenotypeReport
pedWithGenotypeReport is a list containing the output of reportGV.
print(<summary.nprcgenekeeprErr> ) print(<summary.nprcgenekeeprGV> )
print.summary.nprcgenekeepr print.summary.nprcgenekeeprGV
processQcStudbookResult()
Process qcStudbook Result into UI-Friendly Format
qcBreeders
qcBreeders is a list of 29 baboon IDs that are potential breeders
qcPed
qcPed is a dataframe with 277 rows and 6 columns
qcPedGvReport
qcPedGvReport is a genetic value report
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 serve as placeholders for unknown parents.
reportGV()
Generates a genetic value report for a provided pedigree.
rhesusGenotypes
rhesusGenotypes is a dataframe with two haplotypes per animal
rhesusPedigree
rhesusPedigree is a pedigree object
runGeneKeepR()
Run the GeneKeepR Shiny Application (Deprecated)
runModularApp()
Run the Modular Version of GeneKeepR
runQcStudbook()
Run Quality Control on Studbook with UI-Friendly Results
safeExecute()
Safe Execution Wrapper with Error Handling
saveDataframesAsFiles()
Write copy of dataframes to either CSV, TXT, or Excel file.
savePlotToFile()
Save Plot to File
setAutoIdFormat()
Set the auto-generated unknown-ID format
setExit()
Sets the exit date, if there is no exit column in the table
setPopulation()
Population designation function
set_seed()
Work around for unit tests using sample() among various versions of R
shouldShowChangedColsTab()
Determine if Changed Columns tab should be displayed
shouldShowOripTab()
Determine if the ORIP Reporting tab should be displayed
smallPed
smallPed is a hypothetical pedigree
smallPedTree
smallPedTree is a pedigree tree made from smallPed
summarizeKinshipValues()
Summary statistics for imputed kinship values
summary(<nprcgenekeeprErr> ) summary(<nprcgenekeeprGV> )
summary.nprcgenekeeprErr Summary function for class nprcgenekeeprErr
toCharacter()
Force dataframe columns to character
trimPedigree()
Trim pedigree to ancestors of provided group by removing uninformative individuals
withinIntegerRange()
Get integer within a range