Skip to content

Commit

Permalink
Fixed missing dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
msauria committed Jul 15, 2024
1 parent 221253e commit bc6b9a7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Imports:
dplyr,
ggplot2,
pals
gbm
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Expand Down
2 changes: 1 addition & 1 deletion R/classifierOF.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ classifierOF <- function(data, model = "gbm2x", thresh = 0.6){
dplyr::filter(classifier_ObjectFlag == "ERROR")
}
} else {
stop(glue::glue('Only the gbm2x classifer model is currently supported. Please set the argement model = "gbm2X"'))
stop(glue::glue('Only the gbm2x classifer model is currently supported. Please set the argument model = "gbm2X"'))
}
# retun it
return(classifier_df)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The processed image files should be formatted with the experiment data, name of
## Package Overview
The `easyXpress` package consists of six function classes that work together to clean and process experimental data. The `tidy` functions will help pre-process raw images to get them ready for submission to the `cellprofiler-nf` pipeline. The `ObjectFlag` or `OF` functions help to flag problematic data output from `cellprofiler-nf`. The `WellFlag` or `WF` functions work to flag anomalous summary statistics for micro-plate wells. Throughout the data cleaning workflow, the `check` and `view` function classes are used to validate whether the flag functions are properly applied. All other functions serve to facilitate the cleaning process and do not have a standardized naming convention.

For more detailed information regarding use of these functions, see the article: **Dose Response Processing**.
For more detailed information regarding use of these functions, see the article: [**Dose Response Processing**](https://andersenlab.org/easyXpress/articles/Dose_Response.html).

### Citation

Expand Down
24 changes: 12 additions & 12 deletions vignettes/articles/Dose_Response.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ The `edgeOF()` function will flag objects close to the edge of the well that are
The `clusterOF()` function will flag any objects that are found within the same primary object. These 'clusters' are often debris or improperly segmented worms.
```{r, fig.width = 10, fig.align = 'center'}
# Use the edgeOF fucntion
ef <- edgeOF(data = ms)
ef <- easyXpress::edgeOF(data = ms)
# Use the clusterOF function
cf <- clusterOF(data = ef)
cf <- easyXpress::clusterOF(data = ef)
```

### `checkOF`

Use the `checkOF()` function to see how the object flags look across the desired grouping variables, which are specified with `...`.
```{r, fig.width = 10, fig.align = 'center'}
c1 <- checkOF(data = cf, drug, concentration_um)
c1 <- easyXpress::checkOF(data = cf, drug, concentration_um)
# loop at the plot returned
c1$p
Expand All @@ -125,7 +125,7 @@ c1$p
Use the `checkObjs()` function to visualize the size distributions of the objects by grouping variables.
```{r, fig.width = 12, fig.height = 7, fig.align = 'center', warning=FALSE}
# Show just the noFlag data by setting OF = "filter"
c2 <- checkObjs(data = cf, OF = 'filter', drug, concentration_um)
c2 <- easyXpress::checkObjs(data = cf, OF = 'filter', drug, concentration_um)
# look at the plot returned
c2
Expand Down Expand Up @@ -154,7 +154,7 @@ cm <- cf %>%
w.lab = paste(drug, strain, concentration_um, sep = "_"))
# use the checkModels function
cm.out <- checkModels(data = cm,
cm.out <- easyXpress::checkModels(data = cm,
# the grouping vars (...), make a plot for each.
Metadata_Experiment, drug,
proc.img.dir = "i.dir",
Expand Down Expand Up @@ -188,7 +188,7 @@ u = cm %>%
uf <- easyXpress::userOF(data = u, user)
# Check the object data again to see if the bimodal distributions are resolved.
checkObjs(data = uf, OF = "filter", drug, concentration_um)
easyXpress::checkObjs(data = uf, OF = "filter", drug, concentration_um)
```
<br> The diagnostic plot made with the `checkObjs()` function above shows that the bimodal distribution in the higher concentrations of zinc are improved by adding the user object flag.

Expand All @@ -199,7 +199,7 @@ The `classiferOF()` function will flag objects that are likely debris or imprope
Any objects with `NA` for the data variables used by the classifier will be flagged in the output. These are rare, and often problematic to begin with. Check the function output to see how many objects are being flagged as `NA`.
```{r}
# apply the classifierOF function
cl <- classifierOF(data = uf)
cl <- easyXpress::classifierOF(data = uf)
```

### `outlierOF`
Expand All @@ -217,7 +217,7 @@ o <- easyXpress::outlierOF(data = cl)
Use the `checkObjs()` function again to check the effect of filtering all the object flags. Any strong multi-modal signals that remain in the data should be reviewed to ensure they are the result of biology rather than anomalous features of the well image.
```{r,fig.width = 12, fig.height = 7, fig.align = 'center', warning=FALSE}
# check objects again, notice how there are 5 ObjectFlags detected now.
checkObjs(data = o, OF = 'filter', drug, concentration_um)
easyXpress::checkObjs(data = o, OF = 'filter', drug, concentration_um)
```
<br> The plot above looks much better than it did for the raw data. For example, the bimodal distributions at the high concentrations of Zinc are largely removed.

Expand All @@ -226,7 +226,7 @@ checkObjs(data = o, OF = 'filter', drug, concentration_um)
Use the `checkOF` function again to see how much data is being flagged. If certain conditions in the experiment are heavily flagged it suggests that those data may not be worth keeping.
```{r, fig.width = 12, fig.height = 7, fig.align = 'center', warning=FALSE}
# check object flags again
co2 <- checkOF(data = o, drug, concentration_um)
co2 <- easyXpress::checkOF(data = o, drug, concentration_um)
# check the plot
co2$p
Expand Down Expand Up @@ -349,7 +349,7 @@ cw1$p
The `filterWF()` function will remove all the flagged wells from the data.
```{r}
# Use the filterWF function and drop the flagging variables afterward
fw <- filterWF(data = ow, rmVars = T)
fw <- easyXpress::filterWF(data = ow, rmVars = T)
```

### `checkBalance`
Expand All @@ -359,7 +359,7 @@ Use the `checkBalance()` function to see the fraction of data retained after the
The `checkBalance()` function returns a list with summary data for making the plot as `cb$d` and the plot itself as `cb$p`.
```{r, fig.width = 10, fig.height = 7, fig.align = 'center'}
# use the checkBalance function and add assay_bleach var to design
cb <- checkBalance(data = fw, drug, concentration_um,
cb <- easyXpress::checkBalance(data = fw, drug, concentration_um,
design = dr$design %>%
dplyr::mutate(assay_bleach =
paste(Metadata_Experiment, bleach)),
Expand Down Expand Up @@ -442,7 +442,7 @@ del <- easyXpress::delta(data = reg$d,
vars = "median_wormlength_um_reg")
# check the finalized data
checkEff(data = del, drug, strain, x = concentration_um,
easyXpress::checkEff(data = del, drug, strain, x = concentration_um,
y = median_wormlength_um_reg_delta,
fill = assay_bleach,
scales = "free_x")
Expand Down

0 comments on commit bc6b9a7

Please sign in to comment.