Skip to content

Commit

Permalink
new feature: cytobands coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
Kdreval committed Nov 26, 2024
1 parent 4fe4542 commit ea80944
Show file tree
Hide file tree
Showing 9 changed files with 1,841 additions and 0 deletions.
16 changes: 16 additions & 0 deletions R/cool_overlaps.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ cool_overlaps <- function(

# When the same columns are provided they will become .x and .y
if(start1 == start2) {
original_start1 <- start1
start1 <- paste0(start1, ".x")
start2 <- paste0(start2, ".y")

}
if(end1 == end2) {
original_end1 <- end1
end1 <- paste0(end1, ".x")
end2 <- paste0(end2, ".y")

Expand Down Expand Up @@ -193,6 +195,20 @@ cool_overlaps <- function(
overlap
)
)
if(original_start1 %in% colnames(no_annotation)){
colnames(no_annotation) = gsub(
original_start1,
start1,
colnames(no_annotation)
)
}
if(original_end1 %in% colnames(no_annotation)){
colnames(no_annotation) = gsub(
original_end1,
end1,
colnames(no_annotation)
)
}
overlap <- bind_rows(
overlap,
no_annotation
Expand Down
30 changes: 30 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -980,3 +980,33 @@
#' \item{Description}{NA.}
#' }
"protein_domains"

#' Cytobands coordinates (grch37)
#'
#' A data frame in bed format with coordinates of cytobands relative to grch37.
#'
#' @format ## `cytobands_grch37`
#' A data frame with 862 rows and 5 columns
#' \describe{
#' \item{cb.chromosome}{Chromosome of the cytoband.}
#' \item{cb.start}{Start position of the cytoband.}
#' \item{cb.end}{End position of the cytoband.}
#' \item{cb.name}{Cytoband name.}
#' \item{label}{Cytoband label.}
#' }
"cytobands_grch37"

#' Cytobands coordinates (hg38)
#'
#' A data frame in bed format with coordinates of cytobands relative to hg38.
#'
#' @format ## `cytobands_hg38`
#' A data frame with 862 rows and 5 columns
#' \describe{
#' \item{cb.chromosome}{Chromosome of the cytoband.}
#' \item{cb.start}{Start position of the cytoband.}
#' \item{cb.end}{End position of the cytoband.}
#' \item{cb.name}{Cytoband name.}
#' \item{label}{Cytoband label.}
#' }
"cytobands_hg38"
17 changes: 17 additions & 0 deletions data-raw/DATASET.R
Original file line number Diff line number Diff line change
Expand Up @@ -509,3 +509,20 @@ protein_domains <- system.file(
) %>%
read_tsv()
usethis::use_data(protein_domains, overwrite = TRUE)

# Cytobands
cytobands_grch37 <- system.file(
"extdata",
"cytobands_grch37.tsv",
package = "GAMBLR.data"
) %>%
read_tsv()
usethis::use_data(cytobands_grch37, overwrite = TRUE)

cytobands_hg38 <- system.file(
"extdata",
"cytobands_hg38.tsv",
package = "GAMBLR.data"
) %>%
read_tsv()
usethis::use_data(cytobands_hg38, overwrite = TRUE)
Binary file added data/cytobands_grch37.rda
Binary file not shown.
Binary file added data/cytobands_hg38.rda
Binary file not shown.
Loading

0 comments on commit ea80944

Please sign in to comment.