Description Usage Arguments Value Author(s) See Also Examples
View source: R/peptide_pairwise_correlation.R
perform correlation or co-occurrence analysis across all pairs of peptides.
Pairwise comparison were implemented by to_pairwise
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | peptide_pairwise_correlation(
d,
analysis_type = "correlation",
perform_test = FALSE,
cor_method = "pearson",
occ_method = "jaccard",
occ_test = "fisher",
p_adjust_method = "fdr",
hit_threshold = 1,
temporal_samples = FALSE,
si = NULL,
output_str = "data.table",
mc = 1
)
|
d |
a data frame or tibble containing z-scores or binary indicator of peptide enrichment. Columns represent peptides and rows represent samples. Column names are peptide ids and row names are sample ids. |
analysis_type |
type of analysis to perform.
Options: "correlation" or "cooccurrence".
If select "correlation", correlation will be calculated on the z-scores, and
|
perform_test |
a logical indicator of whether statistical tests
should be performed for each comparison.
The test method is specified by |
cor_method |
correlation coefficient and test to be computed.
Pass to |
occ_method |
cooccurrence coefficient to be computed.
Pass to |
occ_test |
cooccurrence tests to be computed.
Pass to |
p_adjust_method |
method to adjust p values for multiple comparison.
Pass to |
hit_threshold |
the antibody reactivity threshold above which the epitope is considered as enriched. Default: 1 |
temporal_samples |
a logical indicator of whether there are multiple
temporal samples from each individual. If |
si |
a data frame or tibble indicating the temporal structure of the samples.
The first column of |
output_str |
format of the output to return. Options: "data.table", "data.frame", and "tibble". Default: "data.table" |
mc |
number of cores to use for multi-thread parallel analysis. Pass to
|
a data frame/data table/tibble that contains correlation or co-occurence analysis results of all pairs of peptides
Siyang Xia sxia@hsph.harvard.edu
peptide_coocurrence
, to_pairwise
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | data(peptide_z)
sample_info <- data.frame(id = row.names(peptide_z),
individual = rep(c("ind1", "ind2"), each = 6))
### 1. correlation analysis with default setting
output1 <- peptide_pairwise_correlation(d = peptide_z)
head(output1)
### 2. correlation with statistical tests
output2 <- peptide_pairwise_correlation(d = peptide_z,
si = sample_info,
analysis_type = "correlation",
perform_test = TRUE,
cor_method = "pearson")
head(output2)
### 3. correlation with temporal samples
output3 <- peptide_pairwise_correlation(d = peptide_z,
si = sample_info,
analysis_type = "correlation",
perform_test = TRUE,
cor_method = "pearson",
temporal_samples = TRUE)
head(output3)
### 4. cooccurrence analysis with all three coefficients
output4 <- peptide_pairwise_correlation(d = peptide_z,
si = sample_info,
analysis_type = "cooccurrence",
hit_threshold = 5,
perform_test = FALSE,
occ_method = c("jaccard", "phi", "prop"),
temporal_samples = FALSE)
head(output4)
### 5. cooccurrence analysis with two coefficients and fisher's exact test
output5 <- peptide_pairwise_correlation(d = peptide_z,
si = sample_info,
analysis_type = "cooccurrence",
hit_threshold = 10,
perform_test = TRUE,
occ_method = c("jaccard", "phi"),
occ_test = "fisher",
temporal_samples = FALSE)
head(output5)
### 6. cooccurrence analysis with only phi coefficient and return as a tibble
output6 <- peptide_pairwise_correlation(d = peptide_z,
si = sample_info,
analysis_type = "cooccurrence",
hit_threshold = 5,
perform_test = FALSE,
occ_method = "phi",
temporal_samples = FALSE,
output_str = "tibble")
head(output6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.