From bc49077e2b37da6ed281f7be1e81b2eccec681a3 Mon Sep 17 00:00:00 2001 From: pribiller Date: Sat, 22 Aug 2026 12:54:52 +0900 Subject: [PATCH 1/3] Remove warnings from breakpoint graph functions Remove all `Undocumented arguments` warnings from functions related to the breakpoint graph. --- R/breakpointGraph.R | 24 +++++++++++++++++++++--- man/cycle_count.Rd | 2 +- man/hurdles_count.Rd | 7 ++++++- man/is_fortress.Rd | 4 ++++ man/is_interleaving.Rd | 13 ++++++++++++- man/superhurdles_count.Rd | 9 ++++++++- 6 files changed, 52 insertions(+), 7 deletions(-) diff --git a/R/breakpointGraph.R b/R/breakpointGraph.R index 7de4f622..c77da943 100644 --- a/R/breakpointGraph.R +++ b/R/breakpointGraph.R @@ -78,6 +78,14 @@ breakpoint_graph <- function(p_extended) { #' Interleaving Check #' +#' This function checks if two edges are interleaving. +#' +#' @param p_extended The extended permutation. +#' @param graph_1 A cycle in the breakpoint graph. +#' @param graph_2 A cycle in the breakpoint graph. +#' @param edge_1 An edge in the breakpoint graph. +#' @param edge_2 An edge in the breakpoint graph. +#' #' @importFrom igraph E V E<- V<- ends #' #' @author Bruna Fistarol @@ -118,7 +126,7 @@ bp_count <- function(p_extended){ #' #' This function computes the number of cycles in a breakpoint graph. #' -#' @param p_extended The extended permutation. +#' @param g The breakpoint graph. #' #' @return The number of cycles in a breakpoint graph. #' @@ -202,7 +210,10 @@ components_graph <- function(g, p_extended) { #' Count hurdles #' -#' Count hurdles in the breakpoint graph. +#' This function finds hurdles in the breakpoint graph and returns them. +#' +#' @param g The breakpoint graph. +#' @param query_sequence_unsig The extended permutation. #' #' @importFrom igraph E V E<- V<- components ends #' @@ -325,7 +336,11 @@ hurdles_count <- function(g, query_sequence_unsig){ #' Count superhurdles #' -#' Counts superhurdles in the breakpoint graph. +#' This function finds superhurdles in the breakpoint graph by checking which hurdles are superhurdles. +#' +#' @param info Object that stores the hurdles in the breakpoint graph. +#' @param g The breakpoint graph. +#' @param query_sequence_unsig The extended permutation. #' #' @importFrom igraph E V E<- V<- components ends #' @@ -492,6 +507,9 @@ superhurdles_count <- function(info, g, query_sequence_unsig){ #' Check fortrees #' #' Check whether or not the permutation is a fortress. +#' A permutation is a fortress if the number of hurdles is odd and all hurdles are superhurdles. +#' +#' @param superhurdles Object that stores the counts of hurdles and superhurdles in the breakpoint graph. #' #' @author Bruna Fistarol #' diff --git a/man/cycle_count.Rd b/man/cycle_count.Rd index 850da849..40939600 100644 --- a/man/cycle_count.Rd +++ b/man/cycle_count.Rd @@ -7,7 +7,7 @@ cycle_count(g) } \arguments{ -\item{p_extended}{The extended permutation.} +\item{g}{The breakpoint graph.} } \value{ The number of cycles in a breakpoint graph. diff --git a/man/hurdles_count.Rd b/man/hurdles_count.Rd index 32b92b8c..ff898fc5 100644 --- a/man/hurdles_count.Rd +++ b/man/hurdles_count.Rd @@ -6,8 +6,13 @@ \usage{ hurdles_count(g, query_sequence_unsig) } +\arguments{ +\item{g}{The breakpoint graph.} + +\item{query_sequence_unsig}{The extended permutation.} +} \description{ -Count hurdles in the breakpoint graph. +This function finds hurdles in the breakpoint graph and returns them. } \seealso{ Other Breakpoint graph functions: diff --git a/man/is_fortress.Rd b/man/is_fortress.Rd index fd5e471b..b27c7689 100644 --- a/man/is_fortress.Rd +++ b/man/is_fortress.Rd @@ -6,8 +6,12 @@ \usage{ is_fortress(superhurdles) } +\arguments{ +\item{superhurdles}{Object that stores the counts of hurdles and superhurdles in the breakpoint graph.} +} \description{ Check whether or not the permutation is a fortress. +A permutation is a fortress if the number of hurdles is odd and all hurdles are superhurdles. } \seealso{ Other Breakpoint graph functions: diff --git a/man/is_interleaving.Rd b/man/is_interleaving.Rd index e3ca0716..312016e5 100644 --- a/man/is_interleaving.Rd +++ b/man/is_interleaving.Rd @@ -6,8 +6,19 @@ \usage{ is_interleaving(p_extended, graph_1, graph_2, edge_1, edge_2) } +\arguments{ +\item{p_extended}{The extended permutation.} + +\item{graph_1}{A cycle in the breakpoint graph.} + +\item{graph_2}{A cycle in the breakpoint graph.} + +\item{edge_1}{An edge in the breakpoint graph.} + +\item{edge_2}{An edge in the breakpoint graph.} +} \description{ -Interleaving Check +This function checks if two edges are interleaving. } \seealso{ Other Breakpoint graph functions: diff --git a/man/superhurdles_count.Rd b/man/superhurdles_count.Rd index 684464c0..0f9a5e5d 100644 --- a/man/superhurdles_count.Rd +++ b/man/superhurdles_count.Rd @@ -6,8 +6,15 @@ \usage{ superhurdles_count(info, g, query_sequence_unsig) } +\arguments{ +\item{info}{Object that stores the hurdles in the breakpoint graph.} + +\item{g}{The breakpoint graph.} + +\item{query_sequence_unsig}{The extended permutation.} +} \description{ -Counts superhurdles in the breakpoint graph. +This function finds superhurdles in the breakpoint graph by checking which hurdles are superhurdles. } \seealso{ Other Breakpoint graph functions: From 0c5bdff0838bc33d3f9fa7e5c74c8982f6237556 Mon Sep 17 00:00:00 2001 From: pribiller Date: Sat, 22 Aug 2026 15:39:33 +0900 Subject: [PATCH 2/3] Fix examples lines exceeding 100 characters Resolve notes of the type "\examples lines wider than 100 characters" introduced by recent PRs. --- R/inversionDistance.R | 3 ++- R/inversionEstimate_BD.R | 15 ++++++++++----- man/inversionDistance.Rd | 3 ++- man/inversionEstimate_BD.Rd | 15 ++++++++++----- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/R/inversionDistance.R b/R/inversionDistance.R index 4f9156a4..e5fc13da 100644 --- a/R/inversionDistance.R +++ b/R/inversionDistance.R @@ -27,7 +27,8 @@ #' inversionDistance(c(1, 3, -2, 4)) #' #' # Example using a GBreaks object. -#' # This example is based on Figure 4(a) from Hannehalli and Pevzner (1999). The inversion distance is 8. +#' # This example is based on Figure 4(a) from Hannehalli and Pevzner (1999). +#' # The inversion distance is 8. #' inversionDistance(exampleInversionHP1999fig4a) #' #' @seealso \code{\link{permutationVector}} for generating the permutation vector. diff --git a/R/inversionEstimate_BD.R b/R/inversionEstimate_BD.R index e3d227d8..96ab5dbb 100644 --- a/R/inversionEstimate_BD.R +++ b/R/inversionEstimate_BD.R @@ -280,22 +280,27 @@ inversionEstimate_BD_many <- function(n, obs_nb_cycles, cyc_all=NA){ #' #' @examples #' \dontrun{ -#' #' # Create a chromosome mapping given a GBreaks object (useful when genomes are multichromosomal). #' chrMapping <- matchPairs(exampleInversionBader2001) #' # Compute the expected number of inversions using the method from Berestycki and Durrett (2006). #' expNbInversions <- inversionEstimate_BD(chrMapping) #' # Compute the minimum number of inversions using the method from Hannehalli and Pevzner (1999). #' minNbInversions <- inversionDistance(chrMapping) -#' # Output: Example from Bader et al. (2001): Inversion distance = 7 , Expected nb. of inversions = 7 -#' cat(paste("Example from Bader et al. (2001): Inversion distance =", minNbInversions, ", Expected nb. of inversions =", expNbInversions[[1]]$expinv_BD$k_avg)) +#' # Output: Example from Bader et al. (2001): +#' # - Inversion distance = 7 , Expected nb. of inversions = 7 +#' cat("Example from Bader et al. (2001):") +#' cat(paste("- Inversion distance =", minNbInversions)) +#' cat(paste("- Expected nb. of inversions =", expNbInversions[[1]]$expinv_BD$k_avg)) #' #' # Another example, this time without computing the chromosome mapping. #' # The chromosome mapping is not needed if genomes are unichromosomal. #' expNbInversions <- inversionEstimate_BD(exampleInversionBergeron2005b) #' minNbInversions <- inversionDistance(exampleInversionBergeron2005b) -#' # Output: Example used in the book ``Mathematics of Evolution and Phylogeny`` (2005) (Figure 10.6): Inversion distance = 13 , Expected nb. of inversions = 15 -#' cat(paste("Example used in the book ``Mathematics of Evolution and Phylogeny`` (2005) (Figure 10.6): Inversion distance =", minNbInversions, ", Expected nb. of inversions =", expNbInversions[[1]]$expinv_BD$k_avg)) +#' # Output: Example used in the book ``Mathematics of Evolution and Phylogeny`` (2005) (Figure 10.6): +#' # - Inversion distance = 13 , Expected nb. of inversions = 15 +#' cat("Example used in the book ``Mathematics of Evolution and Phylogeny`` (2005) (Figure 10.6):") +#' cat(paste("- Inversion distance =", minNbInversions)) +#' cat(paste("- Expected nb. of inversions =", expNbInversions[[1]]$expinv_BD$k_avg)) #' } #' #' @seealso \code{\link{breakpointGraphProperties}} for computing key properties of the breakpoint graph needed for this estimate. diff --git a/man/inversionDistance.Rd b/man/inversionDistance.Rd index 8ceb2715..b5f1ab85 100644 --- a/man/inversionDistance.Rd +++ b/man/inversionDistance.Rd @@ -35,7 +35,8 @@ if different chromosomes have orthologous regions. inversionDistance(c(1, 3, -2, 4)) # Example using a GBreaks object. -# This example is based on Figure 4(a) from Hannehalli and Pevzner (1999). The inversion distance is 8. +# This example is based on Figure 4(a) from Hannehalli and Pevzner (1999). +# The inversion distance is 8. inversionDistance(exampleInversionHP1999fig4a) } diff --git a/man/inversionEstimate_BD.Rd b/man/inversionEstimate_BD.Rd index 19fe2f85..0f486f6c 100644 --- a/man/inversionEstimate_BD.Rd +++ b/man/inversionEstimate_BD.Rd @@ -49,22 +49,27 @@ between reference and query chromosomes. } \examples{ \dontrun{ - # Create a chromosome mapping given a GBreaks object (useful when genomes are multichromosomal). chrMapping <- matchPairs(exampleInversionBader2001) # Compute the expected number of inversions using the method from Berestycki and Durrett (2006). expNbInversions <- inversionEstimate_BD(chrMapping) # Compute the minimum number of inversions using the method from Hannehalli and Pevzner (1999). minNbInversions <- inversionDistance(chrMapping) -# Output: Example from Bader et al. (2001): Inversion distance = 7 , Expected nb. of inversions = 7 -cat(paste("Example from Bader et al. (2001): Inversion distance =", minNbInversions, ", Expected nb. of inversions =", expNbInversions[[1]]$expinv_BD$k_avg)) +# Output: Example from Bader et al. (2001): +# - Inversion distance = 7 , Expected nb. of inversions = 7 +cat("Example from Bader et al. (2001):") +cat(paste("- Inversion distance =", minNbInversions)) +cat(paste("- Expected nb. of inversions =", expNbInversions[[1]]$expinv_BD$k_avg)) # Another example, this time without computing the chromosome mapping. # The chromosome mapping is not needed if genomes are unichromosomal. expNbInversions <- inversionEstimate_BD(exampleInversionBergeron2005b) minNbInversions <- inversionDistance(exampleInversionBergeron2005b) -# Output: Example used in the book ``Mathematics of Evolution and Phylogeny`` (2005) (Figure 10.6): Inversion distance = 13 , Expected nb. of inversions = 15 -cat(paste("Example used in the book ``Mathematics of Evolution and Phylogeny`` (2005) (Figure 10.6): Inversion distance =", minNbInversions, ", Expected nb. of inversions =", expNbInversions[[1]]$expinv_BD$k_avg)) +# Output: Example used in the book ``Mathematics of Evolution and Phylogeny`` (2005) (Figure 10.6): +# - Inversion distance = 13 , Expected nb. of inversions = 15 +cat("Example used in the book ``Mathematics of Evolution and Phylogeny`` (2005) (Figure 10.6):") +cat(paste("- Inversion distance =", minNbInversions)) +cat(paste("- Expected nb. of inversions =", expNbInversions[[1]]$expinv_BD$k_avg)) } } From 732a33c09d51febacb75cf70bdd3d5ed9f1523f7 Mon Sep 17 00:00:00 2001 From: pribiller Date: Sat, 22 Aug 2026 15:50:52 +0900 Subject: [PATCH 3/3] Fix "Undocumented code objects" warnings Fix "Undocumented code objects" warnings caused by the data objects introduced in PR #54. --- R/StructuralVariants.R | 9 +++++++++ man/StructuralVariants.Rd | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/R/StructuralVariants.R b/R/StructuralVariants.R index 8714d87a..1f19ada3 100644 --- a/R/StructuralVariants.R +++ b/R/StructuralVariants.R @@ -20,6 +20,9 @@ #' @aliases exampleDoubleInversion1 exampleDoubleInversion2 #' @aliases exampleDoubleInversion3 exampleDoubleInversion4 #' @aliases exampleTwinInversions exampleNotTwinInversions +#' @aliases exampleInversionGarg2019 exampleInversionBader2001 +#' @aliases exampleInversionHP1999fig4a exampleInversionHP1999fig4b +#' @aliases exampleInversionBergeron2005a exampleInversionBergeron2005b #' @aliases exampleTranslocation exampleTranslocation2 #' @aliases exampleInsertion exampleDeletion #' @@ -35,6 +38,12 @@ #' exampleNestedInversions #' exampleDoubleInversion1 #' exampleTwinInversions +#' exampleInversionGarg2019 +#' exampleInversionBader2001 +#' exampleInversionHP1999fig4a +#' exampleInversionHP1999fig4b +#' exampleInversionBergeron2005a +#' exampleInversionBergeron2005b #' exampleTranslocation #' exampleTranslocation2 #' diff --git a/man/StructuralVariants.Rd b/man/StructuralVariants.Rd index b5a457a9..b89f40a0 100644 --- a/man/StructuralVariants.Rd +++ b/man/StructuralVariants.Rd @@ -15,6 +15,12 @@ \alias{exampleDoubleInversion4} \alias{exampleTwinInversions} \alias{exampleNotTwinInversions} +\alias{exampleInversionGarg2019} +\alias{exampleInversionBader2001} +\alias{exampleInversionHP1999fig4a} +\alias{exampleInversionHP1999fig4b} +\alias{exampleInversionBergeron2005a} +\alias{exampleInversionBergeron2005b} \alias{exampleTranslocation} \alias{exampleTranslocation2} \alias{exampleInsertion} @@ -44,6 +50,12 @@ exampleInversion5uncollapsed exampleNestedInversions exampleDoubleInversion1 exampleTwinInversions +exampleInversionGarg2019 +exampleInversionBader2001 +exampleInversionHP1999fig4a +exampleInversionHP1999fig4b +exampleInversionBergeron2005a +exampleInversionBergeron2005b exampleTranslocation exampleTranslocation2