Skip to content

Commit

Permalink
Re-format code automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
lcolladotor committed Mar 27, 2024
1 parent 87234fc commit 2a82ae5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
11 changes: 7 additions & 4 deletions R/corner.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
#' corner(lis)
corner <- function(mat, n = 6) {
types <-
c("list",
c(
"list",
"DataFrame",
"data.frame",
"GRanges",
"matrix",
"tbl_df")
"tbl_df"
)
if (!(class(mat)[1] %in% types)) {
stop(
"The class of your object (",
Expand All @@ -35,8 +37,9 @@ corner <- function(mat, n = 6) {
}
if (class(mat)[1] == "list") {
# return corners of first n items of list
return(lapply(mat[seq_len(min(length(mat), n))], function(x)
x[seq_len(min(nrow(x), n)), seq_len(min(ncol(x), n))]))
return(lapply(mat[seq_len(min(length(mat), n))], function(x) {
x[seq_len(min(nrow(x), n)), seq_len(min(ncol(x), n))]
}))
} else {
return(mat[seq_len(min(nrow(mat), n)), seq_len(min(ncol(mat), n))])
}
Expand Down
5 changes: 3 additions & 2 deletions R/expression_cutoff.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@
#'
#' ## View the pdf with the following code
#' utils::browseURL("test_expression_cutoff.pdf")
expression_cutoff <- function(expr, max_cut = 1, seed = NULL, n.boot = 2000,
k = 2) {
expression_cutoff <- function(
expr, max_cut = 1, seed = NULL, n.boot = 2000,
k = 2) {
meanExpr <- rowMeans(expr)


Expand Down
9 changes: 5 additions & 4 deletions R/junctionCount.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
#' ## TODO (need some data)
#' ## See https://github.com/LieberInstitute/RNAseq-pipeline/blob/ab71dedb36bcc3dad57233e645fabd5deb96d446/sh/create_count_objects-human.R#L633-L643
#' ## for an example of how it's being using the the RNA-seq pipeline code
junctionCount <- function(junctionFiles, sampleNames = names(junctionFiles),
output = c("Count", "Rail"), minOverhang = 0,
strandSpecific = FALSE, illuminaStranded = FALSE,
minCount = 1, maxCores = 1, skipLines = ifelse(output == "Count", 0, 1)) {
junctionCount <- function(
junctionFiles, sampleNames = names(junctionFiles),
output = c("Count", "Rail"), minOverhang = 0,
strandSpecific = FALSE, illuminaStranded = FALSE,
minCount = 1, maxCores = 1, skipLines = ifelse(output == "Count", 0, 1)) {
stopifnot(length(junctionFiles) == length(sampleNames))
stopifnot(output %in% c("Count", "Rail"))

Expand Down
5 changes: 3 additions & 2 deletions R/lab_presenters.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
#' ## If it's a new sheet, we recommend sharing an editable link so other
#' ## lab members can swap out as necessary.
#' }
lab_presenters <- function(presenters, start_date = "2019-09-18",
sheet_name = "Jaffelab research presenters", n = 2, repeat_day = 7) {
lab_presenters <- function(
presenters, start_date = "2019-09-18",
sheet_name = "Jaffelab research presenters", n = 2, repeat_day = 7) {
## Check inputs
if (!is.character(presenters)) {
stop("'presenters' should be a character vector.", call. = FALSE)
Expand Down

0 comments on commit 2a82ae5

Please sign in to comment.