| Title: | Case-Cotrol Analysis of Multi-Allelic Loci |
|---|---|
| Description: | Data sets and functions for chi-squared Hardy-Weinberg and case-control association tests of highly polymorphic genetic data [e.g., human leukocyte antigen (HLA) data]. Performs association tests at multiple levels of polymorphism (haplotype, locus and HLA amino-acids) as described in Pappas DJ, Marin W, Hollenbach JA, Mack SJ (2016) <doi:10.1016/j.humimm.2015.12.006>. Combines rare variants to a common class to account for sparse cells in tables as described by Hollenbach JA, Mack SJ, Thomson G, Gourraud PA (2012) <doi:10.1007/978-1-61779-842-9_14>. |
| Authors: | Derek Pappas [aut], Livia Tran [aut], Steve Mack [aut, cre], Jill Hollenbach [aut] |
| Maintainer: | Steve Mack <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 3.1.0 |
| Built: | 2026-09-27 18:41:45 UTC |
| Source: | https://github.com/cranhaven/cranhaven.r-universe.dev |
This is the workhorse function for the amino acid analysis.
A(Locus, loci.ColNames, genos, grp, Strict.Bin, ExonAlign, Cores)A(Locus, loci.ColNames, genos, grp, Strict.Bin, ExonAlign, Cores)
Locus |
Locus being analyzed. |
loci.ColNames |
The column names of the loci being analyzed. |
genos |
Genotype table. |
grp |
Case/Control or Phenotype groupings. |
Strict.Bin |
Logical specify if strict rare cell binning should be used in ChiSq test. |
ExonAlign |
Exon protein alignment filtered for locus. |
Cores |
Number of cores to use for analysis. |
This function is for internal BIGDAWG use only.
Wrapper function for amino acid analysis.
A.wrapper( loci, loci.ColNames, genos, grp, Exon, EPL, Cores, Strict.Bin, Output, Verbose )A.wrapper( loci, loci.ColNames, genos, grp, Exon, EPL, Cores, Strict.Bin, Output, Verbose )
loci |
Loci being analyzed. |
loci.ColNames |
The column names of the loci being analyzed. |
genos |
Genotype table. |
grp |
Case/Control or Phenotype groupings. |
Exon |
Exon(s)for targeted analysis. |
EPL |
Protein Alignment List. |
Cores |
Number of cores to use for analysis. |
Strict.Bin |
Logical specify if strict rare cell binning should be used in ChiSq test |
Output |
Data return carryover from main BIGDAWG function |
Verbose |
Summary display carryover from main BIGDAWG function |
This function is for internal BIGDAWG use only.
Checks amino acid contingency table data frame to ensure required variation exists.
AA.df.check(x, Strict.Bin)AA.df.check(x, Strict.Bin)
x |
contingency table. |
Strict.Bin |
Logical specify if strict rare cell binning should be used in ChiSq test. |
This function is for internal BIGDAWG use only.
Runs ChiSq test on amino acid contingency table data frames.
AA.df.cs(x, Strict.Bin)AA.df.cs(x, Strict.Bin)
x |
contingency table. |
Strict.Bin |
Logical specify if strict rare cell binning should be used in ChiSq test. |
This function is for internal BIGDAWG use only.
Build Contingency Tables for Amino Acid Analysis.
AAtable.builder(x, y)AAtable.builder(x, y)
x |
Filtered alignmnet list element. |
y |
Phenotype groupings. |
This function is for internal BIGDAWG use only.
Filter Protein Exon Alignment File for Specific Alleles.
AlignmentFilter(Align, Alleles, Locus)AlignmentFilter(Align, Alleles, Locus)
Align |
Protein Alignment Object. |
Alleles |
to be pulled. |
Locus |
Locus to be filtered against. |
This function is for internal BIGDAWG use only.
Create Object for Exon Protein Alignments.
AlignObj.Create(Loci, Release, RefTab)AlignObj.Create(Loci, Release, RefTab)
Loci |
Loci to be bundled. |
Release |
IMGT/HLA database release version. |
RefTab |
Data of reference exons used for protein alignment creation. |
This function is for internal BIGDAWG use only.
Synthesize Object for Exon Protein Alignments.
AlignObj.Update(Loci, Release, RefTab)AlignObj.Update(Loci, Release, RefTab)
Loci |
Loci to be bundled. |
Release |
IMGT/HLA database release version. |
RefTab |
Data of reference exons used for protein alignment creation. |
This function is for internal BIGDAWG use only.
Adds genetic system (HLA/KIR) to each allele name
Append.System(x, df.name)Append.System(x, df.name)
x |
Vector Column genotypes to append |
df.name |
String SystemLocus name for each allele. |
This function is for internal use only.
This is the main wrapper function for each analysis.
BIGDAWG( Data, HLA = TRUE, Run.Tests, Loci.Set, Exon, All.Pairwise = FALSE, Trim = FALSE, Res = 2, EVS.rm = FALSE, Missing = 2, Strict.Bin = FALSE, Cores.Lim = 1L, Results.Dir, Return = FALSE, Output = TRUE, Merge.Output = FALSE, Verbose = TRUE, Data.Type = "Locus" )BIGDAWG( Data, HLA = TRUE, Run.Tests, Loci.Set, Exon, All.Pairwise = FALSE, Trim = FALSE, Res = 2, EVS.rm = FALSE, Missing = 2, Strict.Bin = FALSE, Cores.Lim = 1L, Results.Dir, Return = FALSE, Output = TRUE, Merge.Output = FALSE, Verbose = TRUE, Data.Type = "Locus" )
Data |
Name of the genotype data file. |
HLA |
Logical Indicating whether data is HLA class I/II genotyping data only. |
Run.Tests |
Specifics which tests to run. |
Loci.Set |
Input list defining which loci to use for analyses (combinations permitted). |
Exon |
Numeric Exon(s) for targeted amino acid analysis. |
All.Pairwise |
Logical indicating whether all pairwise loci should be analyzed in haplotype analysis. |
Trim |
Logical indicating if HLA alleles should be trimmed to a set resolution. |
Res |
Numeric setting what desired resolution to trim HLA alleles. |
EVS.rm |
Logical indicating if expression variant suffixes should be removed. |
Missing |
Numeric setting allowable missing data for running analysis (may use "ignore"). |
Strict.Bin |
Logical specify if strict rare cell binning should be used in ChiSq test. |
Cores.Lim |
Integer setting the number of cores accessible to BIGDAWG (Windows limit is 1 core). |
Results.Dir |
Optional, string of full path directory name for BIGDAWG output. |
Return |
Logical Should analysis results be returned as list. |
Output |
Logical Should analysis results be written to output directory. |
Merge.Output |
Logical Should analysis results be merged into a single file for easy access. |
Verbose |
Logical Should a summary of each analysis be displayed in console. |
Data.Type |
String describing the data type in the provided dataset. The default is set to 'Locus'. Options are 'Locus' or 'Motif'. |
## Not run: ### The following examples use the synthetic data set bundled with BIGDAWG # Haplotype analysis with no missing genotypes for two loci sets # Significant haplotype association with phenotype # BIGDAWG(Data="HLA_data", Run.Tests="H", Missing=0, Loci.Set=list(c("DRB1","DQB1"))) # Hardy-Weinberg and Locus analysis ignoring missing data # Significant locus associations with phenotype at all but DQB1 # BIGDAWG(Data="HLA_data", Run.Tests="L", Missing="ignore") # Hardy-Weinberg analysis trimming data to 2-Field resolution with no output to files (console only) # Significant locus deviation at DQB1 BIGDAWG(Data="HLA_data", Run.Tests="HWE", Trim=TRUE, Res=2, Output=FALSE) ## End(Not run)## Not run: ### The following examples use the synthetic data set bundled with BIGDAWG # Haplotype analysis with no missing genotypes for two loci sets # Significant haplotype association with phenotype # BIGDAWG(Data="HLA_data", Run.Tests="H", Missing=0, Loci.Set=list(c("DRB1","DQB1"))) # Hardy-Weinberg and Locus analysis ignoring missing data # Significant locus associations with phenotype at all but DQB1 # BIGDAWG(Data="HLA_data", Run.Tests="L", Missing="ignore") # Hardy-Weinberg analysis trimming data to 2-Field resolution with no output to files (console only) # Significant locus deviation at DQB1 BIGDAWG(Data="HLA_data", Run.Tests="HWE", Trim=TRUE, Res=2, Output=FALSE) ## End(Not run)
Initializes output matrix format for GL2Tab conversion
Build.Matrix(System, Loci)Build.Matrix(System, Loci)
System |
Character Genetic system HLA- or KIR |
Loci |
The loci for header names |
This function is for internal use only.
Builds table of names for HAPsets
buildHAPnames(Combn, loci)buildHAPnames(Combn, loci)
Combn |
Combination of loci to extraction from genos |
loci |
Character vector of unique loci being analyzed. |
This function is for internal BIGDAWG use only.
Builds table of haplotypes from combinations
buildHAPsets(Combn, genos, loci, loci.ColNames)buildHAPsets(Combn, genos, loci, loci.ColNames)
Combn |
Combination of loci to extraction from genos |
genos |
The genotype columns of the loci set being analyzed. |
loci |
Character vector of unique loci being analyzed. |
loci.ColNames |
Character vector of genos column names. |
This function is for internal BIGDAWG use only.
cci function port epicalc version 2.15.1.0 (Virasakdi Chongsuvivatwong, 2012)
cci( caseexp, controlex, casenonex, controlnonex, cctable = NULL, graph = FALSE, design = "cohort", main, xlab, ylab, xaxis, yaxis, alpha = 0.05, fisher.or = TRUE, exact.ci.or = TRUE, decimal = 2 )cci( caseexp, controlex, casenonex, controlnonex, cctable = NULL, graph = FALSE, design = "cohort", main, xlab, ylab, xaxis, yaxis, alpha = 0.05, fisher.or = TRUE, exact.ci.or = TRUE, decimal = 2 )
caseexp |
Number of cases exposed |
controlex |
Number of controls exposed |
casenonex |
Number of cases not exosed |
controlnonex |
Number of controls not exposed |
cctable |
A 2-by-2 table. If specified, will supercede the outcome and exposure variables |
graph |
If TRUE (default), produces an odds ratio plot |
design |
Specification for graph; can be "case control","case-control", "cohort" or "prospective" |
main |
main title of the graph |
xlab |
label on X axis |
ylab |
label on Y axis |
xaxis |
two categories of exposure in graph |
yaxis |
two categories of outcome in graph |
alpha |
level of significance |
fisher.or |
whether odds ratio should be computed by the exact method |
exact.ci.or |
whether confidence limit of the odds ratio should be computed by the exact method |
decimal |
number of decimal places displayed |
This function is for internal BIGDAWG use only.
Calculates odds ratio and pvalues from 2x2 table
cci.pval(x)cci.pval(x)
x |
List of 2x2 matrices for calculation, output of TableMaker. |
This function is for internal BIGDAWG use only.
Variation of the cci.pval function
cci.pval.list(x)cci.pval.list(x)
x |
List of 2x2 matrices to apply the cci.pval function. List output of TableMaker. |
This function is for internal BIGDAWG use only.
Check cores limitation for OS compatibility
Check.Cores(Cores.Lim, Output)Check.Cores(Cores.Lim, Output)
Cores.Lim |
Integer How many cores can be used. |
Output |
Logical Should analysis results be written to output directory. |
Check data structure for successful conversion.
Check.Data(Data, System, Convert)Check.Data(Data, System, Convert)
Data |
String Type of output. |
System |
Character Genetic system HLA or KIR |
Convert |
String Direction for conversion. |
This function is for internal use only.
Check input parameters for invalid entries.
Check.Params( HLA, Loci.Set, Exon, All.Pairwise, Trim, Res, EVS.rm, Missing, Cores.Lim, Return, Output, Merge.Output, Verbose )Check.Params( HLA, Loci.Set, Exon, All.Pairwise, Trim, Res, EVS.rm, Missing, Cores.Lim, Return, Output, Merge.Output, Verbose )
HLA |
Logical indicating whether data is HLA class I/II genotyping data only. |
Loci.Set |
Input list defining which loci to use for analyses (combinations permitted). |
Exon |
Numeric Exon(s) for targeted amino acid analysis. |
All.Pairwise |
Logical indicating whether all pairwise loci should be analyzed in haplotype analysis. |
Trim |
Logical indicating if HLA alleles should be trimmed to a set resolution. |
Res |
Numeric setting what desired resolution to trim HLA alleles. |
EVS.rm |
Logical indicating if expression variant suffixes should be removed. |
Missing |
Numeric setting allowable missing data for running analysis (may use "ignore"). |
Cores.Lim |
Integer setting the number of cores accessible to BIGDAWG (Windows limit is 1 core). |
Return |
Logical Should analysis results be returned as list. |
Output |
Logical Should analysis results be written to output directory. |
Merge.Output |
Logical Should analysis results be merged into a single file for easy access. |
Verbose |
Logical Should a summary of each analysis be displayed in console. |
This function is for internal use only.
Check input parameters for invalid entries.
Check.Params.GLS( Convert, File.Output, System, HZY.Red, DRB345.Check, Cores.Lim )Check.Params.GLS( Convert, File.Output, System, HZY.Red, DRB345.Check, Cores.Lim )
Convert |
String Direction for conversion. |
File.Output |
String Type of output. |
System |
String Genetic system (HLA or KIR) of the data being converted |
HZY.Red |
Logical Reduction of homozygote genotypes to single allele. |
DRB345.Check |
Logical Check DR haplotypes for consistency and flag unusual haplotypes. |
Cores.Lim |
Integer How many cores can be used. |
This function is for internal use only.
Checks available alleles against data to ensure complete overlap.
CheckAlleles(x, y)CheckAlleles(x, y)
x |
Exon protein list alignment object. |
y |
Genotypes from data file |
This function is for internal BIGDAWG use only.
Checks data to see if HLA data is properly formatted .
CheckHLA(x)CheckHLA(x)
x |
All columns of HLA genotyping data. |
This function is for internal BIGDAWG use only.
Checks available loci against data to ensure complete overlap.
CheckLoci(x, y)CheckLoci(x, y)
x |
Loci available in exon protein list alignment object. |
y |
Unique column names |
This function is for internal BIGDAWG use only.
This updates the protein aligment used in checking HLA loci and alleles as well as in the amino acid analysis.
CheckRelease(Package = T, Alignment = T, Output = F)CheckRelease(Package = T, Alignment = T, Output = F)
Package |
Logical to check for BIGDAWG package versions |
Alignment |
Logical to check the IMGT/HLA database version for the alignment bundled with BIGDAWG. |
Output |
Should any error be written to a file |
Requires active internet connection.
GL String check for allele ambiguity formatting
CheckString.Allele(x)CheckString.Allele(x)
x |
GL String to check against |
This function is for internal use only.
Check GL string for loci appearing in multiple gene fields.
CheckString.Locus(x, Loci)CheckString.Locus(x, Loci)
x |
GL String to check against |
Loci |
Loci to check |
This function is for internal use only.
Combines multiple Exon Specific Alignments into a single Alignment object
Condense.EPL(EPL.Exon)Condense.EPL(EPL.Exon)
EPL.Exon |
Exon-Locus Specific Amino Acid Alignment. |
This function is for internal BIGDAWG use only.
Creates matrix of NA for no result tables.
Create.Null.Table(Locus, Names, nr)Create.Null.Table(Locus, Names, nr)
Locus |
Locus being analyzed. |
Names |
Column names for final matrix. |
nr |
Number of rows. |
This function is for internal BIGDAWG use only.
Checks DR haplotypes for correct zygosity and flags unanticipated haplotypes
DRB345.Check.Wrapper(Genotype, Loci.DR)DRB345.Check.Wrapper(Genotype, Loci.DR)
Genotype |
Row of data set data frame following DRB345 parsing |
Loci.DR |
DRBx Loci of interest to test for consistency |
This function is for internal use only.
Checks DR haplotypes for correct zygosity and flags unanticipated haplotypes for a single DRBx
DRB345.Check.Zygosity(Locus, Genotype)DRB345.Check.Zygosity(Locus, Genotype)
Locus |
Locus of interest to test for consistency |
Genotype |
Row of data set data frame following DRB345 parsing |
This function is for internal use only.
Checks DRB1 Genotype and Returns Expected DR345 Loci
DRB345.Exp(DRB1.Genotype)DRB345.Exp(DRB1.Genotype)
DRB1.Genotype |
DRB1 Subject Genotypes |
This function is for internal use only.
Separates DRB345 column pair into separate columns for each locus
DRB345.parser(Tab)DRB345.parser(Tab)
Tab |
Data frame of sampleIDs, phenotypes, and genotypes |
This function is for internal BIGDAWG use only.
Displays error codes attributable to data formatting and Locus/Allele naming. Writes to log file.
Err.Log(Output, x, y = NULL, z = NULL)Err.Log(Output, x, y = NULL, z = NULL)
Output |
Logical indicating if Error logging should be written to a file. |
x |
Log Code. |
y |
Misc information relevant to error. |
z |
Misc information relevant to error. |
This function is for internal BIGDAWG use only.
Removes expression variant suffixes from HLA alleles in the exon protein alignment object.
EVSremoval(Locus, EPList)EVSremoval(Locus, EPList)
Locus |
Locus to be filtered against. |
EPList |
Exon Protein Alignment Object |
This function is for internal BIGDAWG use only.
Filters the ExonPtnAlign object by locus and exon.
Exon.Filter(Locus, Exon, EPL.Locus, RefExons, E.Ptn.Starts)Exon.Filter(Locus, Exon, EPL.Locus, RefExons, E.Ptn.Starts)
Locus |
Locus being analyzed. |
Exon |
Exon being analyzed. |
EPL.Locus |
ExonPtnAlign object filtered by Locus |
RefExons |
Reference Exon Table |
E.Ptn.Starts |
Exon Protein Overlay Map |
This function is for internal BIGDAWG use only.
Dynamically creates an alignmnet of Allele exons for Analysis.
ExonPtnAlign.Create(Locus, RefTab)ExonPtnAlign.Create(Locus, RefTab)
Locus |
Locus alignment to be formatted. |
RefTab |
Reference exon protein information for alignment formatting. |
This function is for internal BIGDAWG use only.
Alignment object for use in the amino acid analysis.
ExonPtnListExonPtnList
A list where each element is an alignment dataframe for a single locus.
Replaces or Fills absent allele strings.
Filler(x, Locus = NULL, Type)Filler(x, Locus = NULL, Type)
x |
Genotype |
Locus |
Locus column to adjust. |
Type |
String specifying whether to pad ('Fill') or leave blank ('Remove') absent calls |
This function is for internal use only.
Remove or Append Locus name from/to allele in an ambiguous allele string
Format.Allele(x, Type)Format.Allele(x, Type)
x |
Allele String |
Type |
String specifying whether to strip ('off') or append ('on') locus prefix |
This function is for internal use only.
Correctly orders the expanded GL string
Format.Tab(x, Order)Format.Tab(x, Order)
x |
Single row of converted GL string |
Order |
Single row data frame for mapping converted GL strings |
This function is for internal use only.
Using Freq.Final, recompute number of alleles
getAllele.Count(x)getAllele.Count(x)
x |
Locus specific contingency matrix getCS.Mat output. |
This function is for internal BIGDAWG use only.
Chi Square contingency matrix builder with rare cell binning
getCS.Mat(Locus, genos.sub, Allele.Freq, Allele.Combn)getCS.Mat(Locus, genos.sub, Allele.Freq, Allele.Combn)
Locus |
Locus of interest. |
genos.sub |
Genotypes for locus of interest. |
Allele.Freq |
Allele frequencies. |
Allele.Combn |
Allele combinations. |
This function is for internal BIGDAWG use only.
Calculate chi square test statistic
getCS.stat(Locus, Freq.Final)getCS.stat(Locus, Freq.Final)
Locus |
Locus of interest. |
Freq.Final |
Contingency Matrix getCS.Mat output. |
This function is for internal BIGDAWG use only.
Trim a properly formatted HLA allele to desired number of fields.
GetField(x, Res)GetField(x, Res)
x |
HLA allele. |
Res |
Resolution desired. |
This function is for internal BIGDAWG use only.
Function to extract file path.
getFileName(x)getFileName(x)
x |
File name. |
This function is for internal use only.
Download Protein Alignment and Accessory Files
GetFiles(Loci)GetFiles(Loci)
Loci |
HLA Loci to be fetched. Limited Loci available. |
This function is for internal BIGDAWG use only.
Builds table of haplotypes
getHap(SID, HaploEM)getHap(SID, HaploEM)
SID |
Index number (i.e., row number) of sample ID from genotype matrix. |
HaploEM |
Haplotype output object from haplo.stat::haplo.em function. |
This function is for internal BIGDAWG use only.
Get observed frequency of genotypes
getObsFreq(x, genos.locus)getObsFreq(x, genos.locus)
x |
Single genotype. |
genos.locus |
Locus genotypes. |
This function is for internal BIGDAWG use only.
Orders Locus Calls
GL2Tab.Loci(Locus, Genotype, System)GL2Tab.Loci(Locus, Genotype, System)
Locus |
Locus to condense |
Genotype |
Row of loci to condense |
System |
Character Genetic system HLA or KIR |
This function is for internal use only.
Expands GL string into a table of adjacent loci
GL2Tab.Sub(x, System)GL2Tab.Sub(x, System)
x |
Character GL string to expand |
System |
Character Genetic system HLA or KIR |
This function is for internal use only.
Expands GL strings to columns of adjacent locus pairs.
GL2Tab.wrapper(df, System, Strip.Prefix, Abs.Fill, Cores)GL2Tab.wrapper(df, System, Strip.Prefix, Abs.Fill, Cores)
df |
Data frame containing GL strings |
System |
Character Genetic system HLA or KIR |
Strip.Prefix |
Logical Should System/Locus prefixes be stripped from table data. |
Abs.Fill |
Logical Should absent loci special designations be used. |
Cores |
Integer How many cores can be used |
This function is for internal use only
Main Workhorse wrapper for cross converting columnar table to GL string representaion.
GLSconvert( Data, Convert, File.Output = "txt", System = "HLA", HZY.Red = FALSE, DRB345.Check = FALSE, Strip.Prefix = TRUE, Abs.Fill = FALSE, Cores.Lim = 1L )GLSconvert( Data, Convert, File.Output = "txt", System = "HLA", HZY.Red = FALSE, DRB345.Check = FALSE, Strip.Prefix = TRUE, Abs.Fill = FALSE, Cores.Lim = 1L )
Data |
String File name or R Data Frame. |
Convert |
String Direction for conversion. |
File.Output |
String Type of File.Output. |
System |
String Genetic system (HLA or KIR) of the data being converted |
HZY.Red |
Logical Reduction of homozygote genotypes to single allele. |
DRB345.Check |
Logical Check DR haplotypes for consistency and flag unusual haplotypes. |
Strip.Prefix |
Logical Should System/Locus prefixes be stripped from table data. |
Abs.Fill |
Logical Should absent loci special designations be used. |
Cores.Lim |
Integer How many cores can be used. |
This is the workhorse function for the haplotype analysis.
H.MC(genos.sub, grp, Strict.Bin, Verbose)H.MC(genos.sub, grp, Strict.Bin, Verbose)
genos.sub |
The genotype columns of the loci(locus) set being analyzed. |
grp |
Case/Control or Phenotype groupings. |
Strict.Bin |
Logical specify if strict rare cell binning should be used in ChiSq test |
Verbose |
Summary display carryover from main BIGDAWG function |
This function is for internal BIGDAWG use only.
Wrapper for main H function
H.MC.wrapper( SID, Tabsub, loci, loci.ColNames, genos, grp, All.Pairwise, Strict.Bin, Output, Verbose, Cores )H.MC.wrapper( SID, Tabsub, loci, loci.ColNames, genos, grp, All.Pairwise, Strict.Bin, Output, Verbose, Cores )
SID |
Character vector of subject IDs. |
Tabsub |
Data frame of genotype calls for set being analyzed. |
loci |
Character vector of unique loci being analyzed. |
loci.ColNames |
Character vector of genos column names. |
genos |
The genotype columns of the loci set being analyzed. |
grp |
Case/Control or Phenotype groupings. |
All.Pairwise |
Haplotype argument carryover from main BIGDAWG function |
Strict.Bin |
Logical specify if strict rare cell binning should be used in ChiSq test |
Output |
Data return carryover from main BIGDAWG function |
Verbose |
Summary display carryover from main BIGDAWG function |
Cores |
Cores carryover from main BIGDAWG function |
This function is for internal BIGDAWG use only.
A synthetic dataset of HLA genotypes for using bigdawg.
HLA_dataHLA_data
A data frame with 2000 rows and 14 variables
This is the main function for the HWE analysis.
HWE(Tab)HWE(Tab)
Tab |
data frame of genotype files post processing. |
This function is for internal BIGDAWG use only.
This is the workhorse function for each group analysis.
HWE.ChiSq(genos.sub, loci, nloci)HWE.ChiSq(genos.sub, loci, nloci)
genos.sub |
data frame of genotype files post processing. |
loci |
list of loci. |
nloci |
number of loci in list |
This function is for internal BIGDAWG use only.
Wrapper for main HWE function
HWE.wrapper(Tab, Output, Verbose)HWE.wrapper(Tab, Output, Verbose)
Tab |
Data frame of genotype files post processing. |
Output |
Data return carryover from main BIGDAWG function |
Verbose |
Summary display carryover from main BIGDAWG function |
This function is for internal BIGDAWG use only.
This is the workhorse function for the locus level analysis.
L(loci.ColNames, Locus, genos, grp, Strict.Bin)L(loci.ColNames, Locus, genos, grp, Strict.Bin)
loci.ColNames |
The column names of the loci being analyzed. |
Locus |
Locus being analyzed. |
genos |
Genotype table |
grp |
Case/Control or Phenotype groupings. |
Strict.Bin |
Logical specify if strict rare cell binning should be used in ChiSq test |
This function is for internal BIGDAWG use only.
Wrapper for main L function
L.wrapper(nloci, loci, loci.ColNames, genos, grp, Strict.Bin, Output, Verbose)L.wrapper(nloci, loci, loci.ColNames, genos, grp, Strict.Bin, Output, Verbose)
nloci |
Number of loci being analyzed. |
loci |
Loci being analyzed. |
loci.ColNames |
The column names of the loci being analyzed. |
genos |
Genotype table |
grp |
Case/Control or Phenotype groupings. |
Strict.Bin |
Logical specify if strict rare cell binning should be used in ChiSq test |
Output |
Data return carryover from main BIGDAWG function |
Verbose |
Summary display carryover from main BIGDAWG function |
This function is for internal BIGDAWG use only.
make2x2 function port epicalc version 2.15.1.0 (Virasakdi Chongsuvivatwong, 2012)
make2x2(caseexp, controlex, casenonex, controlnonex)make2x2(caseexp, controlex, casenonex, controlnonex)
caseexp |
Number of cases exposed |
controlex |
Number of controls exposed |
casenonex |
Number of cases not exosed |
controlnonex |
Number of controls not exposed |
This function is for internal BIGDAWG use only.
Make data frame of possible genotype combinations
makeComb(x)makeComb(x)
x |
Number of alleles. |
This function is for internal BIGDAWG use only.
Whole data set table construction of per haplotype for odds ratio, confidence intervals, and pvalues
MergeData_Output(BD.out, Run, OutDir)MergeData_Output(BD.out, Run, OutDir)
BD.out |
Output of analysis as list. |
Run |
Tests that are to be run as defined by Run.Tests. |
OutDir |
Output directory defined by Results.Dir or default. |
This function is for internal BIGDAWG use only.
Identify P group for a given allele if exists.
PgrpExtract(x, y)PgrpExtract(x, y)
x |
Allele of interest. |
y |
Formatted P groups. |
This function is for internal BIGDAWG use only.
Format the hla_nom_p.txt read table object for a specific locus.
PgrpFormat(x, Locus)PgrpFormat(x, Locus)
x |
P group object from read.table command. |
Locus |
Locus to be filtered on. |
This function is for internal BIGDAWG use only.
Summary function for sample population within data file.
PreCheck(Tab, All.ColNames, rescall, HLA, Verbose, Output)PreCheck(Tab, All.ColNames, rescall, HLA, Verbose, Output)
Tab |
Loci available in exon protein list alignment object. |
All.ColNames |
Column names from genotype data. |
rescall |
HLA resolution set for analysis. |
HLA |
HLA BIGDAWG argument passed to function |
Verbose |
Summary display carryover from BIGDAWG function. |
Output |
Data output carryover form BIGDAWG function |
This function is for internal BIGDAWG use only.
Prepare imported data for processing, checks, and analysis.
prepData(Tab, data_type)prepData(Tab, data_type)
Tab |
Genotypes dataframe. |
data_type |
The type of data being processed. Options are 'Locus' or 'Motif'.' |
This function is for internal BIGDAWG use only.
Replaces allowable absent allele strings with ^ symbol.
rmABstrings(df)rmABstrings(df)
df |
Genotypes dataframe. |
This function is for internal BIGDAWG use only.
Calculates chi-squared contingency table tests and bins all rare cells.
RunChiSq(x)RunChiSq(x)
x |
Contingency table. |
This function is for internal BIGDAWG use only.
Calculates chi-squared contingency table tests and bins rare cells at 20
RunChiSq_c(x)RunChiSq_c(x)
x |
Contingency table. |
This function is for internal BIGDAWG use only.
Removes the System and Locus designations for alleles calls in GL2Tab
Stripper(x)Stripper(x)
x |
Allele |
This function is for internal use only.
Summary function for identifying missing alleles in a matrix of genotypes.
summaryGeno.2(geno, miss.val = 0)summaryGeno.2(geno, miss.val = 0)
geno |
Matrix of genotypes. |
miss.val |
Vector of codes for allele missing values. |
This function is for internal BIGDAWG use only and is ported from haplo.stats.
Condenses alleles calls of a single locus string using "+"
Tab2GL.Loci(Locus, Genotype, System, HZY.Red)Tab2GL.Loci(Locus, Genotype, System, HZY.Red)
Locus |
Locus to condense |
Genotype |
Row of loci to condense |
System |
Character Genetic system HLA or KIR |
HZY.Red |
Logical Should homozygote genotypes be a single allele for non-DRB345. |
This function is for internal use only.
Condenses column of loci into a GL string using "^"
Tab2GL.Sub(x, System, HZY.Red)Tab2GL.Sub(x, System, HZY.Red)
x |
Row of loci to condense |
System |
Character Genetic system HLA or KIR |
HZY.Red |
Logical Should homozygote genotypes be a single allele for non-DRB345. |
This function is for internal use only.
Expands GL strings to columns of adjacent locus pairs.
Tab2GL.wrapper(df, System, HZY.Red, Abs.Fill, Cores)Tab2GL.wrapper(df, System, HZY.Red, Abs.Fill, Cores)
df |
Data frame containing GL strings |
System |
Character Genetic system HLA or KIR |
HZY.Red |
Logical Should homozygote genotypes be a single allele for non-DRB345. |
Abs.Fill |
Logical Should absent loci special designations be used |
Cores |
Integer How many cores can be used. |
This function is for internal use only.
Table construction of per haplotype for odds ratio, confidence intervals, and pvalues
TableMaker(x)TableMaker(x)
x |
Contingency table with binned rare cells. |
This function is for internal BIGDAWG use only.
This updates the protein aligment used in checking HLA loci and alleles as well as in the amino acid analysis.
UpdateRelease(Force = F, Restore = F, Output = F)UpdateRelease(Force = F, Restore = F, Output = F)
Force |
Logical specifiying if update should be forced. |
Restore |
Logical specifying if the original alignment file be restored. |
Output |
Logical indicating if error reporting should be written to file. |