assignValuePerSubject {psichomics} | R Documentation

## Assign average sample values to their corresponding subjects

### Description

Assign average sample values to their corresponding subjects

### Usage

    assignValuePerSubject(
      data,
      match,
      clinical = NULL,
      patients = NULL,
      samples = NULL
    )

### Arguments

`data` | One-row data frame/matrix or vector: values per sample for a single gene
`match` | Matrix: match between samples and subjects
`clinical` | Data frame or matrix: clinical dataset (only required if the `subjects` argument is not handed)
`patients` | Character: subject identifiers (only required if the `clinical` argument is not handed)
`samples` | Character: samples to use when assigning values per subject (if `NULL`, all samples will be used)

### Value

Values per subject

### See Also

Other functions to analyse survival: `getAttributesTime()`, `labelBasedOnCutoff()`, `optimalSurvivalCutoff()`, `plotSurvivalCurves()`, `plotSurvivalPvaluesByCutoff()`, `processSurvTerms()`, `survdiffTerms()`, `survfit.survTerms()`, `testSurvival()`

### Examples

    # Calculate PSI for skipped exon (SE) and mutually exclusive (MXE) events
    annot <- readFile("ex_splicing_annotation.RDS")
    junctionQuant <- readFile("ex_junctionQuant.RDS")

    psi <- quantifySplicing(annot, junctionQuant, eventType=c("SE", "MXE"))

    # Match between subjects and samples
    match <- rep(paste("Subject", 1:3), 2)
    names(match) <- colnames(psi)

    # Assign PSI values to each subject based on the PSI of their samples
    assignValuePerSubject(psi[3, ], match)

[Package psichomics version 1.20.2 Index]