Skip to content

Commit

Permalink
Fix import and vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
philouail committed Jan 25, 2024
1 parent f8755ef commit c1f1fbe
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 25 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ Imports:
Spectra (>= 1.13.2),
progress,
multtest,
jsonlite
jsonlite,
MetaboCoreUtils
Suggests:
BiocStyle,
caTools,
Expand All @@ -76,7 +77,6 @@ Suggests:
MALDIquant,
pheatmap,
MsBackendMgf,
MetaboCoreUtils,
signal
Enhances:
Rgraphviz,
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,8 @@ export("PlainTextParam")
exportMethods("storeResults")

## filtering features things
importFrom("MetaboCoreUtils", "rowRsd", "rowDratio", "rowPercentMissing",
"rowBlank")
export("RsdFilter")
export("DratioFilter")
export("PercentMissingFilter")
Expand Down
2 changes: 0 additions & 2 deletions R/method-filterFeatures.R
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,6 @@ setMethod("filterFeatures",
#'
#' @importFrom MetaboCoreUtils rowPercentMissing
#'
#' @examples
#'
NULL

#' @noRd
Expand Down
16 changes: 0 additions & 16 deletions man/PercentMissingFilter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 18 additions & 5 deletions vignettes/xcms.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ properties of the mice analyzed (sex, age, litter mates etc).

# Further data processing and analysis

## Quality assessment and filtering of features
## Quality-based filtering of features

When dealing with metabolomics results, it is often necessary to filter
features based on certain criteria.
Expand Down Expand Up @@ -1167,20 +1167,33 @@ filtered_res <- filterFeatures(object = filtered_res,
```

The `PercentMissingFilter` allows to filter features based on the percentage of
missing values for each feature.
missing values for each feature. This function takes as an input the parameter
`f` which is supposed to be a vector of the length of the object with the
sample type for each samples. The function then compute the percentage of
missing values per sample groups and filters features based on this. Another
option, it so base this quality assessment and filtering only on QC sample.

Both examples are shown below:

```{r}
# Set up parameters for PercentMissingFilter
# Set up parameter `f` to filter per sample type
f <- sampleData(filtered_faakho)$sample_type
f[f == "QC"] <- NA
# Set up parameter `f` to filter only based on QC samples
f <- sampleData(filtered_faakho)$sample_type
f[f != "QC"] <- NA
missing_filter <- PercentMissingFilter(threshold = 30,
f = sampleData(filtered_faakho)$sample_type)
f = f)
# Apply the filter to faakho object
filtered_faakho <- filterFeatures(object = filtered_faakho,
filter = missing_filter)
# Apply the filter to res object
missing_filter <- PercentMissingFilter(threshold = 30,
f = filtered_res$sample_type)
f = f)
filtered_res <- filterFeatures(object = filtered_res,
filter = missing_filter)
```
Expand Down

0 comments on commit c1f1fbe

Please sign in to comment.