Skip to content

Commit

Permalink
address warnings in R CMD check for r-devel
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanf committed Jun 14, 2020
1 parent a08308e commit 7ee55ea
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 26 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -18,6 +18,7 @@ bioc_packages:
- Biostrings
- ShortRead
- odseq
- dada2
after_success:
- R CMD INSTALL $PKG_TARBALL
- Rscript -e 'lintr::lint_package()'
Expand Down
28 changes: 15 additions & 13 deletions R/tzara.R
Expand Up @@ -61,9 +61,10 @@ flog_toc <- function(
#' "\code{map}" (\code{integer}), giving the mapping from the
#' "\code{idx}"th sequence in "\code{file}" to a sequence in
#' "\code{fasta}"}
#' \item{\code{$fasta} (\code{\link[Biostrings]{DNAStringSet}})}{all unique
#' sequences; the name of each sequence is an \code{integer} which
#' matches a value in \code{map$newmap}}
#' \item{\code{$fasta} (
#' \code{\link[Biostrings:XStringSet-class]{DNAStringSet-class}})}{all
#' unique sequences; the name of each sequence is an \code{integer}
#' which matches a value in \code{map$newmap}}
#' }
#' @export
combine_derep <- function(dereps, .data = NULL, ...) {
Expand Down Expand Up @@ -292,8 +293,8 @@ dadamap.list <- function(derep, dada, filename = names(derep), seq_id = NULL,

#' Individually hash biological sequences
#'
#' @param seq (\code{character} or \code{\link[Biostrings]{XStringSet}}) the
#' sequences to hash.
#' @param seq (\code{character} or \code{\link[Biostrings]{XStringSet-class}})
#' the sequences to hash.
#' @param algo (\code{character}) a hash algorithm supported by
#' \code{\link[digest]{digest}}. default: "xxhash32"
#' @param len (\code{integer}) number of characters to keep from each hash
Expand Down Expand Up @@ -469,7 +470,8 @@ has_alphabet <- function(seq, alphabet) {
#' but which has been clustered based on sequence variant identity in one
#' subregion.
#'
#' @param seq (\code{character} vector or \code{\link[Biostrings]{XStringSet}})
#' @param seq (\code{character} vector or
#' \code{\link[Biostrings]{XStringSet-class}})
#' The sequences to calculate a consensus for.
#' @param nread (\code{integer} vector) For the purposes of calculating the
#' consensus, consider each read to occur \code{nread} times. Supplying
Expand All @@ -485,9 +487,9 @@ has_alphabet <- function(seq, alphabet) {
#' representing the consensus sequence for reads which were included in
#' the consensus, or \code{NA_character_} for reads which were initially
#' \code{NA} or which were removed from the consensus alignment as
#' outliers. For the \code{\link[Biostrings]{XStringSet}} method, which
#' does not allow \code{NA} entries, these elements are missing from the
#' set (this can be deduced by the names).
#' outliers. For the \code{\link[Biostrings]{XStringSet-class}} method,
#' which does not allow \code{NA} entries, these elements are missing from
#' the set (this can be deduced by the names).
#' @param ... passed to methods
#'
#' @details The sequences are first aligned using
Expand All @@ -504,8 +506,8 @@ has_alphabet <- function(seq, alphabet) {
#' ambiguous base representing at least 50\% of the reads at that position is
#' chosen for nucleotide sequences, or \code{"X"} for amino acids.
#'
#' @return an \code{\link[Biostrings]{XStringSet}} representing the consensus
#' sequence.
#' @return an \code{\link[Biostrings]{XStringSet-class}} representing the
#' consensus sequence.
#'
#' @export

Expand Down Expand Up @@ -641,8 +643,8 @@ cluster_consensus.XStringSet <-
#' @param ... Passed to methods.
#'
#' @return (\code{object} of the same class as \code{seq}, or if \code{seq}
#' is a filename, \code{\link[Biostrings]{XStringSet}} if \code{format
#' = "fasta"}, \code{\link[Biostrings]{QualityScaledXStringSet}} if
#' is a filename, \code{\link[Biostrings]{XStringSet-class}} if \code{format
#' = "fasta"}, \code{\link[Biostrings]{QualityScaledXStringSet-class}} if
#' \code{format = "fastq"}) The requested region from each of the input
#' sequences where it was found.
#' @export
Expand Down
13 changes: 7 additions & 6 deletions man/cluster_consensus.Rd

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

7 changes: 4 additions & 3 deletions man/combine_derep.Rd

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

4 changes: 2 additions & 2 deletions man/extract_region.Rd

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

4 changes: 2 additions & 2 deletions man/seqhash.Rd

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

6 comments on commit 7ee55ea

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/odseq.R:4:54: style: Variable and function name style should be snake_case.

function(msa_object, distance_metric = "linear", B = 100,
                                                     ^

R/odseq.R:5:47: style: There should be a space between right parenthesis and an opening curly brace.

threshold = 0.025, weights = NULL){
                                              ^~

R/odseq.R:9:9: style: Variable and function name style should be snake_case.

is.gap <- function(char){
        ^~~~~~

R/odseq.R:9:32: style: There should be a space between right parenthesis and an opening curly brace.

is.gap <- function(char){
                               ^~

R/odseq.R:18:35: style: There should be a space between right parenthesis and an opening curly brace.

vector.gap <- function(seq){
                                  ^~

R/odseq.R:22:44: style: There should be a space between right parenthesis and an opening curly brace.

linear_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:26:58: style: There should be a space between right parenthesis and an opening curly brace.

linear_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:27:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                             ^~

R/odseq.R:27:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                              ^

R/odseq.R:30:44: style: There should be a space between right parenthesis and an opening curly brace.

affine_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:37:19: style: Use <-, not =, for assignment.

case1 = (seq1_left != seq2_left) & (seq1_right == seq2_right)
                  ^

R/odseq.R:38:19: style: Use <-, not =, for assignment.

case2 = (seq1_left != seq2_left) & (seq1_right != seq2_right)
                  ^

R/odseq.R:40:18: style: Put spaces around all infix operators.

​            sum(3*case1 + case2)
                ~^~

R/odseq.R:43:58: style: There should be a space between right parenthesis and an opening curly brace.

affine_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:44:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                             ^~

R/odseq.R:44:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                              ^

R/odseq.R:50:31: style: Put spaces around all infix operators.

weights <- weights/sum(weights)
                             ~^~

R/odseq.R:52:22: style: Put spaces around all infix operators.

​                sum(x*weights)
                    ~^~

R/odseq.R:61:23: style: There should be a space between right parenthesis and an opening curly brace.

function(x){strsplit(as.character(x), "")}
                      ^~

R/odseq.R:61:24: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x){strsplit(as.character(x), "")}
                       ^

R/odseq.R:61:54: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x){strsplit(as.character(x), "")}
                                                     ^

R/odseq.R:71:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {linear_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:71:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {linear_score_vec(x, gap_sequences)}
                                                               ^

R/odseq.R:76:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {affine_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:76:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {affine_score_vec(x, gap_sequences)}
                                                               ^

R/tzara.R:556:1: style: Lines should not be more than 80 characters.

assertthat::assert_that(length(nread) == 1 | length(nread) == length(seq))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:699:1: style: Variable and function names should not be longer than 30 characters.

extract_region.QualityScaledXStringSet <- function(seq, positions, region,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:700:1: style: Lines should not be more than 80 characters.

region2 = region, outfile = NULL,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:701:1: style: Lines should not be more than 80 characters.

append = FALSE, format = "fastq", ...) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1421:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1465:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1616:1: style: Lines should not be more than 80 characters.

cols = c(tidyselect::ends_with("_start"), tidyselect::ends_with("_end")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/util.R:64:1: style: Variable and function name style should be snake_case.

sreadq_to_qsDNAss <- function(from) {
^~~~~~~~~~~~~~~~~

R/util.R:71:8: style: Use <-, not =, for assignment.

to = Biostrings::QualityScaledDNAStringSet(
       ^

R/util.R:97:1: style: Variable and function name style should be snake_case.

qsDNAss_to_sreadq <- function(from) {
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:10:1: style: Variable and function name style should be snake_case.

test_ShortRead <- methods::as(test_seq, "ShortRead")
^~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:11:1: style: Variable and function name style should be snake_case.

test_DNAStringSet <- Biostrings::DNAStringSet(test_seq)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:12:1: style: Variable and function name style should be snake_case.

test_RNAStringSet <- Biostrings::RNAStringSet(test_DNAStringSet)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:19:1: style: Variable and function name style should be snake_case.

test_QualityScaledDNAStringSet <- Biostrings::QualityScaledDNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:23:1: style: Variable and function name style should be snake_case.

test_QualityScaledRNAStringSet <- Biostrings::QualityScaledRNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:27:1: style: Variable and function name style should be snake_case.

test_ShortReadQ <- methods::as(test_QualityScaledDNAStringSet, "ShortReadQ")
^~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:29:1: style: Lines should not be more than 80 characters.

Biostrings::writeQualityScaledXStringSet(test_QualityScaledDNAStringSet, test_fastq)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-sread.R:3:1: style: Variable and function name style should be snake_case.

test_DNAss <- Biostrings::readDNAStringSet(test_file)
^~~~~~~~~~

tests/testthat/test-sread.R:7:1: style: Variable and function name style should be snake_case.

sread_DNAss <- methods::as(test_DNAss, "ShortRead")
^~~~~~~~~~~

tests/testthat/test-sread.R:8:1: style: Lines should not be more than 80 characters.

​test_that("loading fasta by Biostrings and ShortRead yield same result from as_sread", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/odseq.R:4:54: style: Variable and function name style should be snake_case.

function(msa_object, distance_metric = "linear", B = 100,
                                                     ^

R/odseq.R:5:47: style: There should be a space between right parenthesis and an opening curly brace.

threshold = 0.025, weights = NULL){
                                              ^~

R/odseq.R:9:9: style: Variable and function name style should be snake_case.

is.gap <- function(char){
        ^~~~~~

R/odseq.R:9:32: style: There should be a space between right parenthesis and an opening curly brace.

is.gap <- function(char){
                               ^~

R/odseq.R:18:35: style: There should be a space between right parenthesis and an opening curly brace.

vector.gap <- function(seq){
                                  ^~

R/odseq.R:22:44: style: There should be a space between right parenthesis and an opening curly brace.

linear_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:26:58: style: There should be a space between right parenthesis and an opening curly brace.

linear_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:27:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                             ^~

R/odseq.R:27:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                              ^

R/odseq.R:30:44: style: There should be a space between right parenthesis and an opening curly brace.

affine_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:37:19: style: Use <-, not =, for assignment.

case1 = (seq1_left != seq2_left) & (seq1_right == seq2_right)
                  ^

R/odseq.R:38:19: style: Use <-, not =, for assignment.

case2 = (seq1_left != seq2_left) & (seq1_right != seq2_right)
                  ^

R/odseq.R:40:18: style: Put spaces around all infix operators.

​            sum(3*case1 + case2)
                ~^~

R/odseq.R:43:58: style: There should be a space between right parenthesis and an opening curly brace.

affine_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:44:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                             ^~

R/odseq.R:44:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                              ^

R/odseq.R:50:31: style: Put spaces around all infix operators.

weights <- weights/sum(weights)
                             ~^~

R/odseq.R:52:22: style: Put spaces around all infix operators.

​                sum(x*weights)
                    ~^~

R/odseq.R:61:23: style: There should be a space between right parenthesis and an opening curly brace.

function(x){strsplit(as.character(x), "")}
                      ^~

R/odseq.R:61:24: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x){strsplit(as.character(x), "")}
                       ^

R/odseq.R:61:54: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x){strsplit(as.character(x), "")}
                                                     ^

R/odseq.R:71:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {linear_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:71:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {linear_score_vec(x, gap_sequences)}
                                                               ^

R/odseq.R:76:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {affine_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:76:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {affine_score_vec(x, gap_sequences)}
                                                               ^

R/tzara.R:556:1: style: Lines should not be more than 80 characters.

assertthat::assert_that(length(nread) == 1 | length(nread) == length(seq))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:699:1: style: Variable and function names should not be longer than 30 characters.

extract_region.QualityScaledXStringSet <- function(seq, positions, region,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:700:1: style: Lines should not be more than 80 characters.

region2 = region, outfile = NULL,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:701:1: style: Lines should not be more than 80 characters.

append = FALSE, format = "fastq", ...) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1421:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1465:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1616:1: style: Lines should not be more than 80 characters.

cols = c(tidyselect::ends_with("_start"), tidyselect::ends_with("_end")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/util.R:64:1: style: Variable and function name style should be snake_case.

sreadq_to_qsDNAss <- function(from) {
^~~~~~~~~~~~~~~~~

R/util.R:71:8: style: Use <-, not =, for assignment.

to = Biostrings::QualityScaledDNAStringSet(
       ^

R/util.R:97:1: style: Variable and function name style should be snake_case.

qsDNAss_to_sreadq <- function(from) {
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:10:1: style: Variable and function name style should be snake_case.

test_ShortRead <- methods::as(test_seq, "ShortRead")
^~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:11:1: style: Variable and function name style should be snake_case.

test_DNAStringSet <- Biostrings::DNAStringSet(test_seq)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:12:1: style: Variable and function name style should be snake_case.

test_RNAStringSet <- Biostrings::RNAStringSet(test_DNAStringSet)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:19:1: style: Variable and function name style should be snake_case.

test_QualityScaledDNAStringSet <- Biostrings::QualityScaledDNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:23:1: style: Variable and function name style should be snake_case.

test_QualityScaledRNAStringSet <- Biostrings::QualityScaledRNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:27:1: style: Variable and function name style should be snake_case.

test_ShortReadQ <- methods::as(test_QualityScaledDNAStringSet, "ShortReadQ")
^~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:29:1: style: Lines should not be more than 80 characters.

Biostrings::writeQualityScaledXStringSet(test_QualityScaledDNAStringSet, test_fastq)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-sread.R:3:1: style: Variable and function name style should be snake_case.

test_DNAss <- Biostrings::readDNAStringSet(test_file)
^~~~~~~~~~

tests/testthat/test-sread.R:7:1: style: Variable and function name style should be snake_case.

sread_DNAss <- methods::as(test_DNAss, "ShortRead")
^~~~~~~~~~~

tests/testthat/test-sread.R:8:1: style: Lines should not be more than 80 characters.

​test_that("loading fasta by Biostrings and ShortRead yield same result from as_sread", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/odseq.R:4:54: style: Variable and function name style should be snake_case.

function(msa_object, distance_metric = "linear", B = 100,
                                                     ^

R/odseq.R:5:47: style: There should be a space between right parenthesis and an opening curly brace.

threshold = 0.025, weights = NULL){
                                              ^~

R/odseq.R:9:9: style: Variable and function name style should be snake_case.

is.gap <- function(char){
        ^~~~~~

R/odseq.R:9:32: style: There should be a space between right parenthesis and an opening curly brace.

is.gap <- function(char){
                               ^~

R/odseq.R:18:35: style: There should be a space between right parenthesis and an opening curly brace.

vector.gap <- function(seq){
                                  ^~

R/odseq.R:22:44: style: There should be a space between right parenthesis and an opening curly brace.

linear_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:26:58: style: There should be a space between right parenthesis and an opening curly brace.

linear_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:27:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                             ^~

R/odseq.R:27:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                              ^

R/odseq.R:30:44: style: There should be a space between right parenthesis and an opening curly brace.

affine_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:37:19: style: Use <-, not =, for assignment.

case1 = (seq1_left != seq2_left) & (seq1_right == seq2_right)
                  ^

R/odseq.R:38:19: style: Use <-, not =, for assignment.

case2 = (seq1_left != seq2_left) & (seq1_right != seq2_right)
                  ^

R/odseq.R:40:18: style: Put spaces around all infix operators.

​            sum(3*case1 + case2)
                ~^~

R/odseq.R:43:58: style: There should be a space between right parenthesis and an opening curly brace.

affine_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:44:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                             ^~

R/odseq.R:44:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                              ^

R/odseq.R:50:31: style: Put spaces around all infix operators.

weights <- weights/sum(weights)
                             ~^~

R/odseq.R:52:22: style: Put spaces around all infix operators.

​                sum(x*weights)
                    ~^~

R/odseq.R:61:23: style: There should be a space between right parenthesis and an opening curly brace.

function(x){strsplit(as.character(x), "")}
                      ^~

R/odseq.R:61:24: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x){strsplit(as.character(x), "")}
                       ^

R/odseq.R:61:54: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x){strsplit(as.character(x), "")}
                                                     ^

R/odseq.R:71:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {linear_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:71:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {linear_score_vec(x, gap_sequences)}
                                                               ^

R/odseq.R:76:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {affine_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:76:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {affine_score_vec(x, gap_sequences)}
                                                               ^

R/tzara.R:556:1: style: Lines should not be more than 80 characters.

assertthat::assert_that(length(nread) == 1 | length(nread) == length(seq))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:699:1: style: Variable and function names should not be longer than 30 characters.

extract_region.QualityScaledXStringSet <- function(seq, positions, region,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:700:1: style: Lines should not be more than 80 characters.

region2 = region, outfile = NULL,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:701:1: style: Lines should not be more than 80 characters.

append = FALSE, format = "fastq", ...) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1421:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1465:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1616:1: style: Lines should not be more than 80 characters.

cols = c(tidyselect::ends_with("_start"), tidyselect::ends_with("_end")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/util.R:64:1: style: Variable and function name style should be snake_case.

sreadq_to_qsDNAss <- function(from) {
^~~~~~~~~~~~~~~~~

R/util.R:71:8: style: Use <-, not =, for assignment.

to = Biostrings::QualityScaledDNAStringSet(
       ^

R/util.R:97:1: style: Variable and function name style should be snake_case.

qsDNAss_to_sreadq <- function(from) {
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:10:1: style: Variable and function name style should be snake_case.

test_ShortRead <- methods::as(test_seq, "ShortRead")
^~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:11:1: style: Variable and function name style should be snake_case.

test_DNAStringSet <- Biostrings::DNAStringSet(test_seq)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:12:1: style: Variable and function name style should be snake_case.

test_RNAStringSet <- Biostrings::RNAStringSet(test_DNAStringSet)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:19:1: style: Variable and function name style should be snake_case.

test_QualityScaledDNAStringSet <- Biostrings::QualityScaledDNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:23:1: style: Variable and function name style should be snake_case.

test_QualityScaledRNAStringSet <- Biostrings::QualityScaledRNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:27:1: style: Variable and function name style should be snake_case.

test_ShortReadQ <- methods::as(test_QualityScaledDNAStringSet, "ShortReadQ")
^~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:29:1: style: Lines should not be more than 80 characters.

Biostrings::writeQualityScaledXStringSet(test_QualityScaledDNAStringSet, test_fastq)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-sread.R:3:1: style: Variable and function name style should be snake_case.

test_DNAss <- Biostrings::readDNAStringSet(test_file)
^~~~~~~~~~

tests/testthat/test-sread.R:7:1: style: Variable and function name style should be snake_case.

sread_DNAss <- methods::as(test_DNAss, "ShortRead")
^~~~~~~~~~~

tests/testthat/test-sread.R:8:1: style: Lines should not be more than 80 characters.

​test_that("loading fasta by Biostrings and ShortRead yield same result from as_sread", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/odseq.R:4:54: style: Variable and function name style should be snake_case.

function(msa_object, distance_metric = "linear", B = 100,
                                                     ^

R/odseq.R:5:47: style: There should be a space between right parenthesis and an opening curly brace.

threshold = 0.025, weights = NULL){
                                              ^~

R/odseq.R:9:9: style: Variable and function name style should be snake_case.

is.gap <- function(char){
        ^~~~~~

R/odseq.R:9:32: style: There should be a space between right parenthesis and an opening curly brace.

is.gap <- function(char){
                               ^~

R/odseq.R:18:35: style: There should be a space between right parenthesis and an opening curly brace.

vector.gap <- function(seq){
                                  ^~

R/odseq.R:22:44: style: There should be a space between right parenthesis and an opening curly brace.

linear_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:26:58: style: There should be a space between right parenthesis and an opening curly brace.

linear_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:27:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                             ^~

R/odseq.R:27:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                              ^

R/odseq.R:30:44: style: There should be a space between right parenthesis and an opening curly brace.

affine_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:37:19: style: Use <-, not =, for assignment.

case1 = (seq1_left != seq2_left) & (seq1_right == seq2_right)
                  ^

R/odseq.R:38:19: style: Use <-, not =, for assignment.

case2 = (seq1_left != seq2_left) & (seq1_right != seq2_right)
                  ^

R/odseq.R:40:18: style: Put spaces around all infix operators.

​            sum(3*case1 + case2)
                ~^~

R/odseq.R:43:58: style: There should be a space between right parenthesis and an opening curly brace.

affine_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:44:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                             ^~

R/odseq.R:44:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                              ^

R/odseq.R:50:31: style: Put spaces around all infix operators.

weights <- weights/sum(weights)
                             ~^~

R/odseq.R:52:22: style: Put spaces around all infix operators.

​                sum(x*weights)
                    ~^~

R/odseq.R:61:23: style: There should be a space between right parenthesis and an opening curly brace.

function(x){strsplit(as.character(x), "")}
                      ^~

R/odseq.R:61:24: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x){strsplit(as.character(x), "")}
                       ^

R/odseq.R:61:54: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x){strsplit(as.character(x), "")}
                                                     ^

R/odseq.R:71:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {linear_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:71:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {linear_score_vec(x, gap_sequences)}
                                                               ^

R/odseq.R:76:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {affine_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:76:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {affine_score_vec(x, gap_sequences)}
                                                               ^

R/tzara.R:556:1: style: Lines should not be more than 80 characters.

assertthat::assert_that(length(nread) == 1 | length(nread) == length(seq))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:699:1: style: Variable and function names should not be longer than 30 characters.

extract_region.QualityScaledXStringSet <- function(seq, positions, region,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:700:1: style: Lines should not be more than 80 characters.

region2 = region, outfile = NULL,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:701:1: style: Lines should not be more than 80 characters.

append = FALSE, format = "fastq", ...) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1421:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1465:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1616:1: style: Lines should not be more than 80 characters.

cols = c(tidyselect::ends_with("_start"), tidyselect::ends_with("_end")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/util.R:64:1: style: Variable and function name style should be snake_case.

sreadq_to_qsDNAss <- function(from) {
^~~~~~~~~~~~~~~~~

R/util.R:71:8: style: Use <-, not =, for assignment.

to = Biostrings::QualityScaledDNAStringSet(
       ^

R/util.R:97:1: style: Variable and function name style should be snake_case.

qsDNAss_to_sreadq <- function(from) {
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:10:1: style: Variable and function name style should be snake_case.

test_ShortRead <- methods::as(test_seq, "ShortRead")
^~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:11:1: style: Variable and function name style should be snake_case.

test_DNAStringSet <- Biostrings::DNAStringSet(test_seq)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:12:1: style: Variable and function name style should be snake_case.

test_RNAStringSet <- Biostrings::RNAStringSet(test_DNAStringSet)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:19:1: style: Variable and function name style should be snake_case.

test_QualityScaledDNAStringSet <- Biostrings::QualityScaledDNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:23:1: style: Variable and function name style should be snake_case.

test_QualityScaledRNAStringSet <- Biostrings::QualityScaledRNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:27:1: style: Variable and function name style should be snake_case.

test_ShortReadQ <- methods::as(test_QualityScaledDNAStringSet, "ShortReadQ")
^~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:29:1: style: Lines should not be more than 80 characters.

Biostrings::writeQualityScaledXStringSet(test_QualityScaledDNAStringSet, test_fastq)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-sread.R:3:1: style: Variable and function name style should be snake_case.

test_DNAss <- Biostrings::readDNAStringSet(test_file)
^~~~~~~~~~

tests/testthat/test-sread.R:7:1: style: Variable and function name style should be snake_case.

sread_DNAss <- methods::as(test_DNAss, "ShortRead")
^~~~~~~~~~~

tests/testthat/test-sread.R:8:1: style: Lines should not be more than 80 characters.

​test_that("loading fasta by Biostrings and ShortRead yield same result from as_sread", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vignettes/tzara.Rmd:26:1: style: Lines should not be more than 80 characters.

rDNA37 <- readFasta(system.file(file.path("extdata", "RDN37.fasta"), package = "tzara"))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vignettes/tzara.Rmd:26:1: style: Variable and function name style should be snake_case.

rDNA37 <- readFasta(system.file(file.path("extdata", "RDN37.fasta"), package = "tzara"))
^~~~~~

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/odseq.R:4:54: style: Variable and function name style should be snake_case.

function(msa_object, distance_metric = "linear", B = 100,
                                                     ^

R/odseq.R:5:47: style: There should be a space between right parenthesis and an opening curly brace.

threshold = 0.025, weights = NULL){
                                              ^~

R/odseq.R:9:9: style: Variable and function name style should be snake_case.

is.gap <- function(char){
        ^~~~~~

R/odseq.R:9:32: style: There should be a space between right parenthesis and an opening curly brace.

is.gap <- function(char){
                               ^~

R/odseq.R:18:35: style: There should be a space between right parenthesis and an opening curly brace.

vector.gap <- function(seq){
                                  ^~

R/odseq.R:22:44: style: There should be a space between right parenthesis and an opening curly brace.

linear_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:26:58: style: There should be a space between right parenthesis and an opening curly brace.

linear_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:27:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                             ^~

R/odseq.R:27:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                              ^

R/odseq.R:30:44: style: There should be a space between right parenthesis and an opening curly brace.

affine_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:37:19: style: Use <-, not =, for assignment.

case1 = (seq1_left != seq2_left) & (seq1_right == seq2_right)
                  ^

R/odseq.R:38:19: style: Use <-, not =, for assignment.

case2 = (seq1_left != seq2_left) & (seq1_right != seq2_right)
                  ^

R/odseq.R:40:18: style: Put spaces around all infix operators.

​            sum(3*case1 + case2)
                ~^~

R/odseq.R:43:58: style: There should be a space between right parenthesis and an opening curly brace.

affine_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:44:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                             ^~

R/odseq.R:44:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                              ^

R/odseq.R:50:31: style: Put spaces around all infix operators.

weights <- weights/sum(weights)
                             ~^~

R/odseq.R:52:22: style: Put spaces around all infix operators.

​                sum(x*weights)
                    ~^~

R/odseq.R:61:23: style: There should be a space between right parenthesis and an opening curly brace.

function(x){strsplit(as.character(x), "")}
                      ^~

R/odseq.R:61:24: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x){strsplit(as.character(x), "")}
                       ^

R/odseq.R:61:54: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x){strsplit(as.character(x), "")}
                                                     ^

R/odseq.R:71:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {linear_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:71:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {linear_score_vec(x, gap_sequences)}
                                                               ^

R/odseq.R:76:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {affine_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:76:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {affine_score_vec(x, gap_sequences)}
                                                               ^

R/tzara.R:556:1: style: Lines should not be more than 80 characters.

assertthat::assert_that(length(nread) == 1 | length(nread) == length(seq))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:699:1: style: Variable and function names should not be longer than 30 characters.

extract_region.QualityScaledXStringSet <- function(seq, positions, region,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:700:1: style: Lines should not be more than 80 characters.

region2 = region, outfile = NULL,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:701:1: style: Lines should not be more than 80 characters.

append = FALSE, format = "fastq", ...) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1421:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1465:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1616:1: style: Lines should not be more than 80 characters.

cols = c(tidyselect::ends_with("_start"), tidyselect::ends_with("_end")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/util.R:64:1: style: Variable and function name style should be snake_case.

sreadq_to_qsDNAss <- function(from) {
^~~~~~~~~~~~~~~~~

R/util.R:71:8: style: Use <-, not =, for assignment.

to = Biostrings::QualityScaledDNAStringSet(
       ^

R/util.R:97:1: style: Variable and function name style should be snake_case.

qsDNAss_to_sreadq <- function(from) {
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:10:1: style: Variable and function name style should be snake_case.

test_ShortRead <- methods::as(test_seq, "ShortRead")
^~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:11:1: style: Variable and function name style should be snake_case.

test_DNAStringSet <- Biostrings::DNAStringSet(test_seq)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:12:1: style: Variable and function name style should be snake_case.

test_RNAStringSet <- Biostrings::RNAStringSet(test_DNAStringSet)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:19:1: style: Variable and function name style should be snake_case.

test_QualityScaledDNAStringSet <- Biostrings::QualityScaledDNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:23:1: style: Variable and function name style should be snake_case.

test_QualityScaledRNAStringSet <- Biostrings::QualityScaledRNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:27:1: style: Variable and function name style should be snake_case.

test_ShortReadQ <- methods::as(test_QualityScaledDNAStringSet, "ShortReadQ")
^~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:29:1: style: Lines should not be more than 80 characters.

Biostrings::writeQualityScaledXStringSet(test_QualityScaledDNAStringSet, test_fastq)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-sread.R:3:1: style: Variable and function name style should be snake_case.

test_DNAss <- Biostrings::readDNAStringSet(test_file)
^~~~~~~~~~

tests/testthat/test-sread.R:7:1: style: Variable and function name style should be snake_case.

sread_DNAss <- methods::as(test_DNAss, "ShortRead")
^~~~~~~~~~~

tests/testthat/test-sread.R:8:1: style: Lines should not be more than 80 characters.

​test_that("loading fasta by Biostrings and ShortRead yield same result from as_sread", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vignettes/tzara.Rmd:26:1: style: Lines should not be more than 80 characters.

rDNA37 <- readFasta(system.file(file.path("extdata", "RDN37.fasta"), package = "tzara"))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vignettes/tzara.Rmd:26:1: style: Variable and function name style should be snake_case.

rDNA37 <- readFasta(system.file(file.path("extdata", "RDN37.fasta"), package = "tzara"))
^~~~~~

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/odseq.R:4:54: style: Variable and function name style should be snake_case.

function(msa_object, distance_metric = "linear", B = 100,
                                                     ^

R/odseq.R:5:47: style: There should be a space between right parenthesis and an opening curly brace.

threshold = 0.025, weights = NULL){
                                              ^~

R/odseq.R:9:9: style: Variable and function name style should be snake_case.

is.gap <- function(char){
        ^~~~~~

R/odseq.R:9:32: style: There should be a space between right parenthesis and an opening curly brace.

is.gap <- function(char){
                               ^~

R/odseq.R:18:35: style: There should be a space between right parenthesis and an opening curly brace.

vector.gap <- function(seq){
                                  ^~

R/odseq.R:22:44: style: There should be a space between right parenthesis and an opening curly brace.

linear_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:26:58: style: There should be a space between right parenthesis and an opening curly brace.

linear_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:27:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                             ^~

R/odseq.R:27:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){linear_score(seq1, x)})
                                              ^

R/odseq.R:30:44: style: There should be a space between right parenthesis and an opening curly brace.

affine_score <- function(seq1, seq2){
                                           ^~

R/odseq.R:37:19: style: Use <-, not =, for assignment.

case1 = (seq1_left != seq2_left) & (seq1_right == seq2_right)
                  ^

R/odseq.R:38:19: style: Use <-, not =, for assignment.

case2 = (seq1_left != seq2_left) & (seq1_right != seq2_right)
                  ^

R/odseq.R:40:18: style: Put spaces around all infix operators.

​            sum(3*case1 + case2)
                ~^~

R/odseq.R:43:58: style: There should be a space between right parenthesis and an opening curly brace.

affine_score_vec <- function(seq1, rest_sequences){
                                                         ^~

R/odseq.R:44:46: style: There should be a space between right parenthesis and an opening curly brace.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                             ^~

R/odseq.R:44:47: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​            sapply(rest_sequences, function(x){affine_score(seq1, x)})
                                              ^

R/odseq.R:50:31: style: Put spaces around all infix operators.

weights <- weights/sum(weights)
                             ~^~

R/odseq.R:52:22: style: Put spaces around all infix operators.

​                sum(x*weights)
                    ~^~

R/odseq.R:61:23: style: There should be a space between right parenthesis and an opening curly brace.

function(x){strsplit(as.character(x), "")}
                      ^~

R/odseq.R:61:24: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x){strsplit(as.character(x), "")}
                       ^

R/odseq.R:61:54: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x){strsplit(as.character(x), "")}
                                                     ^

R/odseq.R:71:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {linear_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:71:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {linear_score_vec(x, gap_sequences)}
                                                               ^

R/odseq.R:76:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

function(x) {affine_score_vec(x, gap_sequences)}
                            ^

R/odseq.R:76:64: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

function(x) {affine_score_vec(x, gap_sequences)}
                                                               ^

R/tzara.R:556:1: style: Lines should not be more than 80 characters.

assertthat::assert_that(length(nread) == 1 | length(nread) == length(seq))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:699:1: style: Variable and function names should not be longer than 30 characters.

extract_region.QualityScaledXStringSet <- function(seq, positions, region,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:700:1: style: Lines should not be more than 80 characters.

region2 = region, outfile = NULL,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:701:1: style: Lines should not be more than 80 characters.

append = FALSE, format = "fastq", ...) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1421:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1465:1: style: Lines should not be more than 80 characters.

​                sum(regstats[[n_na]][regstats[[all_na]] & !is.na(regstats[[reg]])]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/tzara.R:1616:1: style: Lines should not be more than 80 characters.

cols = c(tidyselect::ends_with("_start"), tidyselect::ends_with("_end")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/util.R:64:1: style: Variable and function name style should be snake_case.

sreadq_to_qsDNAss <- function(from) {
^~~~~~~~~~~~~~~~~

R/util.R:71:8: style: Use <-, not =, for assignment.

to = Biostrings::QualityScaledDNAStringSet(
       ^

R/util.R:97:1: style: Variable and function name style should be snake_case.

qsDNAss_to_sreadq <- function(from) {
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:10:1: style: Variable and function name style should be snake_case.

test_ShortRead <- methods::as(test_seq, "ShortRead")
^~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:11:1: style: Variable and function name style should be snake_case.

test_DNAStringSet <- Biostrings::DNAStringSet(test_seq)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:12:1: style: Variable and function name style should be snake_case.

test_RNAStringSet <- Biostrings::RNAStringSet(test_DNAStringSet)
^~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:19:1: style: Variable and function name style should be snake_case.

test_QualityScaledDNAStringSet <- Biostrings::QualityScaledDNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:23:1: style: Variable and function name style should be snake_case.

test_QualityScaledRNAStringSet <- Biostrings::QualityScaledRNAStringSet(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:27:1: style: Variable and function name style should be snake_case.

test_ShortReadQ <- methods::as(test_QualityScaledDNAStringSet, "ShortReadQ")
^~~~~~~~~~~~~~~

tests/testthat/test-extract_region.R:29:1: style: Lines should not be more than 80 characters.

Biostrings::writeQualityScaledXStringSet(test_QualityScaledDNAStringSet, test_fastq)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-sread.R:3:1: style: Variable and function name style should be snake_case.

test_DNAss <- Biostrings::readDNAStringSet(test_file)
^~~~~~~~~~

tests/testthat/test-sread.R:7:1: style: Variable and function name style should be snake_case.

sread_DNAss <- methods::as(test_DNAss, "ShortRead")
^~~~~~~~~~~

tests/testthat/test-sread.R:8:1: style: Lines should not be more than 80 characters.

​test_that("loading fasta by Biostrings and ShortRead yield same result from as_sread", {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vignettes/tzara.Rmd:26:1: style: Lines should not be more than 80 characters.

rDNA37 <- readFasta(system.file(file.path("extdata", "RDN37.fasta"), package = "tzara"))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vignettes/tzara.Rmd:26:1: style: Variable and function name style should be snake_case.

rDNA37 <- readFasta(system.file(file.path("extdata", "RDN37.fasta"), package = "tzara"))
^~~~~~

Please sign in to comment.