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
6 changes: 4 additions & 2 deletions R/StructuralVariants.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#'
Expand All @@ -37,6 +38,7 @@
#' exampleInversion5uncollapsed
#' exampleNestedInversions
#' exampleDoubleInversion1
#' exampleClownInversion
#' exampleTwinInversions
#' exampleInversionGarg2019
#' exampleInversionBader2001
Expand Down
13 changes: 12 additions & 1 deletion data-raw/StructuralVariants.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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( "-", "+", "+", "-", "+", "+", "+", "-", "-")
Expand Down Expand Up @@ -255,6 +265,7 @@ usethis::use_data(
exampleDoubleInversion2,
exampleDoubleInversion3,
exampleDoubleInversion4,
exampleClownInversion,
exampleNestedInversions,
exampleTwinInversions,
exampleNotTwinInversions,
Expand Down
Binary file added data/exampleClownInversion.rda
Binary file not shown.
2 changes: 2 additions & 0 deletions man/StructuralVariants.Rd

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

8 changes: 8 additions & 0 deletions vignettes/StructuralVariants.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading