knitr::opts_chunk$set(collapse = T, comment = "#>")
options(tibble.print_min = 4L, tibble.print_max = 4L)
library(infercna)
set.seed(1014)

Default Genomes

Different scRNA-seq datasets are built using different genome references, namely different species and different genome versions. infercna comes with a number of inbuilt genomes that can be configured to work with the package. See below for more information.

Note: Additional genomes / genome versions will be added in future releases of infercna.

List available genomes with availableGenomes()

Find out which genomes are available in infercna.

availableGenomes()

Check which genome is configured with currentGenome()

Note that the default genome that infercna is built to use is genome hg19. This is the penultimate release version of the H. sapiens genome. You can always check which genome is configured with infercna::currentGenome().

currentGenome()

Configure a different genome with useGenome()

You can configure infercna to work with one of the inbuilt genomes. Currently built-in genomes are the two latest versions of H. sapiens, hg38 and hg19 and the latest version of the M. musculus, mm10.

useGenome('mm10')
currentGenome()

Fetch genome data with retrieveGenome()

You can also get the genome data (in dataframe form). By default retrieveGenome will return the current genome in use, but you can instead specify a different genome in the function call.

retrieveGenome()

retrieveGenome(name = 'hg19')

retrieveGenome(name = 'hg38')

Genome data variables

The default genomes available in infercna have the following columns.

  1. symbol : gene name
  2. chromosome_name : chromosome name
  3. arm : chromosome arm
    • identical to chromosome_name in genome mm10
  4. start_position : of each gene
  5. end_position : of each gene
  6. band : chromosome band
  7. strand : chromosome strand
  8. ensembl_gene_id

Note: Only the first four columns amongst these are required if you intend to add your genome (discussed below in more detail).

User-defined Genomes

Add a new genome with addGenome()

In some cases you may need to configure infercna with your own genome, either because it is not built-in with infercna, or because it is a genome that you built yourself, tailored to your purposes.

Using infercna::addGenome, it is possible to configure infercna to use the genome of your choosing, so long as it meets the following requirements.

Note: addGenome will return an error if any of these requirements are not met.

Note: You can add a genome with as many additional columns as you like. For example, you may want to have end_position and band columns in addition to those listed above.

A dummy example

Data = data.frame(symbol = letters,
                  chromosome_name = factor(LETTERS),
                  arm = factor(LETTERS),
                  start_position = seq(1, length(letters)*2, by = 2),
                  end_position = seq(2, length(letters)*2, by = 2))

tibble::as_tibble(Data)

The default columns are those that are required for one or more of the following:

  1. Order the genes by their genomic position: chromosome_name, start_position + Note that the input ordering of symbol column does not matter.

  2. Split the genes by their chromosomal position: chromosome_name, arm + Note that you can additionally split genes by additional columns that you might add, such as band.

addGenome(genome = Data, name = 'dummyAlphabetGenome')

```r currentGenome() ````



jlaffy/infercna documentation built on Jan. 26, 2024, 11:24 p.m.