Import data from a DIA-NN quantification file into a SingleCellExperiment object. Note that DIA-NN support in einprot is currently experimental - please be aware that the interface may change, and interpret results with caution.

importDIANN(
  inFile,
  fileType = "pg_matrix",
  outLevel = "pg",
  includeOnlySamples = "",
  excludeSamples = "",
  stopIfEmpty = FALSE,
  aName = "PG.MaxLFQ",
  filtersDF = list(),
  ...
)

Arguments

inFile

Path to a tab-delimited input text file from DIA-NN; either *.parquet, pg_matrix.tsv, pr_matrix.tsv or report.tsv.

fileType

Character scalar indicating the type of input file; either "parquet", "pg_matrix", "pr_matrix" or "main_report".

outLevel

Character scalar indicating the desired output level; either "pg" (protein group) or "pr" (precursor).

includeOnlySamples, excludeSamples

Character vectors defining regular expressions to match against the extracted columns to retain or exclude samples.

stopIfEmpty

Logical scalar, whether to raise an error if no columns matching the patterns are found.

aName

Character scalar giving the name of the main assay (if fileType is "pg_matrix" or "pr_matrix"), or the column from which to get the values for the main assay (if fileType is "main_report" or "parquet").

filtersDF

Named list where each element is a filtering function that takes a data.frame (or tibble) as input and returns a filtered object of the same class. No other arguments are allowed. The filtering functions will be applied in the order they are provided in the list, after reading the long-format text file or parquet file, and before creating the wide-format assay. Only applies if fileType is "main_report" or "parquet".

...

Additional arguments that will be passed on to QFeatures::readSummarizedExperiment (e.g., the number of rows to import).

Value

A list with two elements: a SingleCellExperiment object and a character scalar with the main assay name.

Author

Charlotte Soneson

Examples

sceL <- importDIANN(system.file("extdata", "diann_example",
                                "PXD028735.pg_matrix.tsv",
                                package = "einprot"),
                    fileType = "pg_matrix", outLevel = "pg",
                    aName = "MaxLFQ")
sceL
#> $sce
#> class: SingleCellExperiment 
#> dim: 12261 6 
#> metadata(1): colList
#> assays(1): MaxLFQ
#> rownames(12261): 1 2 ... 12260 12261
#> rowData names(5): Protein.Group Protein.Ids Protein.Names Genes
#>   First.Protein.Description
#> colnames(6): LFQ_Orbitrap_AIF_Condition_A_Sample_Beta_01
#>   LFQ_Orbitrap_AIF_Condition_B_Sample_Alpha_01 ...
#>   LFQ_Orbitrap_AIF_Condition_B_Sample_Gamma_01
#>   LFQ_Orbitrap_AIF_Condition_A_Sample_Alpha_01
#> colData names(0):
#> reducedDimNames(0):
#> mainExpName: NULL
#> altExpNames(0):
#> 
#> $aName
#> [1] "MaxLFQ"
#>