Skip to content

Commit

Permalink
Funciton examples updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mattssca committed Feb 7, 2024
1 parent fa49ce8 commit a634197
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 46 deletions.
22 changes: 11 additions & 11 deletions R/cyto_ranger.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@
#'
#' @examples
#' #' #Example 1 - Give the function one region as a string
#' my_region = cyto_ranger(these_regions = "chr8:127735434-127742951")
#' cyto_ranger(these_regions = "chr8:127735434-127742951")
#'
#' #Example 2 - Give the function multiple regions as a string
#' my_regions = cyto_ranger(these_regions = c("chr8:128747680-128753674",
#' "chr18:60790579-60987361"),
#' projection = "grch37")
#' cyto_ranger(these_regions = c("chr8:128747680-128753674",
#' "chr18:60790579-60987361"),
#' projection = "grch37")
#'
#' #Example 3 - Individually specify the chromosome, start and end coordinates
#' this_region = cyto_ranger(qchrom = "chr8",
#' qstart = 127735434,
#' qend = 127742951)
#' cyto_ranger(qchrom = "chr8",
#' qstart = 127735434,
#' qend = 127742951)
#'
#' #Example 4 - Individually specify multiple regions with the query parameters
#' these_regions = cyto_ranger(qchrom = c("chr8", "chr18"),
#' qstart = c(128747680, 60790579),
#' qend = c(128753674, 60987361),
#' projection = "grch37")
#' cyto_ranger(qchrom = c("chr8", "chr18"),
#' qstart = c(128747680, 60790579),
#' qend = c(128753674, 60987361),
#' projection = "grch37")
#'
cyto_ranger <- function(these_regions = NULL,
qchrom = NULL,
Expand Down
10 changes: 5 additions & 5 deletions R/gene_ranger.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@
#'
#' @examples
#' #Example 1 - Request one gene (in Hugo format) and with default parameters
#' hugo_myc = gene_ranger(these_genes = "MYC")
#' gene_ranger(these_genes = "MYC")
#'
#' #Example 2 - Same as example one but MYC is here specified as Ensembl ID
#' ensembl_myc = gene_ranger(these_genes = "ENSG00000136997")
#' gene_ranger(these_genes = "ENSG00000136997")
#'
#' #Example 3 - Request multiple genes with non-default parameters
#' my_genes = gene_ranger(these_genes = c("MYC", "BCL2"),
#' gene_ranger(these_genes = c("MYC", "BCL2"),
#' projection = "grch37",
#' return_as = "region")
#'
#' #Example 4 - Request multiple Ensembl IDs and return in bed format
#' my_bed = gene_ranger(these_genes = c("ENSG00000136997", "ENSG00000171791"),
#' return_as = "bed")
#' gene_ranger(these_genes = c("ENSG00000136997", "ENSG00000171791"),
#' return_as = "bed")
#'
#' #Example 5 - Write to bed file
#' gene_ranger(these_genes = c("BCL2", "MYC"),
Expand Down
12 changes: 6 additions & 6 deletions R/get_gene_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
#'
#' @examples
#' #Example 1 - Query one gene (in Hugo format) and with default parameters.
#' hugo_myc = get_gene_info(these_genes = "MYC")
#' get_gene_info(these_genes = "MYC")
#'
#' #Example 2 - Same as example 1 but MYC is here specified as Ensembl ID.
#' ensembl_myc = get_gene_info(these_genes = "ENSG00000136997")
#' get_gene_info(these_genes = "ENSG00000136997")
#'
#' #Example 3 - Request multiple genes with non-default parameters
#' hugo_genes = get_gene_info(these_genes = c("MYC", "BCL2"),
#' projection = "grch37")
#' get_gene_info(these_genes = c("MYC", "BCL2"),
#' projection = "grch37")
#'
#' #Example 4 - Request multiple Ensembl IDs and return all columns.
#' ensembl_genes = get_gene_info(these_genes = c("ENSG00000136997", "ENSG00000171791"),
#' raw = TRUE)
#' get_gene_info(these_genes = c("ENSG00000136997", "ENSG00000171791"),
#' raw = TRUE)
#'
get_gene_info <- function(these_genes = NULL,
projection = "hg38",
Expand Down
4 changes: 3 additions & 1 deletion R/purify_chr.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#' @examples
#' #Example 1 - Add prefixes to a data frame
#' my_data = data.frame(chrom = c("1", "2", "3"))
#' my_data = purify_chr(projection = "hg38", incoming_table = my_data)
#'
#' purify_chr(projection = "hg38",
#' incoming_table = my_data)
#'
purify_chr <- function(projection = NULL,
incoming_table = NULL) {
Expand Down
20 changes: 10 additions & 10 deletions R/purify_regions.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@
#'
#' @examples
#' #Example 1 - Give the function one region as a string
#' my_region = purify_regions(these_regions = "chr1:100-500")
#' purify_regions(these_regions = "chr1:100-500")
#'
#' #Example 2 - Give the function multiple regions as a string
#' my_regions = purify_regions(these_regions = c("chr1:100-500", "chr2:100-500"),
#' projection = "grch37")
#' purify_regions(these_regions = c("chr1:100-500", "chr2:100-500"),
#' projection = "grch37")
#'
#' #Example 3 - Individually specify the chromosome, start and end coordinates
#' this_region = purify_regions(qchrom = "chr1",
#' qstart = 100,
#' qend = 500)
#' purify_regions(qchrom = "chr1",
#' qstart = 100,
#' qend = 500)
#'
#' #Example 4 - Individually specify multiple regions with the query parameters
#' these_regions = purify_regions(qchrom = c("chr1", "chr2"),
#' qstart = c(100, 200),
#' qend = c(500, 600),
#' projection = "grch37")
#' purify_regions(qchrom = c("chr1", "chr2"),
#' qstart = c(100, 200),
#' qend = c(500, 600),
#' projection = "grch37")
#'
purify_regions <- function(these_regions = NULL,
qchrom = NULL,
Expand Down
25 changes: 12 additions & 13 deletions R/region_ranger.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,23 @@
#'
#' @examples
#' #Example 1 - Give the function one region as a string
#' my_region = region_ranger(these_regions = "chr8:127735434-127742951")
#' region_ranger(these_regions = "chr8:127735434-127742951")
#'
#' #Example 2 - Give the function multiple regions as a string
#' my_regions = region_ranger(these_regions = c("chr8:128747680-128753674",
#' "chr18:60790579-60987361"),
#' projection = "grch37")
#'
#' region_ranger(these_regions = c("chr8:128747680-128753674",
#' "chr18:60790579-60987361"),
#' projection = "grch37")
#'
#' #Example 3 - Individually specify the chromosome, start and end coordinates
#' this_region = region_ranger(qchrom = "chr8",
#' qstart = 127735434,
#' qend = 127742951)
#' region_ranger(qchrom = "chr8",
#' qstart = 127735434,
#' qend = 127742951)
#'
#' #Example 4 - Individually specify multiple regions with the query parameters
#' these_regions = region_ranger(qchrom = c("chr8", "chr18"),
#' qstart = c(128747680, 60790579),
#' qend = c(128753674, 60987361),
#' projection = "grch37")
#'
#' region_ranger(qchrom = c("chr8", "chr18"),
#' qstart = c(128747680, 60790579),
#' qend = c(128753674, 60987361),
#' projection = "grch37")
#'
region_ranger <- function(these_regions = NULL,
qchrom = NULL,
Expand Down

0 comments on commit a634197

Please sign in to comment.