Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
travis-m-blimkie committed Jul 24, 2024
2 parents 1f0286e + cdb5712 commit 8b51e7e
Show file tree
Hide file tree
Showing 21 changed files with 309 additions and 144 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tRavis
Title: tRavis: an R package by Travis Blimkie
Version: 1.4.0
Version: 1.5.12
Authors@R: person("Travis", "Blimkie", email = "travis.m.blimkie@gmail.com", role = c("aut", "cre"))
Description: tRavis is a small R package meant to hold functions and data that
are used regularly in my day-to-day workflows. Its also provides an
Expand All @@ -22,7 +22,7 @@ Imports:
stringr,
tibble,
tidyr
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Suggests:
DESeq2,
here,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ importFrom(stringr,str_wrap)
importFrom(tibble,as_tibble)
importFrom(tibble,rownames_to_column)
importFrom(tidyr,pivot_longer)
importFrom(utils,read.delim)
8 changes: 4 additions & 4 deletions R/get_rounded_max.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
#' containing read or count numbers derived from MultiQC, and finds the
#' largest read or count value, then round it up to the nearest ten million.
#'
#' @details Input data frame must contain the columns "sample" and "n_reads".
#' @details Input data frame must contain the columns "Samples" and "n_reads".
#'
#' @references None.
#' @seealso <https://www.github.com/travis-m-blimkie/tRavis>
#'
get_rounded_max <- function(x, buffer = 1.1, nearest = 10e6) {
stopifnot(is.data.frame(x))
stopifnot(
"'x' must contain columns 'sample' and 'n_reads'." =
c("sample", "n_reads") %in% colnames(x)
"'x' must contain columns 'Samples' and 'n_reads'." =
c("Samples", "n_reads") %in% colnames(x)
)

max_value <- x %>%
group_by(sample) %>%
group_by(Samples) %>%
summarise(sum_n_reads = sum(n_reads)) %>%
pull(sum_n_reads) %>%
max()
Expand Down
9 changes: 8 additions & 1 deletion R/globals.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ utils::globalVariables(c(
"ambiguous",
"assigned",
"duplicate",
"duplicate_reads",
"end",
"gene_name",
"is",
"locus_tag",
"log2FoldChange",
"mapped_to_multiple_loci",
"mapped_to_too_many_loci",
"multimapped",
"multimapped_toomany",
"n_reads",
Expand All @@ -24,7 +27,9 @@ utils::globalVariables(c(
"qc",
"read_type",
"Read type",
"sample",
"Sample",
"Samples",
"start",
"strand",
"sum_n_reads",
Expand All @@ -33,7 +38,9 @@ utils::globalVariables(c(
"total_deduplicated_percentage",
"total_reads",
"total_sequences",
"unique_reads",
"uniquely_mapped",
"unmapped_other",
"unmapped_tooshort"
"unmapped_tooshort",
"unmapped_too_short"
))
2 changes: 1 addition & 1 deletion R/tr_compare_lists.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @param x First vector to compare.
#' @param y Second vector to compare.
#' @param names Optional character vector, containing names of `x` and `y` to
#' apply to the output.
#' apply to the output. Defaults to NULL for no names.
#'
#' @return A named list of the common and unique elements of x and y.
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/tr_get_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' formatted akin to "YYYYMMDD", i.e. all numeric with no spaces, dashes, etc.
#' Defaults to FALSE.
#' @param remove_string Optional string which can be removed from file names
#' when creating names for the output list
#' when creating names for the output list. Defaults to NULL for no changes.
#'
#' @return Named list of files
#' @export
Expand Down
Loading

0 comments on commit 8b51e7e

Please sign in to comment.