# Analyzing High Density Peptide Array Data using HERON

# HERON

The goal of HERON (Hierarchical Epitope pROtein biNding) is to analyze peptide binding array data measured from nimblegen or any high density peptide binding array data.

## Installation

You can install the released version of HERON from bioconductor with:

    if (!require("BiocManager", quietly = TRUE))
        install.packages("BiocManager")

    # The following initializes usage of Bioc devel
    BiocManager::install(version='devel')

    BiocManager::install("HERON")

And the development version from GitHub with:

    # install.packages("devtools")
    devtools::install_github("Ong-Research/HERON")

    options(warn=2)
    suppressPackageStartupMessages(library(HERON))

## Example

These are examples which shows you how to interact with the code. We will be using a subset of the COVID-19 peptide binding array dataset from the https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8245122/ publication.

### The HERONSequenceData object

The HERONSequenceDataSet object is the first object needed for running HERON. The HERONSequenceDataSet is a subclass of SummarizedExperiment from base Bioconductor. The components are a sequence data.frame or matrix where rows are amino acid sequences of the peptide binding probe and the columns are samples, a colData DFrame, and a metadata data.frame that maps sequences to probes.

#### Sequence matrix

    data(heffron2021_wuhan)
    knitr::kable(assay(heffron2021_wuhan)[1:5,1:5])

| Sample_9 | Sample_1 | Sample_39 | Sample_23 | Sample_56
--- | --- | --- | --- | --- | ---
AAAYYVGYLQPRTFLL | 0.3746667 | 0.5423724 | 0.7329991 | 0.1225761 | 0.9727648
AADLDDFSKQLQQSMS | 2.8056786 | 3.1205293 | 9.2330091 | 4.2324981 | 9.8410852
AAEASKKPRQKRTATK | 0.2704410 | 0.7198765 | 2.6648164 | 1.7079940 | 4.5664978
AAEIRASANLAATKMS | 0.7120529 | 1.3820778 | 1.5463912 | 3.2038894 | 7.3400386
AAIVLQLPQGTTLPKG | 2.9876932 | 0.1259101 | 4.6971758 | 5.6496847 | 2.2246734

#### colData

The colData data frame describes the experimental setup of the samples.
For the colData data frame, the important columns are ptid, visit, and SampleName. The SampleName is the column name of the sequence table, ptid is the name of the sample, and visit is either pre or post.
The ptid can the same value for one pre and post sample, which would indicate a paired design. A condition column can also be provided which can indicate multiple conditions for the post samples.

    knitr::kable(head(colData(heffron2021_wuhan)))

| SampleName | ptid | visit | condition
--- | --- | --- | --- | ---
Sample_9 | Sample_9 | Sample_9 | pre | Control
Sample_1 | Sample_1 | Sample_1 | pre | Control
Sample_39 | Sample_39 | Sample_39 | post | COVID
Sample_23 | Sample_23 | Sample_23 | post | COVID
Sample_56 | Sample_56 | Sample_56 | post | COVID
Sample_53 | Sample_53 | Sample_53 | post | COVID

#### Probe metadata

The probe_meta data frame describes the mapping the amino acid sequence (PROBE_SEQUENCE) of the probes to the probe identifier (PROBE_ID). The PROBE_ID contains the name of the protein and the position within the protein of the first acid of the probe sequence separated by a semicolon.

    probe_meta <- metadata(heffron2021_wuhan)$probe_meta
    knitr::kable(head(probe_meta[,c("PROBE_SEQUENCE", "PROBE_ID")]))

| PROBE_SEQUENCE | PROBE_ID
--- | --- | ---
76322 | MYSFVSEETGTLIVNS | NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;1
76323 | YSFVSEETGTLIVNSV | NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;2
76324 | SFVSEETGTLIVNSVL | NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;3
76325 | FVSEETGTLIVNSVLL | NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;4
76326 | VSEETGTLIVNSVLLF | NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;5
76327 | SEETGTLIVNSVLLFL | NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;6

### Creating the HERONSequenceData object

The heffron2021_wuhan data object is already a HERONSequenceDataSet object. We can create the same object using the HERONSequenceDataSet constructor as an example.

    seq_mat <- assay(heffron2021_wuhan)
    sds <- HERONSequenceDataSet(seq_mat)
    colData(sds) <- colData(heffron2021_wuhan)
    metadata(sds)$probe_meta <- probe_meta

### Pre-process data

The data is pre-processed by first quantile normalizing on sequence-level data.

    seq_ds_qn <- quantileNormalize(sds)
    knitr::kable(head(assay(seq_ds_qn)[,1:5]))

| Sample_9 | Sample_1 | Sample_39 | Sample_23 | Sample_56
--- | --- | --- | --- | --- | ---
AAAYYVGYLQPRTFLL | 0.3569421 | 0.8802587 | 0.5174103 | 0.1539593 | 0.8632584
AADLDDFSKQLQQSMS | 2.4975483 | 4.4552679 | 6.6610043 | 4.8175685 | 7.2030291
AAEASKKPRQKRTATK | 0.2706685 | 1.1883782 | 2.0845928 | 1.6878615 | 3.4542907
AAEIRASANLAATKMS | 0.6506443 | 2.1632309 | 1.1600102 | 3.6584394 | 5.0898633
AAIVLQLPQGTTLPKG | 2.8027363 | 0.2307280 | 3.2037424 | 6.1906585 | 1.8298191
AALALLLLDRLNQLES | 0.5432972 | 0.4990815 | 2.2830699 | 0.0681958 | 2.9236376

### Calculate probe-level p-values

The quantile normalized data is then used with the colData and probe_meta data frames to calculate probe-level p-values.

The calcCombPValues call will first calculate the probe level p-values using the colData, adjust the probe p-values on a column-by-column basis frame.

The combined p-values can be calculated on the sequence data set, then converted to a probe data set through convertSequenceDSToProbeDS, or calculated on the probe data set. If the data was smoothed prior using consecutive probes on the same protein, then the p-values should calculated on the smoothed probe data set.

    seq_pval_res <- calcCombPValues(seq_ds_qn)
    probe_pval_res <- convertSequenceDSToProbeDS(seq_pval_res)
    knitr::kable(head(assay(probe_pval_res, "padj")[,1:5]))

| Sample_39 | Sample_23 | Sample_56 | Sample_53 | Sample_43
--- | --- | --- | --- | --- | ---
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;1 | 1 | 1.0000000 | 1.0000000 | 0.7009991 | 1
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;2 | 1 | 1.0000000 | 1.0000000 | 1.0000000 | 1
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;3 | 1 | 0.1693163 | 0.7731021 | 1.0000000 | 1
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;4 | 1 | 1.0000000 | 1.0000000 | 1.0000000 | 1
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;5 | 1 | 1.0000000 | 1.0000000 | 1.0000000 | 1
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;6 | 1 | 1.0000000 | 1.0000000 | 1.0000000 | 1

### Obtain probe-level calls

Once the p-values have been calculated, the makeProbeCalls will make the calls using the adjusted p-values calculated. makeProbeCalls also includes a filter to remove one-hit probes, which are probes that were called only in one sample and do not have a consecutive probe called in a single sample. The return value is HERONProbeDataSet with the calls included as an additional assay.

    probe_calls_res <- makeProbeCalls(probe_pval_res)
    knitr::kable(head(assay(probe_calls_res, "calls")[,1:5]))

| Sample_39 | Sample_23 | Sample_56 | Sample_53 | Sample_43
--- | --- | --- | --- | --- | ---
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;1 | FALSE | FALSE | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;2 | FALSE | FALSE | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;3 | FALSE | FALSE | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;4 | FALSE | FALSE | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;5 | FALSE | FALSE | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;6 | FALSE | FALSE | FALSE | FALSE | FALSE

K of N, Fraction, and Percent of calls made per sequence, probe, epitope, or protein can be determined using the getKofN function.

    probe_calls_k_of_n <- getKofN(probe_calls_res)
    knitr::kable(head(probe_calls_k_of_n))

| K | F | P
--- | --- | --- | ---
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;1 | 1 | 0.025 | 2.5
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;2 | 1 | 0.025 | 2.5
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;3 | 0 | 0.000 | 0.0
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;4 | 0 | 0.000 | 0.0
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;5 | 0 | 0.000 | 0.0
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;6 | 0 | 0.000 | 0.0

### Find Epitope Segments using the unique method

After calculating probe p-values and calls, the HERON can find epitope segments, i.e. blocks of consecutive probes that have been called within a sample or cluster of samples. The unique method finds all consecutive probes for each sample, then returns the unique set of all epitopic regions.

    epi_segments_uniq_res <- findEpitopeSegments(
        probe_calls_res,
        segment_method = "unique"
    )

    knitr::kable(head(epi_segments_uniq_res))

x
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_140_141
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_172_173
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_247_247
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_542_546
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_553_560
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_568_577

The format of the epitope segments are SEQID_Begin_End, where the SEQID is the protein name, Begin is the starting position of the first probe within the consecutive block, and the End is the starting position of the last probe within the consecutive block.

### Calculate Epitope-level p-values

With the epitope segments and the probe p-values, HERON can calculate a significance value for the segments using a meta p-value method. Here, we are calculating epitope p-values using Wilkinson’s max meta p-value method.

    epi_padj_uniq <- calcEpitopePValues(
        probe_calls_res,
        epitope_ids = epi_segments_uniq_res,
        metap_method = "wmax1"
    )

You can add sequence annotations to the row data of the HERONEpitopeDataSet object.

    epi_padj_uniq <- addSequenceAnnotations(epi_padj_uniq)

### Obtain Epitope-level calls

The makeEpitopeCalls method will work on the epitope adjusted p-values to make epitope-level sample. getKofN can also get the K of N results.

    epi_calls_uniq <- makeEpitopeCalls(epi_padj_uniq, one_hit_filter = TRUE)
    epi_calls_k_of_n_uniq <- getKofN(epi_calls_uniq)
    knitr::kable(head(epi_calls_k_of_n_uniq))

| K | F | P
--- | --- | --- | ---
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_140_141 | 4 | 0.100 | 10.0
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_172_173 | 9 | 0.225 | 22.5
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_247_247 | 11 | 0.275 | 27.5
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_542_546 | 12 | 0.300 | 30.0
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_553_560 | 34 | 0.850 | 85.0
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface_568_577 | 37 | 0.925 | 92.5

### Calculate Protein-level p-values

Calculate protein p-values using Tippett’s (Wilkinson’s Min) method.

    prot_padj_uniq <- calcProteinPValues(
        epi_padj_uniq,
        metap_method = "tippetts"
    )

### Obtain Protein-level calls

    prot_calls_uniq <- makeProteinCalls(prot_padj_uniq)
    prot_calls_k_of_n_uniq <- getKofN(prot_calls_uniq)
    knitr::kable(head(prot_calls_k_of_n_uniq))

| K | F | P
--- | --- | --- | ---
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface | 40 | 1.0 | 100
NC_045512.2;YP_009724393.1;Wu1-SARS2_membrane | 40 | 1.0 | 100
NC_045512.2;YP_009724397.2;Wu1-SARS2_nucleoca | 40 | 1.0 | 100
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope | 12 | 0.3 | 30

## Other

The are other functions to utilize depending upon what you would like to do. For example, there are different methods for finding the epitope segments that involve clustering across samples. There are two main methods, one using hierarchical clustering and another using the skater method from the spdep package. In addition to the two methods, how the distance matrix is calculated can be modified. The following subsections demonstrate how to find epitope segment blocks using hclust or skater and using a binary hamming distance or a numeric euclidean distance for making calls. After the segments are found, you can then use the calcEpitopePValuesMat and makeEpitopeCalls functions as before to find the epitope p-values, protein p-values, and the respective calls.

### Find Epitope Segments using the hclust method

#### binary calls with hamming distance

    epi_segments_hclust_res <- findEpitopeSegments(
        probe_calls_res,
        segment_method = "hclust",
        segment_score_type = "binary",
        segment_dist_method = "hamming",
        segment_cutoff = "silhouette"
    )

#### z-scores with euclidean distance

    epi_segments_hclust_res2 <- findEpitopeSegments(
        probe_calls_res,
        segment_method = "hclust",
        segment_score_type = "zscore",
        segment_dist_method = "euclidean",
        segment_cutoff = "silhouette"
    )

### Find Epitope Segments using the skater method

#### binary calls with hamming distance

    epi_segments_skater_res <- findEpitopeSegments(
        probe_calls_res,
        segment_method = "skater",
        segment_score_type = "binary",
        segment_dist_method = "hamming",
        segment_cutoff = "silhouette"
    )

#### z-scores with euclidean distance

    epi_segments_skater_res <- findEpitopeSegments(
        probe_calls_res,
        segment_method = "skater",
        segment_score_type = "zscore",
        segment_dist_method = "euclidean",
        segment_cutoff = "silhouette"
    )

### Other meta p-value methods

HERON also allows a choice for a number of meta p-value methods for combining p-values for epitopes (calcEpitopePValuesPDS) and proteins (calcProteinPValuesEDS). The methods supported by HERON are : min_bonf, min, max, fischer/sumlog, hmp/harmonicmeanp, wilkinsons_min1/tippets, wilkinsons_min2/wmin2, wilkinsons_min3, wilkinsons_min4, wilkinsons_min5, wilkinsons_max1/wmax1, wilkinsons_max2/wmax2, and cct.

When choosing a p-value method, keep in mind that the epitope p-value should be one that requires most of the probe p-values to be small (e.g. wmax1) and the protein should be one that requires at least one of the epitope p-values to be small (e.g. wmax1). Other p-value methods such as the cct and the hmp have been shown to be more accurate with p-value that have dependencies.

### Making z-score cutoff calls

Some investigators would like to make z-score global level calls rather than using adjusted p-values. HERON is flexible to allow for such a setup. For example, the user wanted to make probe-level calls using a z-score cutoff > 2.

    seq_pval_res_z <- calcCombPValues(
        obj = seq_ds_qn,
        use = "z",
        p_adjust_method = "none"
    )

    p_cutoff <- pnorm(2, lower.tail = FALSE)

    probe_pval_res_z <- convertSequenceDSToProbeDS(seq_pval_res_z, probe_meta)

    probe_calls_z2 <- makeProbeCalls(probe_pval_res_z, padj_cutoff = p_cutoff)
    probe_k_of_n_z2 <- getKofN(probe_calls_z2)

    knitr::kable(head(assay(probe_calls_z2,"calls")[,1:5]))

| Sample_39 | Sample_23 | Sample_56 | Sample_53 | Sample_43
--- | --- | --- | --- | --- | ---
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;1 | FALSE | FALSE | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;2 | FALSE | FALSE | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;3 | FALSE | FALSE | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;4 | FALSE | FALSE | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;5 | FALSE | FALSE | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;6 | FALSE | FALSE | FALSE | FALSE | FALSE

    knitr::kable(head(probe_k_of_n_z2[probe_k_of_n_z2$K > 0,]))

| K | F | P
--- | --- | --- | ---
NC_045512.2;YP_009724393.1;Wu1-SARS2_membrane;4 | 1 | 0.025 | 2.5
NC_045512.2;YP_009724393.1;Wu1-SARS2_membrane;5 | 3 | 0.075 | 7.5
NC_045512.2;YP_009724393.1;Wu1-SARS2_membrane;6 | 1 | 0.025 | 2.5
NC_045512.2;YP_009724393.1;Wu1-SARS2_membrane;7 | 4 | 0.100 | 10.0
NC_045512.2;YP_009724393.1;Wu1-SARS2_membrane;8 | 10 | 0.250 | 25.0
NC_045512.2;YP_009724393.1;Wu1-SARS2_membrane;156 | 2 | 0.050 | 5.0

The calls can also be used to find epitopes segments, p-values, and calls. Also, can be used to make protein level calls.

    epi_segments_uniq_z2_res <- findEpitopeSegments(
        probe_calls_z2,
        segment_method = "unique"
    )

If we want to find regions where the z > 2 for all of the consecutive probes, using the max meta p-value method will ensure that.

    epi_pval_uniq_z2 <- calcEpitopePValues(
        probe_pds = probe_pval_res_z,
        epitope_ids = epi_segments_uniq_z2_res,
        metap_method = "max",
        p_adjust_method = "none"
    )

Again, makeEpitopeCalls will be used in order to find significant regions.

    epi_calls_uniq_z2 <- makeEpitopeCalls(
        epi_ds = epi_pval_uniq_z2,
        padj_cutoff = p_cutoff
    )

Other segmentation methods can be used with the called regions through the binary score clustering methods.

    epi_segments_skater_z2_res <- findEpitopeSegments(
        probe_calls_z2,
        segment_method = "skater",
        segment_score_type = "binary",
        segment_dist_method = "hamming",
        segment_cutoff = "silhouette")

### Smoothing across probes

The pepStat paper (https://pubmed.ncbi.nlm.nih.gov/23770318/) mentions that smoothing can sometimes help reduce the high-variability of the peptide array data. HERON has implemented a running average smoothing algorithm across protein probes that can handle missing values. The function smoothProbeMat will take as input a probe matrix and will return a matrix that has been smoothed. The smoothed matrix can then be processed through the workflow using the calcProbePValuesProbeMat call instead of the calcProbePValuesSeqMat call since now the probe signal is no longer a direct copy from the sequence.

    probe_ds_qn <- convertSequenceDSToProbeDS(seq_ds_qn, probe_meta )

    smooth_ds <- smoothProbeDS(probe_ds_qn)

After you smoothed the data using the probes, the probe p-value will be calculated on the probe-level rather than the sequence-level.

    probe_sm_pval <- calcCombPValues(smooth_ds)

The probe calls can then be made as before.

    probe_sm_calls <- makeProbeCalls(probe_sm_pval)
    probe_sm_k_of_n <- getKofN(probe_sm_calls)
    knitr::kable(assay(probe_sm_calls,"calls")[1:3,1:3])

| Sample_39 | Sample_23 | Sample_56
--- | --- | --- | ---
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;1 | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;2 | FALSE | FALSE | FALSE
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;3 | FALSE | FALSE | FALSE

    knitr::kable(head(probe_sm_k_of_n[probe_sm_k_of_n$K > 0,]))

| K | F | P
--- | --- | --- | ---
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;1 | 1 | 0.025 | 2.5
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;2 | 1 | 0.025 | 2.5
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;57 | 1 | 0.025 | 2.5
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;58 | 1 | 0.025 | 2.5
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;59 | 1 | 0.025 | 2.5
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;60 | 2 | 0.050 | 5.0

### Calculate paired t-tests

Paired t-tests can be utilized and combined with the z-tests as well. Here is an example where we pair the five COVID- samples to the COVID+ samples and run calcProbePValuesSeqMat with the d_paired parameter set.

    data(heffron2021_wuhan)
    probe_meta <- attr(heffron2021_wuhan, "probe_meta")
    colData_paired <- colData(heffron2021_wuhan)

    ## Make some samples paired by setting the sample ids
    pre_idx <- which(colData_paired$visit == "pre")
    colData_post <- colData_paired[colData_paired$visit == "post",]
    new_ids <- colData_post$SampleName[seq_len(5)]
    colData_paired$ptid[pre_idx[seq_len(5)]] = new_ids

    paired_ds <- heffron2021_wuhan
    colData(paired_ds) <- colData_paired

    ## calculate p-values
    pval_res <- calcCombPValues(
        obj = paired_ds,
        d_paired = TRUE
    )

    knitr::kable(assay(pval_res[1:3,],"pvalue"))

| Sample_39 | Sample_23 | Sample_56 | Sample_53 | Sample_43
--- | --- | --- | --- | --- | ---
AAAYYVGYLQPRTFLL | 0.4192558 | 0.8596157 | 0.3643977 | 0.5703188 | 0.5695711
AADLDDFSKQLQQSMS | 0.0001467 | 0.0913935 | 0.0000501 | 0.7835355 | 0.0000709
AAEASKKPRQKRTATK | 0.0839504 | 0.2146309 | 0.0049659 | 0.2129732 | 0.1286111

### Use the wilcox test for probe-level p-values

To account for non-normality, HERON implements the two sample wilcox test in placed of the t-test used for the differential p-values. Below is an example of how to use it.

    seq_pval_res_w <- calcCombPValues(
        obj = seq_ds_qn,
        use = "w", d_abs_shift = 1
    )
    #> exact:
    probe_pval_res_w <- convertSequenceDSToProbeDS(seq_pval_res_w)
    knitr::kable(assay(probe_pval_res_w[1:3, 1:5], "padj"))

| Sample_39 | Sample_23 | Sample_56 | Sample_53 | Sample_43
--- | --- | --- | --- | --- | ---
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;1 | 1 | 1.00e+00 | 1.0000000 | 0.0332971 | 1
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;2 | 1 | 1.00e+00 | 1.0000000 | 0.0800597 | 1
NC_045512.2;YP_009724392.1;Wu1-SARS2_envelope;3 | 1 | 8.83e-05 | 0.0009847 | 1.0000000 | 1

### Use of the condition column

You can use the condition column in the colData dataframe. It is used in the getKofN function. The data type of the column can be either a character or factor. When the condition column exists in the colData, three columns (number of samples (K), frequency (F), and percent (P)) are provided for each unique factor/character value.

    col_data <- colData(heffron2021_wuhan)
    covid <- which(col_data$visit == "post")

    col_data$condition[covid[1:10]] <- "COVID2"

    seq_ds <- heffron2021_wuhan
    colData(seq_ds) <- col_data

    seq_ds_qn <- quantileNormalize(seq_ds)
    seq_pval_res <- calcCombPValues(seq_ds_qn)
    probe_pval_res <- convertSequenceDSToProbeDS(seq_pval_res)
    probe_calls_res <- makeProbeCalls(probe_pval_res)
    probe_calls_k_of_n <- getKofN(probe_calls_res)
    probe_calls_k_of_n <-
        probe_calls_k_of_n[
            order(probe_calls_k_of_n$K, decreasing = TRUE),]
    knitr::kable(head(probe_calls_k_of_n))

| K | F | P | K_COVID2 | F_COVID2 | P_COVID2 | K_COVID | F_COVID | P_COVID
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
NC_045512.2;YP_009724393.1;Wu1-SARS2_membrane;7 | 38 | 0.950 | 95.0 | 10 | 1.0 | 100 | 28 | 0.9333333 | 93.33333
NC_045512.2;YP_009724393.1;Wu1-SARS2_membrane;8 | 38 | 0.950 | 95.0 | 10 | 1.0 | 100 | 28 | 0.9333333 | 93.33333
NC_045512.2;YP_009724390.1;Wu1-SARS2_surface;554 | 37 | 0.925 | 92.5 | 9 | 0.9 | 90 | 28 | 0.9333333 | 93.33333
NC_045512.2;YP_009724393.1;Wu1-SARS2_membrane;5 | 36 | 0.900 | 90.0 | 10 | 1.0 | 100 | 26 | 0.8666667 | 86.66667
NC_045512.2;YP_009724393.1;Wu1-SARS2_membrane;6 | 36 | 0.900 | 90.0 | 9 | 0.9 | 90 | 27 | 0.9000000 | 90.00000
NC_045512.2;YP_009724397.2;Wu1-SARS2_nucleoca;394 | 36 | 0.900 | 90.0 | 9 | 0.9 | 90 | 27 | 0.9000000 | 90.00000

## Funding

HERON and its developers have been partially supported by funding from the Clinical and Translational Science Award (CTSA) program (ncats.nih.gov/ctsa), through the National Institutes of Health National Center for Advancing Translational Sciences (NCATS), grants UL1TR002373 and KL2TR002374, NIH National Institute of Allergy and Infectious Diseases, 2U19AI104317-06, NIH National Cancer Institute (P30CA14520, P50CA278595, and P01CA250972), startup funds through the University of Wisconsin Department of Obstetrics and Gynecology and the University of Wisconsin-Madison Office of the Chancellor and the Vice Chancellor for Research and Graduate Education with funding from the Wisconsin Alumni Research Foundation through the Data Science Initiative award.

## Acknowledgments

We have benefited in the development of HERON from the help and feedback of many individuals, including but not limited to:

The Bioconductor Core Team, Paul Sondel, Anna Hoefges, Amy Erbe Gurel, Jessica Vera, Rene Welch, Ken Lo (Nimble Therapeutics), Brad Garcia (Nimble Therapeutics), Jigar Patel (Nimble Therapeutics), John Tan, Nicholas Mathers, Richard Pinapatti.

## Session Info

    sessionInfo()
    #> R version 4.5.2 (2025-10-31)
    #> Platform: x86_64-pc-linux-gnu
    #> Running under: Ubuntu 24.04.4 LTS
    #>
    #> Matrix products: default
    #> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
    #> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0
    #>
    #> locale:
    #>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
    #>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C
    #>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
    #>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
    #>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
    #> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
    #>
    #> time zone: Etc/UTC
    #> tzcode source: system (glibc)
    #>
    #> attached base packages:
    #> [1] stats4    stats     graphics  grDevices utils     datasets  methods
    #> [8] base
    #>
    #> other attached packages:
    #>  [1] HERON_1.9.0                 SummarizedExperiment_1.41.1
    #>  [3] Biobase_2.71.0              GenomicRanges_1.63.1
    #>  [5] Seqinfo_1.1.0               IRanges_2.45.0
    #>  [7] S4Vectors_0.49.0            BiocGenerics_0.57.0
    #>  [9] generics_0.1.4              MatrixGenerics_1.23.0
    #> [11] matrixStats_1.5.0           rmarkdown_2.30
    #>
    #> loaded via a namespace (and not attached):
    #>  [1] xfun_0.56           bslib_0.10.0        lattice_0.22-9
    #>  [4] mathjaxr_2.0-0      numDeriv_2016.8-1.1 mutoss_0.1-14
    #>  [7] tools_4.5.2         Rdpack_2.6.6        spdep_1.4-2
    #> [10] sandwich_3.1-1      proxy_0.4-29        cluster_2.1.8.2
    #> [13] KernSmooth_2.23-26  Matrix_1.7-4        data.table_1.18.2.1
    #> [16] lifecycle_1.0.5     deldir_2.0-4        compiler_4.5.2
    #> [19] statmod_1.5.1       mnormt_2.1.2        codetools_0.2-20
    #> [22] class_7.3-23        htmltools_0.5.9     sys_3.4.3
    #> [25] buildtools_1.0.0    sass_0.4.10         yaml_2.3.12
    #> [28] jquerylib_0.1.4     MASS_7.3-65         classInt_0.4-11
    #> [31] metap_1.13          DelayedArray_0.37.0 cachem_1.1.0
    #> [34] limma_3.67.0        wk_0.9.5            boot_1.3-32
    #> [37] abind_1.4-8         multcomp_1.4-29     digest_0.6.39
    #> [40] mvtnorm_1.3-3       sf_1.0-24           TFisher_0.2.0
    #> [43] maketools_1.3.2     splines_4.5.2       fastmap_1.2.0
    #> [46] grid_4.5.2          cli_3.6.5           SparseArray_1.11.10
    #> [49] magrittr_2.0.4      qqconf_1.3.2        S4Arrays_1.11.1
    #> [52] survival_3.8-6      e1071_1.7-17        TH.data_1.1-5
    #> [55] sn_2.1.2            sp_2.2-1            plotrix_3.8-14
    #> [58] spData_2.3.4        XVector_0.51.0      multtest_2.67.0
    #> [61] zoo_1.8-15          evaluate_1.0.5      knitr_1.51
    #> [64] rbibutils_2.4.1     s2_1.1.9            rlang_1.1.7
    #> [67] Rcpp_1.1.1          DBI_1.2.3           jsonlite_2.0.0
    #> [70] R6_2.6.1            units_1.0-0