Performs comprehensive sequence comparison analysis between groups. All patterns of the sequences (subsequences of specific length) are extracted from all sequences in each group. For two groups, the proportions of the patterns between the groups are compared with a z-test for proportions. For more than two groups, the Chi-squared test is applied. Both tests are applied within patterns of the same length.
compare_sequences(x, ...)# S3 method for default
compare_sequences(x, group, sub, min_freq = 5L, correction = "bonferroni", ...)
# S3 method for group_tna
compare_sequences(x, sub, min_freq = 5L, correction = "bonferroni", ...)
A tna_sequence_comparison
object, which is a data.frame
with
columns giving the names of the pattern, pattern frequencies, pattern
proportions (within patterns of the same length), test statistic values
and p-values of the tests.
A group_tna
object or a data.frame
containing sequence data in
wide format.
Not used.
A vector
indicating the group assignment of each
row of the data/sequence. Must have the same length as the number of
rows/sequences of x
. Alternatively, a single character
string giving
the column name of the data that defines the group when x
is a wide
format data.frame
or a tna_data
object.
An integer
vector of subsequence lengths to analyze.
The default is 2:5
.
An integer
giving the minimum number of times that a
specific pattern has to be observed to be included in the analysis.
The default is 5
.
A character
string naming the multiple comparison
correction method (default: "bonferroni"
). Supports all
stats::p.adjust methods: "holm"
, "hochberg"
, "hommel"
,
"bonferroni"
, "BH"
, "BY"
, "fdr"
, "none"
.
Model comparison functions
compare()
,
compare.group_tna()
,
plot.tna_comparison()
,
plot.tna_sequence_comparison()
,
plot_compare()
,
plot_compare.group_tna()
,
print.tna_comparison()
,
print.tna_sequence_comparison()
group <- c(rep("High", 1000), rep("Low", 1000))
comp <- compare_sequences(group_regulation, group)
Run the code above in your browser using DataLab