Skip to content

Commit 33b5fcb

Browse files
committed
preprocessing_scaffold(): using histPlot() to generate hist
1 parent 938636a commit 33b5fcb

2 files changed

Lines changed: 5 additions & 21 deletions

File tree

R/globals.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ utils::globalVariables(c(
1919
"R.Condition", # <preprocessing_scaffold>
2020
"R.Replicate", # <preprocessing_scaffold>
2121
"Quantity", # <preprocessing_scaffold>
22-
"value", # <preprocessing_scaffold>
2322
"R.Condition", # <visualize.dist>
2423
"R.Replicate", # <visualize.dist>
2524
"name", # <visualize.dist>

R/preprocessing.R

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -296,29 +296,14 @@ preprocessing_scaffold <- function(fileName, dataSet = NULL,
296296

297297
## reformat the data to present proteins as the columns and
298298
## to group replicates under each protein
299-
reformatedData <- selectedData %>%
299+
reformattedData <- selectedData %>%
300300
pivot_wider(id_cols = c(R.Condition, R.Replicate),
301301
names_from = AccessionNumber, values_from = Quantity)
302302
# spread(AccessionNumber, Quantity)
303303

304-
## generate a histogram of the log2-transformed values for full data set
305-
## note: the Scaffold is a preprocessed data report.
306-
temp <- reformatedData %>%
307-
select(-c("R.Condition", "R.Replicate")) %>%
308-
unlist() %>%
309-
as.vector() %>%
310-
log2()
311-
plot <- ggplot(data.frame(value = temp)) +
312-
geom_histogram(aes(x = value),
313-
breaks = seq(floor(min(temp, na.rm = TRUE)),
314-
ceiling(max(temp, na.rm = TRUE)), 1),
315-
color = "black", fill = "gray") +
316-
scale_x_continuous(breaks = seq(floor(min(temp, na.rm = TRUE)),
317-
ceiling(max(temp, na.rm = TRUE)), 2)) +
318-
labs(title = "Histogram of Full Data Set",
319-
x = expression("log"[2]*"(Data)"), y = "Frequency") +
320-
theme_bw() +
321-
theme(plot.title = element_text(hjust = 0.5))
304+
## histogram of full raw data
305+
## note: the Scaffold is a preprocessed data report
306+
plot <- histPlot(selectedData$Quantity, title = "Histogram of Data Set")
322307
print(plot)
323308

324309
## print summary statistics for full data set
@@ -327,7 +312,7 @@ preprocessing_scaffold <- function(fileName, dataSet = NULL,
327312
cat("\n")
328313

329314
## store data in a data.frame structure
330-
result <- as.data.frame(reformatedData)
315+
result <- as.data.frame(reformattedData)
331316

332317
## print levels of condition and replicate
333318
cat("Levels of Condition:", unique(result$R.Condition), "\n")

0 commit comments

Comments
 (0)