Skip to content

Commit

Permalink
CRAN feasibility (#139)
Browse files Browse the repository at this point in the history
* remove unknown global bindings, fix the package description and repair urls

* urls in <>

* dataset links fixes

---------

Co-authored-by: Fersoil <Fersoil>
  • Loading branch information
Fersoil authored Sep 20, 2024
1 parent 180ba93 commit 8083702
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
9 changes: 4 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Package: PvSTATEM
Type: Package
Title: Reading, quality control and preprocessing of MBA assay data
Description: The package speeds up the process of loading raw data from MBA
Title: Reading, Quality Control and Preprocessing of MBA Assay Data
Description: Speeds up the process of loading raw data from MBA
assays, performs quality control checks, and automatically normalizes the data,
preparing it for more advanced downstream tasks. The main objective of the
package is to create a simple environment for a user, who does not
necessarily have experience with R language. The package is developed
within the project of the same name - `PvSTATEM` - an international
project aiming for malaria elimination.
BugReports: https://github.com/mini-pw/PvSTATEM/issues
Version: 0.0.3
Version: 0.0.4
License: BSD_3_clause + file LICENSE
Encoding: UTF-8
Authors@R: c(
Expand Down Expand Up @@ -39,5 +39,4 @@ Suggests:
Config/testfhat/edition: 3
Roxygen: list(markdown = TRUE, r6 = TRUE)
VignetteBuilder: knitr
biocViews: DataImport, QualityControl, Preprocessing
URL: https://github.com/mini-pw/PvSTATEM
URL: <https://github.com/mini-pw/PvSTATEM>
19 changes: 10 additions & 9 deletions R/plots-mfi.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,24 @@ plot_mfi_for_analyte <- function(plate, analyte_name,

df <- plate$data[["Median"]] %>%
dplyr::select(analyte_name) %>%
dplyr::rename("MFI" = analyte_name) %>%
dplyr::mutate(
SampleId = paste0("SampleId: ", seq_len(nrow(.))),
dplyr::rename("MFI" = analyte_name)

df <- dplyr::mutate(df,
SampleId = paste0("SampleId: ", seq_len(nrow(df))),
SampleType = plate$sample_types,
)

blanks_df <- df %>% dplyr::filter(SampleType == "BLANK")
blanks_df <- df %>% dplyr::filter(.data$SampleType == "BLANK")
blank_mean <- mean(blanks_df$MFI)
sc_df <- df %>% dplyr::filter(SampleType == "STANDARD CURVE")
sc_df <- df %>% dplyr::filter(.data$SampleType == "STANDARD CURVE")
test_df <- df %>%
dplyr::filter(SampleType == "TEST") %>%
dplyr::filter(.data$SampleType == "TEST") %>%
dplyr::mutate(
outlier = ifelse(is_outlier(MFI), SampleId, as.character(NA))
outlier = ifelse(is_outlier(.data$MFI), .data$SampleId, as.character(NA))
)

p <- test_df %>%
ggplot2::ggplot(aes(x = SampleType, y = MFI)) +
ggplot2::ggplot(aes(x = .data$SampleType, y = .data$MFI)) +
main_geom(color = "blue") +
ggplot2::geom_hline(
aes(yintercept = blank_mean, linetype = "BLANK MEAN"),
Expand All @@ -74,7 +75,7 @@ plot_mfi_for_analyte <- function(plate, analyte_name,
is_out <- !is.na(test_df$outlier)
hjust[is_out] <- ifelse(seq_len(sum(is_out)) %% 2 == 0, -0.18, 1.18)

p <- p + ggrepel::geom_text_repel(aes(label = outlier), na.rm = TRUE, hjust = hjust, color = "grey", min.segment.length = 0.3)
p <- p + ggrepel::geom_text_repel(aes(label = .data$outlier), na.rm = TRUE, hjust = hjust, color = "grey", min.segment.length = 0.3)
}

p
Expand Down
2 changes: 1 addition & 1 deletion R/plots-plate.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ plot_plate <- function(colors, plot_numbers = FALSE, numbers = NULL, plot_title
well_positions$category <- factor(well_positions$color, levels = legend_mapping, labels = categories)

# Plot the plate with colored wells
p <- ggplot(well_positions, aes(x = x, y = y, fill = category)) +
p <- ggplot(well_positions, aes(x = .data$x, y = .data$y, fill = .data$category)) +
geom_tile(key_glyph = "point") +
annotation_custom(
rasterGrob(plate_img, width = unit(1, "npc"), height = unit(1, "npc")),
Expand Down
12 changes: 6 additions & 6 deletions R/plots-standard_curve.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plot_standard_curve_analyte <- function(plate,
analyte_name,
data_type = "Median",
decreasing_dilution_order = TRUE,
log_scale = c("dilutions"),
log_scale = c("all"),
plot_line = TRUE,
plot_blank_mean = TRUE,
plot_dilution_bounds = TRUE,
Expand Down Expand Up @@ -79,7 +79,7 @@ plot_standard_curve_analyte <- function(plate,
}

options(scipen = 30)
p <- ggplot2::ggplot(plot_data, aes(x = dilution_values, y = MFI)) +
p <- ggplot2::ggplot(plot_data, aes(x = .data$dilution_values, y = .data$MFI)) +
ggplot2::geom_point(aes(color = "Standard curve samples"), size = 3)
if (plot_line) {
p <- p + ggplot2::geom_line(aes(color = "Standard curve samples"), linewidth = 1.2)
Expand All @@ -92,10 +92,10 @@ plot_standard_curve_analyte <- function(plate,
}
if (plot_dilution_bounds) {
p <- p + ggplot2::geom_vline(
ggplot2::aes(color = "Min-max dilution bounds", xintercept = min(dilution_values)),
ggplot2::aes(color = "Min-max dilution bounds", xintercept = min(.data$dilution_values)),
linetype = "dashed"
) + ggplot2::geom_vline(
ggplot2::aes(color = "Min-max dilution bounds", xintercept = max(dilution_values)),
ggplot2::aes(color = "Min-max dilution bounds", xintercept = max(.data$dilution_values)),
linetype = "dashed"
)
}
Expand Down Expand Up @@ -179,12 +179,12 @@ plot_standard_curve_analyte_with_model <- function(plate,
test_sample_estimates <- predict(model, test_samples_mfi)

p <- p + ggplot2::geom_line(
ggplot2::aes(x = dilution, y = MFI, color = "Fitted model predictions"),
ggplot2::aes(x = .data$dilution, y = .data$MFI, color = "Fitted model predictions"),
data = model$get_plot_data(), linewidth = 1
)
if (plot_test_predictions) {
p <- p + ggplot2::geom_point(
ggplot2::aes(x = dilution, y = MFI, color = "Test sample predictions"),
ggplot2::aes(x = .data$dilution, y = .data$MFI, color = "Test sample predictions"),
data = test_sample_estimates, shape = 4,
size = 3
)
Expand Down
2 changes: 1 addition & 1 deletion man/plot_standard_curve_analyte.Rd

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

6 changes: 3 additions & 3 deletions vignettes/our_datasets.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ To check the package functionalities on the data from different sources, we gath

- `Chul_TotalIgG_2.csv` - GitHub repo RTSS_Kisumu_Schisto [source](https://github.com/IDEELResearch/RTSS_Kisumu_Schisto/tree/main/data/raw/luminex)

- `pone.0187901.s001.csv` - data shipped with drLumi package [source](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5685631/)
- `pone.0187901.s001.csv` - data shipped with drLumi package [source](https://doi.org/10.1371/journal.pone.0187901)

- `New_Batch_6_20160309_174224.csv` - dataset posted on ReaserchGate [source](https://www.researchgate.net/publication/309410897_Raw_data_generated_by_Luminex)
- `New_Batch_6_20160309_174224.csv` - dataset included in the paper *A single-nucleotide-polymorphism-based genotyping assay for simultaneous detection of different carbendazim-resistant genotypes in the Fusarium graminearum species complex*, H. Zhang et. al.

- `New_Batch_14_20140513_082522.csv` - dataset posted on ReaserchGate [source](https://www.researchgate.net/publication/309411021_The_second_run_of_raw_data_exported_from_Luminex_200_applied_forcarbendazim_resistance_species_and_chemotype_detection_of_156_Fusarium_isolates)
- `New_Batch_14_20140513_082522.csv` - dataset included in the paper *A single-nucleotide-polymorphism-based genotyping assay for simultaneous detection of different carbendazim-resistant genotypes in the Fusarium graminearum species complex*, H. Zhang et. al.

0 comments on commit 8083702

Please sign in to comment.