This function imports features from a table, which can be either a data frame or a path to a file with tabular data (e.g. .csv).

importFeaturesTable(input, analysisInfo, addCols = NULL)

Arguments

input

The input to be imported: either a data.frame, data.table or file path to a file that can be imported with fread.

analysisInfo

A data.frame (or data.table) with Analysis information.

addCols

A character vector with additional columns that should be included in the imported features object. These columns are not used by patRoon and should not interfere with internally used columns (these will be ignored with a warning if they do).

Value

An object derived from the class featuresSet (if the imported features are from a sets workflow) or features object otherwise.

Details

This function imports data from a table. This function is called when calling importFeatures with type="table".

This function can be used to import features from a table generated by the as.data.table (and as.data.frame) function, or the output from any other feature detection software. The column format mostly follows the format used by the as.data.table function.

The following columns must be present:

  • analysis: the analysis name (corresponding the the analysis information).

  • ret: the retention time of the feature (in seconds).

  • mz: the m/z value of the feature.

  • intensity: the peak intensity of the feature.

The following columns are optional, but usually recommended:

  • ID: the feature ID. Should be unique across the features from the same analysis. If not present, a sequential ID is automatically generated.

  • area: the peak area of the feature. If not present, it is calculated as 2.5*intensity.

  • retmin and retmax: the minimum and maximum retention time range of the feature. If not present, they are derived by subtraction or addition of ret by defaultLim("retention", "narrow") (see limits).

  • mzmin and mzmax: the minimum and maximum m/z range of the feature. If not present, they are derived by subtraction or addition of mz by defaultLim("mz", "narrow") (see limits).

If a mobility column is present, it is assumed that the features are from an IMS workflow. In this case

  • mobility: specifies the mobility of the feature.

  • mobmin and mobmax: the minimum and maximum mobility range of the feature. If not present, they are derived by subtraction or addition of mobility by defaultLim("mobility", "narrow") (see limits). (optional)

  • mob_area and mob_intensity: the peak area and intensity of the peak in the mobilogram for the feature. (optional)

  • ims_precursor_ID: the ID of the IMS precursor in a post mobility assignment workflow. (optional)

  • mob_assign_method: a string that names the method used to assign the mobility to the feature. (optional)

If a set column is present, it is assumed that the features are from a sets workflow. In this case

  • set: specifies the set name in which the feature is present.

  • mz and ion_mz: specify the neutral mass and ionized m/z of the feature, respectively.

  • adduct: specifies the adduct of the feature (generic textual format), e.g. "[M+H]+".

Note

The "set" column in the analysis information is not used when importing data (this column is present when obtaining the analysis information from a sets object with analysisInfo).

See also

importFeatures for more details and other algorithms.

importFeatureGroupsTable to import feature group data from a table. as.data.table for converting features to a data.table format. findFeatures to generate feature data.