Summarize and collapse multiple mutational scanning experiments
summarizeExperiment.Rd
Combine multiple sequence lists (as returned by digestFastqs
into a SummarizedExperiment
, with
observed variable sequences (sequence pairs) in rows and samples in columns.
Arguments
- x
A named list of objects returned by
digestFastqs
. Names are used to link the objects to the metadata provided incoldata
.- coldata
A
data.frame
with at least one column "Name", which will be used to link to objects inx
. A potentially subset and reordered version ofcoldata
is stored in thecolData
of the returnedSummarizedExperiment
.- countType
Either "reads" or "umis". If "reads", the "count" assay of the returned object will contain the observed number of reads for each sequence (pair). If "umis", the "count" assay will contain the number of unique UMIs observed for each sequence (pair).
Value
A SummarizedExperiment
x
with
- assays(x)$counts
containing the observed number of sequences or sequence pairs (if
countType
= "reads"), or the observed number of unique UMIs for each sequence or sequence pair (ifcountType
= "umis").- rowData(x)
containing the unique sequences or sequence pairs.
- colData(x)
containing the metadata provided by
coldata
.
Examples
## Input sample
inp <- digestFastqs(
fastqForward = system.file("extdata", "cisInput_1.fastq.gz",
package = "mutscan"),
elementsForward = "SUCV", elementLengthsForward = c(1, 10, 18, 96),
constantForward = "AACCGGAGGAGGGAGCTG",
wildTypeForward = c(FOS = paste0("ACTGATACACTCCAAGCGGAGACAGACCAACTAGAAGATGAGAAGTC",
"TGCTTTGCAGACCGAGATTGCCAACCTGCTGAAGGAGAAGGAAAAACTA")),
nbrMutatedCodonsMaxForward = 1
)
## Output sample
outp <- digestFastqs(
fastqForward = system.file("extdata", "cisOutput_1.fastq.gz",
package = "mutscan"),
elementsForward = "SUCV", elementLengthsForward = c(1, 10, 18, 96),
constantForward = "AACCGGAGGAGGGAGCTG",
wildTypeForward = c(FOS = paste0("ACTGATACACTCCAAGCGGAGACAGACCAACTAGAAGATGAGAAGTC",
"TGCTTTGCAGACCGAGATTGCCAACCTGCTGAAGGAGAAGGAAAAACTA")),
nbrMutatedCodonsMaxForward = 1
)
## Combine
se <- summarizeExperiment(
x = list(r1inp = inp, r1outp = outp),
coldata = data.frame(Name = c("r1inp", "r1outp"),
Condition = c("input", "output"),
Replicate = c("rep1", "rep1")),
countType = "umis"
)
se
#> class: SummarizedExperiment
#> dim: 134 2
#> metadata(4): parameters errorStatistics countType mutNameDelimiter
#> assays(1): counts
#> rownames(134): FOS.0.WT FOS.1.AAT ... FOS.9.GAA FOS.9.GAG
#> rowData names(19): mutantName sequence ... mutationTypes varLengths
#> colnames(2): r1inp r1outp
#> colData names(19): Name Condition ... f13_nbrTooManyBestConstantHits
#> nbrRetained