Running examples in ‘PepPrep-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: compHomToPepFasta
> ### Title: Comparison of proteins and creating homologous peptides workflow
> ### Aliases: compHomToPepFasta
> 
> ### ** Examples
> 
> #load data and set arguments
> 
> #Uniprot proteom FASTA databases 
> #(just a small example with two proteins each)
> path_o1 <- system.file("extdata", "ExampleHumanProt.fasta", package="PepPrep")
> path_o2 <- system.file("extdata", "ExampleMouseProt.fasta", package="PepPrep")
> 
> #where to write the result and how to formate
> path <- paste0(getwd(), "/myTest_compHomToPep.fasta")
> width <- 60
> 
> #call workflow
> test <- compHomToPepFasta(path_o1, path_o2, path, width)
[1] "start findEntryPairs"
[1] "start addHeader"
[1] "start addAllPeptides"
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
PepPrep
 --- call from context --- 
trypsinateSeq(ooseq, target, exception)
 --- call from argument --- 
if (class(tryppos) == "integer") {
    if (length(tryppos) == 0) {
        tryppos <- matrix(c(1, nchar(seq)), nrow = 1, ncol = 2, 
            dimnames = list(c(), c("start", "end")))
    }
    else {
        tryppos <- matrix(c(tryppos["start"], tryppos["end"]), 
            nrow = 1, ncol = 2, dimnames = list(c(), c("start", 
                "end")))
    }
}
 --- R stacktrace ---
where 1: trypsinateSeq(ooseq, target, exception)
where 2: addAllPeptides(tbl, path_o1, path_o2, target, exception)
where 3: compHomToPepFasta(path_o1, path_o2, path, width)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (seq, target = "K|R", exception = "P") 
{
    targettest <- regexpr("^[ARNDCQEGHILKMFPSTWYV]([|][ARNDCQEGHILKMFPSTWYV])*", 
        target)
    exceptiontest <- regexpr("^[ARNDCQEGHILKMFPSTWYV]([|][ARNDCQEGHILKMFPSTWYV])*", 
        exception)
    if (attr(targettest, "match.length") != nchar(target)) {
        message <- "trypsinateSeq: Error target is wrong"
        print(message)
        return(message)
    }
    if (attr(exceptiontest, "match.length") != nchar(exception)) {
        message <- "trypsinateSeq: Error exception is wrong"
        print(message)
        return(message)
    }
    vrk <- str_locate_all(seq, target)[[1]]
    vp <- str_locate_all(seq, exception)[[1]]
    pminus <- vp - 1
    tryppos <- vrk[!(vrk[, 1] %in% pminus[, 1]), ]
    if (class(tryppos) == "integer") {
        if (length(tryppos) == 0) {
            tryppos <- matrix(c(1, nchar(seq)), nrow = 1, ncol = 2, 
                dimnames = list(c(), c("start", "end")))
        }
        else {
            tryppos <- matrix(c(tryppos["start"], tryppos["end"]), 
                nrow = 1, ncol = 2, dimnames = list(c(), c("start", 
                  "end")))
        }
    }
    if (class(tryppos) == "matrix") {
        if (dim(tryppos)[1] == 0) {
            tryppos <- matrix(c(1, nchar(seq)), nrow = 1, ncol = 2, 
                dimnames = list(c(), c("start", "end")))
        }
    }
    result <- rep("", length(tryppos[, 1]) + 1)
    first <- 1
    for (i in seq(along = tryppos[, 1])) {
        last <- tryppos[i, 1]
        pep <- substr(seq, first, last)
        result[i] <- pep
        first <- last + 1
    }
    last <- nchar(seq)
    if (first <= last) {
        result[length(result)] <- substr(seq, first, last)
    }
    return(result)
}
<bytecode: 0x557d7800df40>
<environment: namespace:PepPrep>
 --- function search by body ---
Function trypsinateSeq in namespace PepPrep has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(tryppos) == "integer") { : 
  the condition has length > 1
Calls: compHomToPepFasta -> addAllPeptides -> trypsinateSeq
Execution halted