diff --git a/R/StructuralVariants.R b/R/StructuralVariants.R index 1f19ada3..d7354e7f 100644 --- a/R/StructuralVariants.R +++ b/R/StructuralVariants.R @@ -20,11 +20,12 @@ #' @aliases exampleDoubleInversion1 exampleDoubleInversion2 #' @aliases exampleDoubleInversion3 exampleDoubleInversion4 #' @aliases exampleTwinInversions exampleNotTwinInversions -#' @aliases exampleInversionGarg2019 exampleInversionBader2001 -#' @aliases exampleInversionHP1999fig4a exampleInversionHP1999fig4b +#' @aliases exampleInversionGarg2019 exampleInversionBader2001 +#' @aliases exampleInversionHP1999fig4a exampleInversionHP1999fig4b #' @aliases exampleInversionBergeron2005a exampleInversionBergeron2005b #' @aliases exampleTranslocation exampleTranslocation2 #' @aliases exampleInsertion exampleDeletion +#' @aliases exampleClownInversion #' #' @family Structural variants #' @@ -37,6 +38,7 @@ #' exampleInversion5uncollapsed #' exampleNestedInversions #' exampleDoubleInversion1 +#' exampleClownInversion #' exampleTwinInversions #' exampleInversionGarg2019 #' exampleInversionBader2001 diff --git a/data-raw/StructuralVariants.R b/data-raw/StructuralVariants.R index 2448c06f..1b20cc67 100644 --- a/data-raw/StructuralVariants.R +++ b/data-raw/StructuralVariants.R @@ -95,6 +95,16 @@ exampleDoubleInversion4 <- GBreaks(exampleDoubleInversion4) seqlengths(exampleDoubleInversion4) <- seqlengths(exampleDoubleInversion4$query) <- 600 isSorted(exampleDoubleInversion4) +# Clown inversion based on exampleDoubleInversion4 +# ABC/cba -> ABC/cAB -> ABC/aCB => 1-, 3+, 2+ + +exampleClownInversion <- GRanges(c("chrA:100-190", "chrA:200-290", "chrA:300-340", "chrA:341-370","chrA:371-390", "chrA:400-490", "chrA:500-590")) +strand(exampleClownInversion) <- c( "-", "-", "+", "-", "+", "+", "-" ) +exampleClownInversion$query <- GRanges(c("chrB:500-590", "chrB:200-290", "chrB:400-440", "chrB:441-470","chrB:471-490", "chrB:300-390", "chrB:100-190")) +exampleClownInversion <- GBreaks(exampleClownInversion) +seqlengths(exampleClownInversion) <- seqlengths(exampleClownInversion$query) <- 600 +isSorted(exampleClownInversion) + # Nested inversions # ABCDE -> AdcbE -> AdCbE @@ -126,7 +136,7 @@ isSorted(exampleNotTwinInversions) # Example used in the paper from Garg et al. (2019). # {-2,5,4,-1,3,6,9,-7,-8} -# Reversal distance = 5 reversals. +# Reversal distance = 5 reversals. # Details for Reversal distance (d) computation: 10 breakpoints (b); 5 cycles(c); 0 hurdles(h): d = b-c+h (+1 if fortress). exampleInversionGarg2019 <- GRanges(c("chrA:100-190", "chrA:200-290", "chrA:300-390", "chrA:400-490", "chrA:500-590", "chrA:600-690", "chrA:700-790", "chrA:800-890", "chrA:900-990")) strand(exampleInversionGarg2019) <- c( "-", "+", "+", "-", "+", "+", "+", "-", "-") @@ -255,6 +265,7 @@ usethis::use_data( exampleDoubleInversion2, exampleDoubleInversion3, exampleDoubleInversion4, + exampleClownInversion, exampleNestedInversions, exampleTwinInversions, exampleNotTwinInversions, diff --git a/data/exampleClownInversion.rda b/data/exampleClownInversion.rda new file mode 100644 index 00000000..935ef1d5 Binary files /dev/null and b/data/exampleClownInversion.rda differ diff --git a/man/StructuralVariants.Rd b/man/StructuralVariants.Rd index b89f40a0..2ce9c3e9 100644 --- a/man/StructuralVariants.Rd +++ b/man/StructuralVariants.Rd @@ -25,6 +25,7 @@ \alias{exampleTranslocation2} \alias{exampleInsertion} \alias{exampleDeletion} +\alias{exampleClownInversion} \title{Structural Variants} \format{ \code{\link{GBreaks}} objects described in more details in the @@ -49,6 +50,7 @@ exampleInversion exampleInversion5uncollapsed exampleNestedInversions exampleDoubleInversion1 +exampleClownInversion exampleTwinInversions exampleInversionGarg2019 exampleInversionBader2001 diff --git a/vignettes/StructuralVariants.Rmd b/vignettes/StructuralVariants.Rmd index 691c2d8c..e3901130 100644 --- a/vignettes/StructuralVariants.Rmd +++ b/vignettes/StructuralVariants.Rmd @@ -202,6 +202,14 @@ exampleInversionBergeron2005a |> plotApairOfChrs(main = "Mathematics of Evolutio exampleInversionBergeron2005b |> plotApairOfChrs(main = "Mathematics of Evolution and Phylogeny (2005) - Figure 10.6") ``` +### The inversion clown. + +Find it in your alignments! + +```{r inversionClown} +exampleClownInversion |> makeOxfordPlots(col = "strand") + ggplot2::theme_bw() +``` + ## Translocations If a region has moved, but is not an inversion, then it is a translocation.