Skip to contents

This function is used to filter out features appear less than x percent of all samples, default is 20 percent.

Usage

QC_filter(x, metabolite_start_column = 3, minimum_sample_appear = 0.2)

Arguments

x

The metabolomics feature table

metabolite_start_column

The column number where the intensity columns start in the feature table (typically, it is 3)

minimum_sample_appear

The minimum percentage of samples that a feature should appear in to be kept in the dataset (default is 0.20), which means all features that appear in less than 20 percent of all samples will be removed.

Value

A filtered feature table with features that appear in more than x percent of all samples

Examples

data("feature_table_exp_hilicpos")
QC_filter(x = feature_table_exp_hilicpos, metabolite_start_column = 3, minimum_sample_appear = 0.20)
#> # A tibble: 10,919 × 44
#>       mz  time NM5_GS_0_1 NM5_GS_0_3 NM5_GS_0_5 TM5_GS_0_1 TM5_GS_0_3 TM5_GS_0_5
#>    <dbl> <dbl>      <dbl>      <dbl>      <dbl>      <dbl>      <dbl>      <dbl>
#>  1  85.0  49.4  127294848   93929747   66033558  159310776   99288246   82335881
#>  2  85.0  83.4    9282517   14636989   12921267    8682974   10271317    7132031
#>  3  85.1 109.    13329008   15703815    8642594    8449978    8644413    3355450
#>  4  85.2  30.8          0   26889920   32196356   25253361   47516277   54826651
#>  5  85.3  31.5          0    8566404   14599669    9787948   14132846   23874217
#>  6  85.4  30.2          0   13508765   16721105   61654938    9957638    3201424
#>  7  85.4  33.8   15066696          0          0   11540798   20251857   31230557
#>  8  85.6 156.     6775208    4078654          0    2803849     107620          0
#>  9  85.6  76.0          0          0          0    4678248    3290240    1366488
#> 10  85.8  82.2          0          0          0          0          0          0
#> # ℹ 10,909 more rows
#> # ℹ 36 more variables: NM11_GS_0_1 <dbl>, NM11_GS_0_3 <dbl>, NM11_GS_0_5 <dbl>,
#> #   TM11_GS_0_1 <dbl>, TM11_GS_0_3 <dbl>, TM11_GS_0_5 <dbl>, NM6_GS_0_1 <dbl>,
#> #   NM6_GS_0_3 <dbl>, NM6_GS_0_5 <dbl>, TM4_GS_0_1 <dbl>, TM4_GS_0_3 <dbl>,
#> #   TM4_GS_0_5 <dbl>, NM4_GS_0_1 <dbl>, NM4_GS_0_3 <dbl>, NM4_GS_0_5 <dbl>,
#> #   TM6_GS_0_1 <dbl>, TM6_GS_0_3 <dbl>, TM6_GS_0_5 <dbl>, NM7_GS_0_1 <dbl>,
#> #   NM7_GS_0_3 <dbl>, NM7_GS_0_5 <dbl>, NM9_GS_0_1 <dbl>, NM9_GS_0_3 <dbl>, …