Cape-class: The CAPE data object

Cape-classR Documentation

The CAPE data object

Description

The CAPE data object

The CAPE data object

Details

Class Cape defines a CAPE analysis object.

Slots

parameter_file

string, full path to YAML file with initialization parameters

yaml_parameters

string representing YAML CAPE parameters. See the vignette for more descriptions of individual parameter settings.

results_path

string, full path to directory for storing results (optional, a directory will be created if one is not specified)

save_results

Whether to save cape results. Defaults to FALSE.

use_saved_results

Whether to use existing results from a previous run. This can save time if re-running an analysis, but can lead to problems if the old run and new run have competing settings. If errors arise, and use_saved_results is set to TRUE, try setting it to FALSE, or deleting previous results.

pheno

A matrix containing the traits to be analyzed. Traits are in columns and individuals are in rows.

chromosome

A vector the same length as the number of markers indicating which chromosome each marker lives on.

marker_num

A vector the same length as the number of markers indicating the index of each marker

marker_location

A vector the same length as the number of markers indicating the genomic position of each marker. The positions are primarily used for plotting and can be in base pairs, centiMorgans, or dummy variables.

marker_selection_method

A string indicating how markers should be selected for the pairscan. Options are "top_effects" or "from_list." If "top_effects," markers are selected using main effect sizes. If "from_list" markers are specified using a vector of marker names. See select_markers_for_pairscan.

geno_names

The dimnames of the genotype array. The genotype array is a three-dimensional array in which rows are individuals, columns are alleles, and the third dimension houses the markers. Genotypes are pulled for analysis using get_geno based on geno_names. Only the individuals, alleles, and markers listed in geno_names are taken from the genotype matrix. Functions that remove markers and individuals from analysis always operate on geno_names in addition to other relevant slots. The names of geno_names must be "mouse", "allele", "locus."

geno

A three dimensional array holding genotypes for each animal for each allele at each marker. The genotypes are continuously valued probabilities ranging from 0 to 1. The dimnames of geno must be "mouse", "allele", and "locus," even if the individuals are not mice.

geno_for_pairscan

A two-dimensional matrix holding the genotypes that will be analyzed in the pairscan. Alleles are in columns and individuals are in rows. As in the geno array, values are continuous probabilities ranging from 0 to 1.

peak_density

The density parameter for select_markers_for_pairscan. Determines how densely markers under an individual effect size peak are selected for the pairscan if marker_selection_method is TRUE. Defaults to 0.5.

window_size

The window size used by select_markers_for_pairscan. It specifies how many markers are used to smooth effect size curves for automatic peak identification. If set to NULL, window_size is determined automatically. Used when marker_selection_method is TRUE.

tolerance

The wiggle room afforded to select_markers_for_pairscan in finding a target number of markers. If num_alleles_in_pairscan is 100 and the tolerance is 5, the algorithm will stop when it identifies anywhere between 95 and 105 markers for the pairscan.

ref_allele

A string of length 1 indicating which allele to use as the reference allele. In two-parent crosses, this is usually allele A. In DO/CC populations, we recommend using B as the reference allele. B is the allele from the C57Bl6/J mouse, which is often used as a reference strain.

alpha

The significance level for calculating effect size thresholds in the singlescan. If singlescan_perm is 0, this parameter is ignored.

covar_table

A matrix of covariates with covariates in columns and individuals in rows. Must be numeric.

num_alleles_in_pairscan

The number of alleles to test in the pairwise scan. Because Cape is computationally intensive, we usually need to test only a subset of available markers in the pairscan, particularly if the kinship correction is being used.

max_pair_cor

the maximum Pearson correlation between two markers. If their correlation exceeds this value, they will not be tested against each other in the pairscan. This threshold is set to prevent false positive arising from testing highly correlated markers. If this value is set to NULL, min_per_genotype must be specified.

min_per_genotype

minimum The minimum number of individuals allowable per genotype combination in the pair scan. If for a given marker pair, one of the genotype combinations is underrepresented, the marker pair is not tested. If this value is NULL, max_pair_cor must be specified.

pairscan_null_size

The total size of the null distribution. This is DIFFERENT than the number of permutations to run. Each permutation generates n choose 2 elements for the pairscan. So for example, a permutation that tests 100 pairs of markers will generate a null distribution of size 4950. This process is repeated until the total null size is reached. If the null size is set to 5000, two permutations of 100 markers would be done to get to a null distribution size of 5000.

p_covar

A vector of strings specifying the names of covariates derived from traits. See pheno2covar.

g_covar

A vector of strings specifying the names of covariates derived from genetic markers. See marker2covar.

p_covar_table

A matrix holding the individual values for each trait-derived covariate. See pheno2covar.

g_covar_table

A matrix holding the individual values for each marker-derived covariate. See marker2covar.

model_family

Indicates the model family of the phenotypes This can be either "gaussian" or "binomial". If this argument is length 1, all phenotypes will be assigned to the same family. Phenotypes can be assigned different model families by providing a vector of the same length as the number of phenotypes, indicating how each phenotype should be modeled. See singlescan.

scan_what

A string indicating whether "eigentraits", "normalized_traits", or "raw_traits" should be analyzed. See get_pheno.

ET

A matrix holding the eigentraits to be analyzed.

singular_values

Added by get_eigentraits. A vector holding the singular values from the singular value decomposition of the trait matrix. They are used in rotating the final direct influences back to trait space from eigentrait space. See get_eigentraits and direct_influence.

right_singular_vectors

Added by get_eigentraits. A matrix containing the right singular vectors from the singular value decomposition of the trait matrix. They are used in rotating the final direct influences back to trait space from eigentrait space. See get_eigentraits and direct_influence.

traits_scaled

Whether the traits should be mean-centered and standardized before analyzing.

traits_normalized

Whether the traits should be rank Z normalized before analyzing.

var_to_var_influences_perm

added in error_prop The list of results from the error propagation of permuted coefficients.

var_to_var_influences

added in error_prop The list of results from the error propagation of coefficients.

pval_correction

Options are "holm", "hochberg", "hommel", "bonferroni", "BH", "BY","fdr", "none"

linkage_blocks_collapsed

A list containing assignments of markers to linkage blocks calculated by linkage_blocks_network and plot_network. In this list there can be multiple markers assigned to a single linkage block.

linkage_blocks_full

A list containing assignments of markers to linkage blocks when no linkage blocks are calculated. In this list there can only be one marker per "linkage block". See linkage_blocks_network and plot_network.

var_to_var_p_val

The final table of cape interaction results calculated by error_prop.

max_var_to_pheno_influence

The final table of cape direct influences of markers to traits calculated by direct_influence.

collapsed_net

An adjacency matrix holding significant cape interactions between linkage blocks. See plot_network and get_network.

full_net

An adjacency matrix holding significant cape interactions between individual markers. See plot_network and get_network.

use_kinship

Whether to use a kinship correction in the analysis.

kinship_type

Which type of kinship matrix to use. Either "overall" for the overall kinship matrix or "ltco" for leave-two-chromosomes-out.

transform_to_phenospace

whether to transform to phenospace or not.

Public fields

parameter_file

full path to YAML file with initialization parameters.

yaml_parameters

string representing YAML CAPE parameters. See the vignette for more descriptions of individual parameter settings.

results_path

string, full path to directory for storing results (optional, a directory will be created if one is not specified).

save_results

Whether to save cape results. Defaults to FALSE.

use_saved_results

Whether to use existing results from a previous run. This can save time if re-running an analysis, but can lead to problems if the old run and new run have competing settings. If errors arise, and use_saved_results is set to TRUE, try setting it to FALSE, or deleting previous results.

pheno

A matrix containing the traits to be analyzed. Traits are in columns and individuals are in rows.

chromosome

A vector the same length as the number of markers indicating which chromosome each marker lives on.

marker_num

A vector the same length as the number of markers indicating the index of each marker.

marker_location

A vector the same length as the number of markers indicating the genomic position of each marker. The positions are primarily used for plotting and can be in base pairs, centiMorgans, or dummy variables.

geno_names

The dimnames of the genotype array. The genotype array is a three-dimensional array in which rows are individuals, columns are alleles, and the third dimension houses the markers. Genotypes are pulled for analysis using get_geno based on geno_names. Only the individuals, alleles, and markers listed in geno_names are taken from the genotype matrix. Functions that remove markers and individuals from analysis always operate on geno_names in addition to other relevant slots. The names of geno_names must be "mouse", "allele", "locus."

geno

A three dimensional array holding genotypes for each animal for each allele at each marker. The genotypes are continuously valued probabilities ranging from 0 to 1. The dimnames of geno must be "mouse", "allele", and "locus," even if the individuals are not mice.

peak_density

The density parameter for select_markers_for_pairscan. Determines how densely markers under an individual effect size peak are selected for the pairscan if marker_selection_method is TRUE. Defaults to 0.5.

window_size

The window size used by select_markers_for_pairscan. It specifies how many markers are used to smooth effect size curves for automatic peak identification. If set to NULL, window_size is determined automatically. Used when marker_selection_method is TRUE.

tolerance

The wiggle room afforded to select_markers_for_pairscan in finding a target number of markers. If num_alleles_in_pairscan is 100 and the tolerance is 5, the algorithm will stop when it identifies anywhere between 95 and 105 markers for the pairscan.

ref_allele

A string of length 1 indicating which allele to use as the reference allele. In two-parent crosses, this is usually allele A. In DO/CC populations, we recommend using B as the reference allele. B is the allele from the C57Bl6/J mouse, which is often used as a reference strain.

alpha

The significance level for calculating effect size thresholds in the singlescan. If singlescan_perm is 0, this parameter is ignored.

covar_table

A matrix of covariates with covariates in columns and individuals in rows. Must be numeric.

num_alleles_in_pairscan

The number of alleles to test in the pairwise scan. Because Cape is computationally intensive, we usually need to test only a subset of available markers in the pairscan, particularly if the kinship correction is being used.

max_pair_cor

The maximum Pearson correlation between two markers. If their correlation exceeds this value, they will not be tested against each other in the pairscan. This threshold is set to prevent false positive arising from testing highly correlated markers. If this value is set to NULL, min_per_genotype must be specified.

min_per_genotype

minimum The minimum number of individuals allowable per genotype combination in the pair scan. If for a given marker pair, one of the genotype combinations is underrepresented, the marker pair is not tested. If this value is NULL, max_pair_cor must be specified.

pairscan_null_size

The total size of the null distribution. This is DIFFERENT than the number of permutations to run. Each permutation generates n choose 2 elements for the pairscan. So for example, a permutation that tests 100 pairs of markers will generate a null distribution of size 4950. This process is repeated until the total null size is reached. If the null size is set to 5000, two permutations of 100 markers would be done to get to a null distribution size of 5000.

p_covar

A vector of strings specifying the names of covariates derived from traits. See pheno2covar.

g_covar

A vector of strings specifying the names of covariates derived from genetic markers. See marker2covar.

p_covar_table

A matrix holding the individual values for each trait-derived covariate. See pheno2covar.

g_covar_table

A matrix holding the individual values for each marker-derived covariate. See marker2covar.

model_family

Indicates the model family of the phenotypes. This can be either "gaussian" or "binomial". If this argument is length 1, all phenotypes will be assigned to the same family. Phenotypes can be assigned different model families by providing a vector of the same length as the number of phenotypes, indicating how each phenotype should be modeled. See singlescan.

scan_what

A string indicating whether "eigentraits", "normalized_traits", or "raw_traits" should be analyzed. See get_pheno.

ET

A matrix holding the eigentraits to be analyzed.

singular_values

Added by get_eigentraits. A vector holding the singular values from the singular value decomposition of the trait matrix. They are used in rotating the final direct influences back to trait space from eigentrait space. See get_eigentraits and direct_influence.

right_singular_vectors

Added by get_eigentraits. A matrix containing the right singular vectors from the singular value decomposition of the trait matrix. They are used in rotating the final direct influences back to trait space from eigentrait space. See get_eigentraits and direct_influence.

traits_scaled

Whether the traits should be mean-centered and standardized before analyzing.

traits_normalized

Whether the traits should be rank Z normalized before analyzing.

var_to_var_influences_perm

added in error_prop. The list of results from the error propagation of permuted coefficients.

var_to_var_influences

added in error_prop. The list of results from the error propagation of coefficients.

pval_correction

Options are "holm", "hochberg", "hommel", "bonferroni", "BH", "BY","fdr", "none".

var_to_var_p_val

The final table of cape interaction results calculated by error_prop.

max_var_to_pheno_influence

The final table of cape direct influences of markers to traits calculated by direct_influence.

full_net

An adjacency matrix holding significant cape interactions between individual markers. See plot_network and get_network.

use_kinship

Whether to use a kinship correction in the analysis.

kinship_type

which type of kinship matrix to use

transform_to_phenospace

whether to transform to phenospace or not.

Active bindings

geno_for_pairscan

geno for pairscan

marker_selection_method

marker selection method

linkage_blocks_collapsed

linkage blocks collapsed

linkage_blocks_full

linkage blocks full

collapsed_net

collapsed net

Methods

Public methods


Method assign_parameters()

Assigns variables from the parameter file to attributes in the Cape object.

Usage
Cape$assign_parameters()

Method check_inputs()

Checks the dimensionality of inputs and its consistency.

Usage
Cape$check_inputs()

Method check_geno_names()

Checks genotype names.

Usage
Cape$check_geno_names()

Method new()

Initialization method.

Usage
Cape$new(
  parameter_file = NULL,
  yaml_parameters = NULL,
  results_path = NULL,
  save_results = FALSE,
  use_saved_results = TRUE,
  pheno = NULL,
  chromosome = NULL,
  marker_num = NULL,
  marker_location = NULL,
  geno_names = NULL,
  geno = NULL,
  .geno_for_pairscan = NULL,
  peak_density = NULL,
  window_size = NULL,
  tolerance = NULL,
  ref_allele = NULL,
  alpha = NULL,
  covar_table = NULL,
  num_alleles_in_pairscan = NULL,
  max_pair_cor = NULL,
  min_per_genotype = NULL,
  pairscan_null_size = NULL,
  p_covar = NULL,
  g_covar = NULL,
  p_covar_table = NULL,
  g_covar_table = NULL,
  model_family = NULL,
  scan_what = NULL,
  ET = NULL,
  singular_values = NULL,
  right_singular_vectors = NULL,
  traits_scaled = NULL,
  traits_normalized = NULL,
  var_to_var_influences_perm = NULL,
  var_to_var_influences = NULL,
  pval_correction = NULL,
  var_to_var_p_val = NULL,
  max_var_to_pheno_influence = NULL,
  full_net = NULL,
  use_kinship = NULL,
  kinship_type = NULL,
  transform_to_phenospace = NULL,
  plot_pdf = NULL
)
Arguments
parameter_file

string, full path to YAML file with initialization parameters

yaml_parameters

string representing YAML CAPE parameters. See the vignette for more descriptions of individual parameter settings.

results_path

string, full path to directory for storing results (optional, a directory will be created if one is not specified)

save_results

Whether to save cape results. Defaults to TRUE.

use_saved_results

Whether to use existing results from a previous run. This can save time if re-running an analysis, but can lead to problems if the old run and new run have competing settings. If errors arise, and use_saved_results is set to TRUE, try setting it to FALSE, or deleting previous results.

pheno

A matrix containing the traits to be analyzed. Traits are in columns and individuals are in rows.

chromosome

A vector the same length as the number of markers indicating which chromosome each marker lives on.

marker_num

A vector the same length as the number of markers indicating the index of each marker

marker_location

A vector the same length as the number of markers indicating the genomic position of each marker. The positions are primarily used for plotting and can be in base pairs, centiMorgans, or dummy variables.

geno_names

The dimnames of the genotype array. The genotype array is a three-dimensional array in which rows are individuals, columns are alleles, and the third dimension houses the markers. Genotypes are pulled for analysis using get_geno based on geno_names. Only the individuals, alleles, and markers listed in geno_names are taken from the genotype matrix. Functions that remove markers and individuals from analysis always operate on geno_names in addition to other relevant slots. The names of geno_names must be "mouse", "allele", "locus."

geno

A three dimensional array holding genotypes for each animal for each allele at each marker. The genotypes are continuously valued probabilities ranging from 0 to 1. The dimnames of geno must be "mouse", "allele", and "locus," even if the individuals are not mice.

.geno_for_pairscan

A two-dimensional matrix holding the genotypes that will be analyzed in the pairscan. Alleles are in columns and individuals are in rows. As in the geno array, values are continuous probabilities ranging from 0 to 1.

peak_density

The density parameter for select_markers_for_pairscan. Determines how densely markers under an individual effect size peak are selected for the pairscan if marker_selection_method is TRUE. Defaults to 0.5.

window_size

The window size used by select_markers_for_pairscan. It specifies how many markers are used to smooth effect size curves for automatic peak identification. If set to NULL, window_size is determined automatically. Used when marker_selection_method is TRUE.

tolerance

The wiggle room afforded to select_markers_for_pairscan in finding a target number of markers. If num_alleles_in_pairscan is 100 and the tolerance is 5, the algorithm will stop when it identifies anywhere between 95 and 105 markers for the pairscan.

ref_allele

A string of length 1 indicating which allele to use as the reference allele. In two-parent crosses, this is usually allele A. In DO/CC populations, we recommend using B as the reference allele. B is the allele from the C57Bl6/J mouse, which is often used as a reference strain.

alpha

The significance level for calculating effect size thresholds in the singlescan. If singlescan_perm is 0, this parameter is ignored.

covar_table

A matrix of covariates with covariates in columns and individuals in rows. Must be numeric.

num_alleles_in_pairscan

The number of alleles to test in the pairwise scan. Because Cape is computationally intensive, we usually need to test only a subset of available markers in the pairscan, particularly if the kinship correction is being used.

max_pair_cor

the maximum Pearson correlation between two markers. If their correlation exceeds this value, they will not be tested against each other in the pairscan. This threshold is set to prevent false positive arising from testing highly correlated markers. If this value is set to NULL, min_per_genotype must be specified.

min_per_genotype

minimum The minimum number of individuals allowable per genotype combination in the pair scan. If for a given marker pair, one of the genotype combinations is underrepresented, the marker pair is not tested. If this value is NULL, max_pair_cor must be specified.

pairscan_null_size

The total size of the null distribution. This is DIFFERENT than the number of permutations to run. Each permutation generates n choose 2 elements for the pairscan. So for example, a permutation that tests 100 pairs of markers will generate a null distribution of size 4950. This process is repeated until the total null size is reached. If the null size is set to 5000, two permutations of 100 markers would be done to get to a null distribution size of 5000.

p_covar

A vector of strings specifying the names of covariates derived from traits. See pheno2covar.

g_covar

A vector of strings specifying the names of covariates derived from genetic markers. See marker2covar.

p_covar_table

A matrix holding the individual values for each trait-derived covariate. See pheno2covar.

g_covar_table

A matrix holding the individual values for each marker-derived covariate. See marker2covar.

model_family

Indicates the model family of the phenotypes This can be either "gaussian" or "binomial". If this argument is length 1, all phenotypes will be assigned to the same family. Phenotypes can be assigned different model families by providing a vector of the same length as the number of phenotypes, indicating how each phenotype should be modeled. See singlescan.

scan_what

A string indicating whether "eigentraits", "normalized_traits", or "raw_traits" should be analyzed. See get_pheno.

ET

A matrix holding the eigentraits to be analyzed.

singular_values

Added by get_eigentraits. A vector holding the singular values from the singular value decomposition of the trait matrix. They are used in rotating the final direct influences back to trait space from eigentrait space. See get_eigentraits and direct_influence.

right_singular_vectors

Added by get_eigentraits. A matrix containing the right singular vectors from the singular value decomposition of the trait matrix. They are used in rotating the final direct influences back to trait space from eigentrait space. See get_eigentraits and direct_influence.

traits_scaled

Whether the traits should be mean-centered and standardized before analyzing.

traits_normalized

Whether the traits should be rank Z normalized before analyzing.

var_to_var_influences_perm

added in error_prop The list of results from the error propagation of permuted coefficients.

var_to_var_influences

added in error_prop The list of results from the error propagation of coefficients.

pval_correction

Options are "holm", "hochberg", "hommel", "bonferroni", "BH", "BY","fdr", "none"

var_to_var_p_val

The final table of cape interaction results calculated by error_prop.

max_var_to_pheno_influence

The final table of cape direct influences of markers to traits calculated by direct_influence.

full_net

An adjacency matrix holding significant cape interactions between individual markers. See plot_network and get_network.

use_kinship

Whether to use a kinship correction in the analysis.

kinship_type

Which type of kinship matrix to use. Either "overall" or "ltco."

transform_to_phenospace

whether to transform to phenospace or not.

plot_pdf

logical. If TRUE, results are generated as pdf


Method plotSVD()

Plot Eigentraits

Usage
Cape$plotSVD(filename)
Arguments
filename

filename of result plot


Method plotSinglescan()

Plot results of single-locus scans

Usage
Cape$plotSinglescan(
  filename,
  singlescan_obj,
  width = 20,
  height = 6,
  units = "in",
  res = 300,
  standardized = TRUE,
  allele_labels = NULL,
  alpha = alpha,
  include_covars = TRUE,
  line_type = "l",
  pch = 16,
  cex = 0.5,
  lwd = 3,
  traits = NULL
)
Arguments
filename

filename of result plot.

singlescan_obj

a singlescan object from singlescan

width

width of result plot, default is 20.

height

height of result plot, default is 6.

units

units of result plot, default is "in".

res

resolution of result plot, default is 300.

standardized

If TRUE t statistics are plotted. If FALSE, effect sizes are plotted, default is TRUE

allele_labels

A vector of labels for the alleles if different that those stored in the data_object.

alpha

the alpha significance level. Lines for significance values will only be plotted if n_perm > 0 when singlescan was run. And only alpha values specified in singlescan can be plotted.

include_covars

Whether to include covariates in the plot.

line_type

as defined in plot

pch

see the "points()" R function. Default is 16 (a point).

cex

see the "points()" R function. Default is 0.5.

lwd

line width, default is 3.

traits

a vector of trait names to plot. Defaults to all traits.


Method plotPairscan()

Plot the result of the pairwise scan

Usage
Cape$plotPairscan(
  filename,
  pairscan_obj,
  phenotype = NULL,
  show_marker_labels = TRUE,
  show_alleles = FALSE
)
Arguments
filename

filename of result plot.

pairscan_obj

a pairscan object from pairscan

phenotype

The names of the phenotypes to be plotted. If NULL, all phenotypes are plotted.

show_marker_labels

If TRUE marker labels are plotted along the axes. If FALSE, they are omitted.

show_alleles

If TRUE, the allele of each marker is indicated by color.


Method plotVariantInfluences()

Plot cape coefficients

Usage
Cape$plotVariantInfluences(
  filename,
  width = 10,
  height = 7,
  p_or_q = p_or_q,
  standardize = FALSE,
  not_tested_col = "lightgray",
  covar_width = NULL,
  pheno_width = NULL
)
Arguments
filename

filename of result plot.

width

width of result plot, default is 10.

height

height of result plot, default is 7.

p_or_q

A threshold indicating the maximum p value (or q value if FDR was used) of significant interactions and main effects.

standardize

Whether to plot effect sizes (FALSE) or standardized effect sizes (TRUE), default is TRUE.

not_tested_col

The color to use for marker pairs not tested. Takes the same values as pos_col and neg_col, default is "lightgray".

covar_width

See pheno_width. This is the same effect for covariates.

pheno_width

Each marker and trait gets one column in the matrix. If there are many markers, this makes the effects on the traits difficult to see. pheno_width increases the number of columns given to the phenotypes. For example, if pheno_width = 11, the phenotypes will be shown 11 times wider than individual markers.


Method plotNetwork()

Plots cape results as a circular network

Usage
Cape$plotNetwork(
  filename,
  label_gap = 10,
  label_cex = 1.5,
  show_alleles = FALSE
)
Arguments
filename

filename of result plot.

label_gap

A numeric value indicating the size of the gap the chromosomes and their labels, default is 10.

label_cex

A numeric value indicating the size of the labels, default is 1.5.

show_alleles

TRUE show the alleles, FALSE does not show alleles. Default is FALSE.


Method plotFullNetwork()

Plot the final epistatic network in a traditional network view.

Usage
Cape$plotFullNetwork(
  filename,
  zoom = 1.2,
  node_radius = 0.3,
  label_nodes = TRUE,
  label_offset = 0.4,
  label_cex = 0.5,
  bg_col = "lightgray",
  arrow_length = 0.1,
  layout_matrix = "layout_with_kk",
  legend_position = "topright",
  edge_lwd = 1,
  legend_radius = 2,
  legend_cex = 0.7,
  xshift = -1
)
Arguments
filename

filename of result plot.

zoom

Allows the user to zoom in and out on the image if the network is either running off the edges of the plot or too small in the middle of the plot, default is 1.2.

node_radius

The size of the pie chart for each node, default is 0.3.

label_nodes

A logical value indicating whether the nodes should be labeled. Users may want to remove labels for large networks, default is TRUE.

label_offset

The amount by which to offset the node labels from the center of the nodes, default is 0.4.

label_cex

The size of the node labels, default is 0.5.

bg_col

The color to be used in pie charts for non-significant main effects. Takes the same values as pos_col, default is "lightgray".

arrow_length

The length of the head of the arrow, default is 0.1.

layout_matrix

Users have the option of providing their own layout matrix for the network. This should be a two column matrix indicating the x and y coordinates of each node in the network, default is "layout_with_kk".

legend_position

The position of the legend on the plot, default is "topright".

edge_lwd

The thickness of the arrows showing the interactions, default is 1.

legend_radius

The size of the legend indicating which pie piece corresponds to which traits, default is 2.

legend_cex

The size of the labels in the legend, default is 0.7.

xshift

A constant by which to shift the x values of all nodes in the network, default is -1.


Method writeVariantInfluences()

Write significant cape interactions to a csv file.

Usage
Cape$writeVariantInfluences(
  filename,
  p_or_q = 0.05,
  include_main_effects = TRUE
)
Arguments
filename

filename of csv file

p_or_q

A threshold indicating the maximum adjusted p value considered significant. If an FDR method has been used to correct for multiple testing, this value specifies the maximum q value considered significant, default is 0.05.

include_main_effects

Whether to include main effects (TRUE) or only interaction effects (FALSE) in the output table, default is TRUE.


Method set_pheno()

Set phenotype

Usage
Cape$set_pheno(val)
Arguments
val

phenotype value.


Method set_geno()

Set genotype

Usage
Cape$set_geno(val)
Arguments
val

genotype value.


Method create_covar_table()

Create covariate table

Usage
Cape$create_covar_table(value)
Arguments
value

covariate values


Method save_rds()

Save to RDS file

Usage
Cape$save_rds(object, filename)
Arguments
object

data to be saved.

filename

filename of result RDS file.


Method read_rds()

Read RDS file

Usage
Cape$read_rds(filename)
Arguments
filename

RDS filename to be read.

Examples

## Not run: 
param_file <- "cape_parameters.yml"
results_path = "."
cape_obj <- read_population("cross.csv")
combined_obj <- cape2mpp(cape_obj)
pheno_obj <- combined_obj$data_obj
geno_obj <- combined_obj$geno_obj

data_obj <- Cape$new(parameter_file = param_file,
results_path = results_path, pheno = pheno_obj$pheno, chromosome = pheno_obj$chromosome, 
marker_num = pheno_obj$marker_num, marker_location = pheno_obj$marker_location, 
geno_names = pheno_obj$geno_names, geno = geno_obj)

## End(Not run)


cape documentation built on May 29, 2024, 5:11 a.m.