Package 'D3GB'

Title: Interactive Genome Browser
Description: Creates interactive genome browser. It joins the data analysis power of 'R' and the visualization libraries of 'JavaScript' in one package. Barrios, D. & Prieto, C. (2017) <doi:10.1089/cmb.2016.0213>.
Authors: Carlos Prieto [aut, cph, cre] , David Barrios [aut]
Maintainer: Carlos Prieto <[email protected]>
License: GPL-2 | GPL-3
Version: 2.0
Built: 2024-11-27 06:28:18 UTC
Source: CRAN

Help Index


Creates a genome assembly for genomebrowser or genomemap.

Description

createAssembly create assemblies for their use as parameter of genomebrowser or genomemap.

Usage

createAssembly(name, size)

Arguments

name

a vector with the chomosome or scaffold names.

size

a vector with the chomosome or scaffold sizes.

Value

a data frame in BED format to be used as an assembly in genomebrowser or genomemap.

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/

See Also

The ‘D3GB’ Website: http://d3gb.usal.es

genomebrowser, genomemap.

Examples

# A Micromonospora scaffolds' names and sizes
scaffolds <- c("NZ_HF570105.1", "NZ_HF570106.1", "NZ_HF570107.1", "NZ_HF570108.1")
sizes <- c(583, 1327, 241394, 7082520)

# Create an assembly
createAssembly(scaffolds, sizes)

Interactive genome browsers with R

Description

Create interactive genome browsers with 'R'.

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/


Generates an interactive genome browser.

Description

gbk2genomebrowser creates an interactive genome browser from a GenBank file.

Usage

gbk2genomebrowser(gbkfile)

Arguments

gbkfile

a "character" string representing the input GenBank file to be represented in the genome browser.

Value

Object of class genomebrowser.

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/

Examples

# Download GenBank file
gbff <- tempfile()
download.file(paste0("https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/297/395/",
"GCF_000297395.2_ASM29739v2/GCF_000297395.2_ASM29739v2_genomic.gbff.gz"),gbff)

# Genome browser generation.
gb <- gbk2genomebrowser(gbff)

plot(gb)

Add track in a gff file to genomebrowser.

Description

genome_addGFF add track in a gff file to genomebrowser.

Usage

genome_addGFF(gb, gfffile)

Arguments

gb

a genome browser object produced by the function genomebrowser.

gfffile

a "character" string representing the input gff file to be represented in the genome browser.

Value

No return value, called for side effects

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/

See Also

The ‘D3GB’ Website: http://d3gb.usal.es

genomebrowser, genome_addSequence, genome_addTrack, genome_addVCF.

Examples

# Download fasta file
fasta <- tempfile()
download.file(paste0("https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/297/395/",
"GCF_000297395.2_ASM29739v2/GCF_000297395.2_ASM29739v2_genomic.fna.gz"),fasta)

# Genome browser generation.
gb <- genomebrowser(getAssemblyFromFasta(fasta))

genome_addSequence(gb,fasta)

# Download gff file and add to the genome browser
gff <- tempfile()
download.file(paste0("https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/297/395/",
"GCF_000297395.2_ASM29739v2/GCF_000297395.2_ASM29739v2_genomic.gff.gz"),gff)

genome_addGFF(gb,gff)

plot(gb)

Add genome sequence on Fasta format to genomebrowser.

Description

genome_addSequence add FASTA sequences to genomeviewer.

Usage

genome_addSequence(gb, fastafile)

Arguments

gb

a genome browser object produced by the function genomebrowser.

fastafile

a "character" string representing the input Fasta file to be added in the genome browser.

Value

No return value, called for side effects

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/

See Also

The ‘D3GB’ Website: http://d3gb.usal.es

genomebrowser, genome_addGFF, genome_addTrack, genome_addVCF.

Examples

# Download fasta file
fasta <- tempfile()
download.file(paste0("https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/297/395/",
"GCF_000297395.2_ASM29739v2/GCF_000297395.2_ASM29739v2_genomic.fna.gz"),fasta)

# Genome browser generation.
gb <- genomebrowser(getAssemblyFromFasta(fasta))

genome_addSequence(gb,fasta)

plot(gb)

Add tracks to genomebrowser.

Description

genome_addTrack add tracks to genomebrowser.

Usage

genome_addTrack(gb, track, trackname = NULL, type = "gene", color = "#000", scale = NA)

Arguments

gb

a genome browser object produced by the function genomebrowser.

track

a "character" string giving the input BED file or a data frame with track information to be represented in the genome browser.

trackname

a "character" string giving a name for the track.

type

a "character" string with the type of track should be drawn. Possible types are: "gene", "exons", "domain", "value" or "score".

color

a "character" string giving the color of the track.

scale

a vector with two values which specifies the minimun and maximun limits in the representation of the "score" or "value" tracks. By default maximun and minimun scores are taken as the limits.

Value

No return value, called for side effects

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/


Add VCF tracks to genomebrowser.

Description

genome_addVCF add VCF tracks to genomebrowser.

Usage

genome_addVCF(gb, vcffile, trackname = NULL, show = NULL)

Arguments

gb

a genome browser object produced by the function genomebrowser.

vcffile

a "character" string representing the input VCF file to be represented in the genome browser.

trackname

a "character" string giving a name for the track.

show

a "character" vector giving the info features to display.

Value

No return value, called for side effects

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/


Generates an interactive genome browser.

Description

genome_createLocalMode creates an interactive genome browser to open directly in your browser.

Usage

genome_createLocalMode(gb, dir="GenomeBrowser")

Arguments

gb

a genome browser object produced by the function genomebrowser.

dir

a "character" string representing the directory where the graph will be saved.

Value

The function creates a folder in the working directory of your computer with an HTML document (index.html) which contains the graph. This file can be directly opened with your browser.

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/

See Also

The ‘D3GB’ Website: http://d3gb.usal.es

genomebrowser, createAssembly, getAssemblyFromFasta, GRCh37.bands, GRCh38.bands, genome_addGFF, genome_addSequence, genome_addTrack, genome_addVCF.

Examples

# Genome browser generation.
gb <- genomebrowser(GRCh38.bands)
# It creates a genome browser ready to be viewed in your browser.
genome_createLocalMode(gb,dir=tempfile())

Generates an interactive genome browser.

Description

genome_createServerMode creates an interactive genome browser to be shared as a website.

Usage

genome_createServerMode(gb, dir="GenomeBrowser")

Arguments

gb

a genome browser object produced by the function genomebrowser.

dir

a "character" string representing the directory where the graph will be saved.

Value

The function creates a website. Resulting folder should be added to the Apache applications directory. In this way the genome browser will be working as a web site.

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/

See Also

The ‘D3GB’ Website: http://d3gb.usal.es

genomebrowser, createAssembly, getAssemblyFromFasta, GRCh37.bands, GRCh38.bands, genome_addGFF, genome_addSequence, genome_addTrack, genome_addVCF.

Examples

# Genome browser generation.
gb <- genomebrowser(GRCh38.bands)
# It creates a website. You can add it to your Apache server.
genome_createServerMode(gb,dir=tempfile())

Generates an interactive genome browser.

Description

genomebrowser creates an interactive genome browser.

Usage

genomebrowser(assembly, tracks = NULL, types = NA, colors = NA, mapTrack = NULL)

Arguments

tracks

a list of data frames with track information that will be viewed in the genome browser. These data frames should have a BED format with the following columns: chromosome/scaffold, start, end, name, score, strand.

types

a "character" vector with type of tracks that will be represented. It should be one of: "gene", "exons", "domain", "value" or "score".

colors

a "character" vector with color used for the track representation.

mapTrack

a data frame with values to represent on the genome map in BED format: chromosome, start, end, name, value.

assembly

a genome assembly data frame. D3GB provides human assemblies (NCBI36, GRCh37, GRCh38), human assemblies with cytobands (GRCh37.bands or GRCh38.bands), or methods for creating your own assembly from a FASTA file getAssemblyFromFasta.

Value

Object of class genomebrowser.

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/

See Also

The ‘D3GB’ Website: http://d3gb.usal.es

createAssembly, getAssemblyFromFasta, GRCh37.bands, GRCh38.bands, genome_addGFF, genome_addSequence, genome_addTrack, genome_addVCF.

Examples

# Genome browser generation.
gb <- genomebrowser(GRCh38.bands)
# Now you can add sequences, tracks, gff or vcf

Create an interative genome map.

Description

genomemap creates an interactive genome map.

Usage

genomemap(assembly, mapTrack = NULL)

Arguments

assembly

a genome assembly data frame. D3GB provides human assemblies (NCBI36, GRCh37, GRCh38), human assemblies with cytobands (GRCh37.bands or GRCh38.bands), or methods for creating your own assembly from a FASTA file getAssemblyFromFasta.

mapTrack

a data frame with values to represent on the genome map in BED format: chromosome, start, end, name, value.

Value

Object of class genomebrowser.

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/

See Also

The ‘D3GB’ Website: http://d3gb.usal.es

createAssembly, getAssemblyFromFasta, GRCh37.bands, GRCh38.bands.

Examples

gm <- genomemap(GRCh38.bands)

Create an assembly from a FASTA file for its use as parameter of genomebrowser or genomemap.

Description

getAssemblyFromFasta create assemblies from a FASTA file for their use as parameter of genomebrowser or genomemap.

Usage

getAssemblyFromFasta(fasta)

Arguments

fasta

a "character" string representing the input Fasta file to be added in the genome browser.

Value

a data frame in BED format ready to use as an assembly in genomebrowser or genomemap.

Note

FASTA format is a text-based format for representing either nucleotide sequences or peptide sequences, in which nucleotides or amino acids are represented using single-letter codes.

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/

See Also

The ‘D3GB’ Website: http://d3gb.usal.es

genomebrowser, genomemap.

Examples

# Download fasta file
fasta <- tempfile()
download.file(paste0("https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/297/395/",
"GCF_000297395.2_ASM29739v2/GCF_000297395.2_ASM29739v2_genomic.fna.gz"),fasta)

# Assembly generation
getAssemblyFromFasta(fasta)

Length of human chromosomes based on GRCh37 assembly

Description

Length of human chromosomes based on GRCh37 assembly.

Value

A Data Frame containing length of chromosomes of GRCh37 assembly.

Source

See https://www.ncbi.nlm.nih.gov/assembly/GCF_000001405.13/.


Cytoband information based on GRCh37

Description

A Data Frame containing cytobands of GRCh37 assembly.

Value

A Data Frame containing cytobands of GRCh37 assembly.

Source

See https://grch37.ensembl.org/Homo_sapiens/Location/Genome.


Length of human chromosomes based on GRCh38 assembly

Description

Length of human chromosomes based on GRCh38 assembly.

Value

A Data Frame containing length of chromosomes of GRCh38 assembly.

Source

See https://www.ncbi.nlm.nih.gov/assembly/883148/.


Cytoband information based on GRCh38

Description

A Data Frame containing cytobands of GRCh38 assembly.

Value

A Data Frame containing cytobands of GRCh38 assembly.

Source

See https://www.ensembl.org/Homo_sapiens/Location/Genome.


Length of human chromosomes based on NCBI36 assembly

Description

Length of human chromosomes based on NCBI36 assembly.

Value

A Data Frame containing length of chromosomes of NCBI36 assembly.

Source

See https://www.ncbi.nlm.nih.gov/assembly/GCF_000001405.12/.


Function for segmentate tracks in BED format.

Description

segmentation performs a segmentation of track data in bed format in order to enable its effective representation.

Usage

segmentation(track, cell)

Arguments

track

a Data Frame with genomic features (in BED format).

cell

a numeric value with the size of each segment.

Value

a segmented Data Frame in BED format.

Note

Input file is provided in BED format which is an universal format for genomic features.

Author(s)

David Barrios and Carlos Prieto. Bioinformatics, University of Salamanca. See http://d3gb.usal.es/

See Also

The ‘D3GB’ Website: http://d3gb.usal.es

genomebrowser, genomemap, genome_addTrack.