Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Depends:
R (>= 4.4.0)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
VignetteBuilder: knitr
Imports:
ape,
Expand Down Expand Up @@ -83,4 +83,7 @@ Imports:
XVector,
yaml
Suggests:
knitr
knitr,
testthat,
mockery,
readr
22 changes: 14 additions & 8 deletions R/fa2domain.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ runIPRScan <- function(
# destPartition = "LocalQ",
# destQoS = "shortjobs"
) {
# Validate inputs
if (is.null(filepath_fasta) || filepath_fasta == "") {
stop("filepath_fasta cannot be NULL or empty")
}
if (is.null(filepath_out) || filepath_out == "") {
stop("filepath_out cannot be NULL or empty")
}
if (!all(appl %in% c("Pfam", "Gene3D"))) {
stop("Invalid IPRscan analyses specified")
}
# construct interproscan command
cmd_iprscan <- stringr::str_glue(
"iprscan -i {filepath_fasta} -b {filepath_out} --cpu 4 -f TSV ",
Expand All @@ -55,14 +65,10 @@ runIPRScan <- function(
#' (based upon the global variable written in
#' molevol_scripts/R/colnames_molevol.R)
#'
#' @return [chr] interproscan column names used throughout molevolvr
#' @return [chr] interproscan column names used throughout MolEvolvR
getIPRScanColNames <- function() {
column_names <- c(
"AccNum", "SeqMD5Digest", "SLength", "Analysis",
"DB.ID", "SignDesc", "StartLoc", "StopLoc", "Score",
"Status", "RunDate", "IPRAcc", "IPRDesc"
)
return(column_names)
data("ipr_colnames", package = "MolEvolvR", envir = environment())
ipr_colnames
}

#' construct column types for reading interproscan output TSVs
Expand Down Expand Up @@ -296,7 +302,7 @@ getDomainsFromFA <- function(
if (verbose) {
msg <- stringr::str_glue(
"accession number: {header} had no domains for the ",
"selected analyes: {paste(analysis, collapse = ',')}\n"
"selected analyses: {paste(analysis, collapse = ',')}\n"
)
warning(msg)
}
Expand Down
28 changes: 28 additions & 0 deletions R/ipr_colnames.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#' InterProScan Column Names
#'
#' A character vector containing the expected column names from an
#' InterProScan output table. This dataset is useful for validating,
#' parsing, or reconstructing data frames produced by InterProScan.
#'
#' @format A character vector with 13 elements:
#' \describe{
#' \item{AccNum}{Accession number of the sequence.}
#' \item{SeqMD5Digest}{MD5 digest of the sequence.}
#' \item{SLength}{Length of the sequence.}
#' \item{Analysis}{Type of analysis or database used (e.g., Pfam, SMART).}
#' \item{DB.ID}{Database-specific identifier.}
#' \item{SignDesc}{Description of the signature or domain.}
#' \item{StartLoc}{Start position of the match on the sequence.}
#' \item{StopLoc}{Stop position of the match on the sequence.}
#' \item{Score}{Score assigned to the match (if applicable).}
#' \item{Status}{Status of the analysis (e.g., OK, WARNING).}
#' \item{RunDate}{Date the InterProScan analysis was run.}
#' \item{IPRAcc}{InterPro accession number.}
#' \item{IPRDesc}{InterPro entry description.}
#' }
#'
#' @source Generated internally to represent standard InterProScan output fields.
#' @examples
#' data(ipr_colnames)
#' ipr_colnames
"ipr_colnames"
2 changes: 1 addition & 1 deletion man/calculateProcessRuntime.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/cleanFAHeaders.Rd

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

2 changes: 1 addition & 1 deletion man/cleanString.Rd

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

2 changes: 1 addition & 1 deletion man/convertIPRScanDomainTable2FA.Rd

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

6 changes: 3 additions & 3 deletions man/createIPRScanDomainTable.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/ensureUniqAccNum.Rd

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

6 changes: 3 additions & 3 deletions man/getDomainsFromFA.Rd

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

2 changes: 1 addition & 1 deletion man/getIPRScanColNames.Rd

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

2 changes: 1 addition & 1 deletion man/getProcessRuntimeWeights.Rd

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

40 changes: 40 additions & 0 deletions man/ipr_colnames.Rd

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

2 changes: 1 addition & 1 deletion man/readIPRScanTSV.Rd

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

2 changes: 1 addition & 1 deletion man/writeProcessRuntime2TSV.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/writeProcessRuntime2YML.Rd

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

4 changes: 4 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
library(testthat)
library(MolEvolvR)

test_check("MolEvolvR")
Loading