• Stars
    star
    201
  • Rank 183,584 (Top 4 %)
  • Language
    R
  • Created over 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Genomic Data Retrieval with R

biomartr

rstudio mirror downloads rstudio mirror downloads Paper link install with bioconda

Genomic Data Retrieval with R

Motivation:

This package is born out of my own frustration to automate the genomic data retrieval process to create computationally reproducible scripts for large-scale genomics studies. Since I couldn't find easy-to-use and fully reproducible software libraries I sat down and tried to implement a framework that would enable anyone to automate and standardize the genomic data retrieval process. I hope that this package is useful to others as well and that it helps to promote reproducible research in genomics studies.

I happily welcome anyone who wishes to contribute to this project :) Just drop me an email.

Please find a detailed documentation here.

Citation

Please cite biomartr if it was helpful for your research. This will allow me to continue maintaining this project in the future.

Drost HG, Paszkowski J. Biomartr: genomic data retrieval with R. Bioinformatics (2017) 33(8): 1216-1217. doi:10.1093/bioinformatics/btw821.

Short package description:

The vastly growing number of sequenced genomes allows us to perform a new type of biological research. Using a comparative approach these genomes provide us with new insights on how biological information is encoded on the molecular level and how this information changes over evolutionary time.

The first step, however, of any genome based study is to retrieve genomes and their annotation from databases. To automate the retrieval process of this information on a meta-genomic scale, the biomartr package provides interface functions for genomic sequence retrieval and functional annotation retrieval. The major aim of biomartr is to facilitate computational reproducibility and large-scale handling of genomic data for (meta-)genomic analyses. In addition, biomartr aims to address the genome version crisis. With biomartr users can now control and be informed about the genome versions they retrieve automatically. Many large scale genomics studies lack this information and thus, reproducibility and data interpretation become nearly impossible when documentation of genome version information gets neglected.

In detail, biomartr automates genome, proteome, CDS, RNA, Repeats, GFF/GTF (annotation), genome assembly quality, and metagenome project data retrieval from the major biological databases such as

Furthermore, an interface to the Ensembl Biomart database allows users to retrieve functional annotation for genomic loci using a novel and organism centric search strategy. In addition, users can download entire databases such as

  • NCBI RefSeq
  • NCBI nr
  • NCBI nt
  • NCBI Genbank
  • ENSEMBL

with only one command.

Similar Work

The main difference between the BiomaRt package and the biomartr package is that biomartr extends the functional annotation retrieval procedure of BiomaRt and in addition provides useful retrieval functions for genomes, proteomes, coding sequences, gff files, RNA sequences, Repeat Masker annotations files, and functions for the retrieval of entire databases such as NCBI nr etc.

Please consult the Tutorials section for more details.

In the context of functional annotation retrieval the biomartr package allows users to screen available marts using only the scientific name of an organism of interest instead of first searching for marts and datasets which support a particular organism of interest (which is required when using the BiomaRt package). Furthermore, biomartr allows you to search for particular topics when searching for attributes and filters. I am aware that the similar naming of the packages is unfortunate, but it arose due to historical reasons (please find a detailed explanation here: https://github.com/ropensci/biomartr/blob/master/FAQs.md and here #11).

I also dedicated an entire vignette to compare the BiomaRt and biomartr package functionality in the context of Functional Annotation (where their functionality overlaps which comprises about only 20% of the overall functionality of the biomartr package).

Feedback

I truly value your opinion and improvement suggestions. Hence, I would be extremely grateful if you could take this 1 minute and 3 question survey (https://goo.gl/forms/Qaoxxjb1EnNSLpM02) so that I can learn how to improve biomartr in the best possible way. Many many thanks in advance.

Installation

The biomartr package relies on some Bioconductor tools and thus requires installation of the following packages:

# Install core Bioconductor packages
if (!requireNamespace("BiocManager"))
    install.packages("BiocManager")
BiocManager::install()
# Install package dependencies
BiocManager::install("Biostrings")
BiocManager::install("biomaRt")

Now users can install biomartr from CRAN:

# install biomartr 1.0.4
install.packages("biomartr", dependencies = TRUE)

Installation with Bioconda

With an activated Bioconda channel (see 2. Set up channels), install with:

conda install r-biomartr

and update with:

conda update r-biomartr

or use the docker container:

docker pull quay.io/biocontainers/r-biomartr:<tag>

(check r-biomartr/tags for valid values for )

Example

Collection Retrieval

The automated retrieval of collections (= Genome, Proteome, CDS, RNA, GFF, Repeat Masker, AssemblyStats files) will make sure that the genome file of an organism will match the CDS, proteome, RNA, GFF, etc file and was generated using the same genome assembly version. One aspect of why genomics studies fail in computational and biological reproducibility is that it is not clear whether CDS, proteome, RNA, GFF, etc files used in a proposed analysis were generated using the same genome assembly file denoting the same genome assembly version. To avoid this seemingly trivial mistake we encourage users to retrieve genome file collections using the biomartr function getCollection() and attach the corresponding output as Supplementary Data to the respective genomics study to ensure computational and biological reproducibility.

# download collection for Saccharomyces cerevisiae
biomartr::getCollection( db = "refseq", organism = "Saccharomyces cerevisiae")

Internally, the getCollection() function will now generate a folder named refseq/Collection/Saccharomyces_cerevisiae and will store all genome and annotation files for Saccharomyces cerevisiae in the same folder. In addition, the exact genoem and annotation version will be logged in the doc folder.

Internally, a text file named doc_Saccharomyces_cerevisiae_db_refseq.txt is generated. The information stored in this log file is structured as follows:

File Name: Saccharomyces_cerevisiae_assembly_stats_refseq.txt
Organism Name: Saccharomyces_cerevisiae
Database: NCBI refseq
URL: ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/146/045/GCF_000146045.2_R64/GCF_000146045.2_R64_assembly_stats.txt
Download_Date: Wed Jun 27 15:21:51 2018
refseq_category: reference genome
assembly_accession: GCF_000146045.2
bioproject: PRJNA128
biosample: NA
taxid: 559292
infraspecific_name: strain=S288C
version_status: latest
release_type: Major
genome_rep: Full
seq_rel_date: 2014-12-17
submitter: Saccharomyces Genome Database

In an ideal world this reference file could then be included as supplementary information in any life science publication that relies on genomic information so that reproducibility of experiments and analyses becomes achievable.

Genome retrieval of hundreds of genomes using only one command

Download all mammalian vertebrate genomes from NCBI RefSeq via:

# download all vertebrate genomes
meta.retrieval(kingdom = "vertebrate_mammalian", db = "refseq", type = "genome")

All geneomes are stored in the folder named according to the kingdom. In this case vertebrate_mammalian. Alternatively, users can specify the out.folder argument to define a custom output folder path.

Frequently Asked Questions (FAQs)

Please find all FAQs here.

Discussions and Bug Reports

I would be very happy to learn more about potential improvements of the concepts and functions provided in this package.

Furthermore, in case you find some bugs or need additional (more flexible) functionality of parts of this package, please let me know:

https://github.com/HajkD/biomartr/issues

Tutorials

Getting Started with biomartr:

Users can also read the tutorials within (Posit (former RStudio)) :

# source the biomartr package
library(biomartr)

# look for all tutorials (vignettes) available in the biomartr package
# this will open your web browser
browseVignettes("biomartr")

NEWS

The current status of the package as well as a detailed history of the functionality of each version of biomartr can be found in the NEWS section.

Install Developer Version

Some bug fixes or new functionality will not be available on CRAN yet, but in the developer version here on GitHub. To download and install the most recent version of biomartr run:

# install the current version of biomartr on your system
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("ropensci/biomartr")

Genomic Data Retrieval

Meta-Genome Retrieval

  • meta.retrieval() : Perform Meta-Genome Retieval from NCBI of species belonging to the same kingdom of life or to the same taxonomic subgroup
  • meta.retrieval.all() : Perform Meta-Genome Retieval from NCBI of the entire kingdom of life
  • getMetaGenomes() : Retrieve metagenomes from NCBI Genbank
  • getMetaGenomeAnnotations() : Retrieve annotation *.gff files for metagenomes from NCBI Genbank
  • listMetaGenomes() : List available metagenomes on NCBI Genbank
  • getMetaGenomeSummary() : Helper function to retrieve the assembly_summary.txt file from NCBI genbank metagenomes
  • clean.retrieval(): Format meta.retrieval output

Genome Retrieval

  • listGenomes() : List all genomes available on NCBI and ENSEMBL servers
  • listKingdoms() : list the number of available species per kingdom of life on NCBI and ENSEMBL servers
  • listGroups() : list the number of available species per group on NCBI and ENSEMBL servers
  • getKingdoms() : Retrieve available kingdoms of life
  • getGroups() : Retrieve available groups for a kingdom of life
  • is.genome.available() : Check Genome Availability NCBI and ENSEMBL servers
  • getCollection() : Retrieve a Collection: Genome, Proteome, CDS, RNA, GFF, Repeat Masker, AssemblyStats
  • getGenome() : Download a specific genome stored on NCBI and ENSEMBL servers
  • getGenomeSet() : Genome Retrieval of multiple species
  • getProteome() : Download a specific proteome stored on NCBI and ENSEMBL servers
  • getProteomeSet() : Proteome Retrieval of multiple species
  • getCDS() : Download a specific CDS file (genome) stored on NCBI and ENSEMBL servers
  • getCDSSet() : CDS Retrieval of multiple species
  • getRNA() : Download a specific RNA file stored on NCBI and ENSEMBL servers
  • getRNASet() : RNA Retrieval of multiple species
  • getGFF() : Genome Annotation Retrieval from NCBI (*.gff) and ENSEMBL (*.gff3) servers
  • getGTF() : Genome Annotation Retrieval (*.gtf) from ENSEMBL servers
  • getRepeatMasker() : Repeat Masker TE Annotation Retrieval
  • getAssemblyStats() : Genome Assembly Stats Retrieval from NCBI
  • getKingdomAssemblySummary() : Helper function to retrieve the assembly_summary.txt files from NCBI for all kingdoms
  • getMetaGenomeSummary() : Helper function to retrieve the assembly_summary.txt files from NCBI genbank metagenomes
  • getSummaryFile() : Helper function to retrieve the assembly_summary.txt file from NCBI for a specific kingdom
  • getENSEMBLInfo() : Retrieve ENSEMBL info file
  • getGENOMEREPORT() : Retrieve GENOME_REPORTS file from NCBI

Import Downloaded Files

  • read_genome() : Import genomes as Biostrings or data.table object
  • read_proteome() : Import proteome as Biostrings or data.table object
  • read_cds() : Import CDS as Biostrings or data.table object
  • read_gff() : Import GFF file
  • read_rna() : Import RNA file
  • read_rm() : Import Repeat Masker output file
  • read_assemblystats() : Import Genome Assembly Stats File

Database Retrieval

  • listNCBIDatabases() : Retrieve a List of Available NCBI Databases for Download
  • download.database() : Download a NCBI database to your local hard drive
  • download.database.all() : Download a complete NCBI Database such as e.g. NCBI nr to your local hard drive

BioMart Queries

  • biomart() : Main function to query the BioMart database
  • getMarts() : Retrieve All Available BioMart Databases
  • getDatasets() : Retrieve All Available Datasets for a BioMart Database
  • getAttributes() : Retrieve All Available Attributes for a Specific Dataset
  • getFilters() : Retrieve All Available Filters for a Specific Dataset
  • organismBM() : Function for organism specific retrieval of available BioMart marts and datasets
  • organismAttributes() : Function for organism specific retrieval of available BioMart attributes
  • organismFilters() : Function for organism specific retrieval of available BioMart filters

Performing Gene Ontology queries

Gene Ontology

  • getGO() : Function to retrieve GO terms for a given set of genes

Download Developer Version On Windows Systems

# On Windows, this won't work - see ?build_github_devtools
install_github("HajkD/biomartr", build_vignettes = TRUE, dependencies = TRUE)

# When working with Windows, first you need to install the
# R package: rtools -> install.packages("rtools")

# Afterwards you can install devtools -> install.packages("devtools")
# and then you can run:

devtools::install_github("HajkD/biomartr", build_vignettes = TRUE, dependencies = TRUE)

# and then call it from the library
library("biomartr", lib.loc = "C:/Program Files/R/R-3.1.1/library")

Code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

More Repositories

1

drake

An R-focused pipeline toolkit for reproducibility and high-performance computing
R
1,328
star
2

skimr

A frictionless, pipeable approach to dealing with summary statistics
HTML
1,090
star
3

targets

Function-oriented Make-like declarative workflows for R
R
829
star
4

rtweet

🐦 R client for interacting with Twitter's [stream and REST] APIs
R
785
star
5

tabulizer

Bindings for Tabula PDF Table Extractor Library
R
518
star
6

pdftools

Text Extraction, Rendering and Converting of PDF Documents
C++
489
star
7

assertr

Assertive programming for R analysis pipelines
R
457
star
8

magick

Magic, madness, heaven, sin
R
440
star
9

visdat

Preliminary Exploratory Visualisation of Data
R
439
star
10

stplanr

Sustainable transport planning with R
R
410
star
11

RSelenium

An R client for Selenium Remote WebDriver
R
332
star
12

rnoaa

R interface to many NOAA data APIs
R
320
star
13

osmdata

R package for downloading OpenStreetMap data
C++
305
star
14

charlatan

Create fake data in R
R
283
star
15

software-review

rOpenSci Software Peer Review.
R
274
star
16

iheatmapr

Complex, interactive heatmaps in R
R
259
star
17

taxize

A taxonomic toolbelt for R
R
250
star
18

rrrpkg

Use of an R package to facilitate reproducible research
248
star
19

elastic

R client for the Elasticsearch HTTP API
R
244
star
20

tesseract

Bindings to Tesseract OCR engine for R
R
236
star
21

qualtRics

Download ⬇️ Qualtrics survey data directly into R!
R
207
star
22

git2r

R bindings to the libgit2 library
C
204
star
23

writexl

Portable, light-weight data frame to xlsx exporter for R
C
202
star
24

rnaturalearth

An R package to hold and facilitate interaction with natural earth map data 🌍
R
191
star
25

googleLanguageR

R client for the Google Translation API, Google Cloud Natural Language API and Google Cloud Speech API
HTML
189
star
26

textreuse

Detect text reuse and document similarity
R
188
star
27

tokenizers

Fast, Consistent Tokenization of Natural Language Text
R
179
star
28

rentrez

talk with NCBI entrez using R
R
178
star
29

piggyback

πŸ“¦ for using large(r) data files on GitHub
R
172
star
30

rcrossref

R client for various CrossRef APIs
R
159
star
31

osmextract

Download and import OpenStreetMap data from Geofabrik and other providers
R
157
star
32

dataspice

🌢️ Create lightweight schema.org descriptions of your datasets
R
155
star
33

tic

Tasks Integrating Continuously: CI-Agnostic Workflow Definitions
R
154
star
34

webchem

Chemical Information from the Web
R
149
star
35

geojsonio

Convert many data formats to & from GeoJSON & TopoJSON
R
148
star
36

MODIStsp

An "R" package for automatic download and preprocessing of MODIS Land Products Time Series
R
147
star
37

rgbif

Interface to the Global Biodiversity Information Facility API
R
145
star
38

DataPackageR

An R package to enable reproducible data processing, packaging and sharing.
R
145
star
39

tsbox

tsbox: Class-Agnostic Time Series in R
R
143
star
40

dev_guide

rOpenSci Packages: Development, Maintenance, and Peer Review
R
141
star
41

jqr

R interface to jq
R
139
star
42

ghql

GraphQL R client
R
136
star
43

osfr

R interface to the Open Science Framework (OSF)
R
135
star
44

osmplotr

Data visualisation using OpenStreetMap objects
R
130
star
45

opencv

R bindings for OpenCV
C++
130
star
46

ssh

Native SSH client in R based on libssh
C
126
star
47

RefManageR

R package RefManageR
R
112
star
48

spocc

Species occurrence data toolkit for R
R
109
star
49

tarchetypes

Archetypes for targets and pipelines
R
107
star
50

ezknitr

Avoid the typical working directory pain when using 'knitr'
R
107
star
51

hunspell

High-Performance Stemmer, Tokenizer, and Spell Checker for R
C++
106
star
52

crul

R6 based http client for R (made for developers)
R
101
star
53

gistr

Interact with GitHub gists from R
R
101
star
54

spelling

Tools for Spell Checking in R
R
101
star
55

rfishbase

R interface to the fishbase.org database
R
100
star
56

weathercan

R package for downloading weather data from Environment and Climate Change Canada
R
99
star
57

git2rdata

An R package for storing and retrieving data.frames in git repositories.
R
98
star
58

bib2df

Parse a BibTeX file to a tibble
R
97
star
59

ckanr

R client for the CKAN API
R
97
star
60

gutenbergr

Search and download public domain texts from Project Gutenberg
R
95
star
61

rsvg

SVG renderer for R based on librsvg2
C
95
star
62

nasapower

API Client for NASA POWER Global Meteorology, Surface Solar Energy and Climatology in R
R
92
star
63

EML

Ecological Metadata Language interface for R: synthesis and integration of heterogenous data
R
92
star
64

cyphr

:shipit: Humane encryption
R
91
star
65

FedData

Functions to Automate Downloading Geospatial Data Available from Several Federated Data Sources
R
88
star
66

av

Working with Video in R
C
88
star
67

mapscanner

R package to print maps, draw on them, and scan them back in
R
87
star
68

UCSCXenaTools

πŸ“¦ An R package for accessing genomics data from UCSC Xena platform, from cancer multi-omics to single-cell RNA-seq https://cran.r-project.org/web/packages/UCSCXenaTools/
R
87
star
69

opencage

🌐 R package for the OpenCage API -- both forward and reverse geocoding 🌐
R
86
star
70

tidync

NetCDF exploration and data extraction
R
85
star
71

GSODR

API Client for Global Surface Summary of the Day ('GSOD') Weather Data Client in R
R
82
star
72

rzmq

R package for ZMQ
C++
82
star
73

bikedata

🚲 Extract data from public hire bicycle systems
R
79
star
74

historydata

Datasets for Historians
R
78
star
75

dittodb

dittodb: A Test Environment for DB Queries in R
R
78
star
76

arkdb

Archive and unarchive databases as flat text files
R
78
star
77

fingertipsR

R package to interact with Public Health England’s Fingertips data tool
R
78
star
78

smapr

An R package for acquisition and processing of NASA SMAP data
R
77
star
79

vcr

Record HTTP calls and replay them
R
76
star
80

nodbi

Document DBI connector for R
R
75
star
81

CoordinateCleaner

Automated flagging of common spatial and temporal errors in biological and palaeontological collection data, for the use in conservation, ecology and palaeontology.
HTML
74
star
82

openalexR

Getting bibliographic records from OpenAlex
R
74
star
83

opentripplanner

An R package to set up and use OpenTripPlanner (OTP) as a local or remote multimodal trip planner.
R
73
star
84

nlrx

nlrx NetLogo R
R
71
star
85

rebird

Wrapper to the eBird API
R
70
star
86

gittargets

Data version control for reproducible analysis pipelines in R with {targets}.
R
69
star
87

tidyhydat

An R package to import Water Survey of Canada hydrometric data and make it tidy
R
69
star
88

robotstxt

robots.txt file parsing and checking for R
R
68
star
89

slopes

Package to calculate slopes of roads, rivers and trajectories
R
65
star
90

tradestatistics

R package to access Open Trade Statistics API
R
65
star
91

terrainr

Get DEMs and orthoimagery from the USGS National Map, georeference your images and merge rasters, and visualize with Unity 3D
R
64
star
92

unconf17

Website for 2017 rOpenSci Unconf
JavaScript
64
star
93

NLMR

πŸ“¦ R package to simulate neutral landscape models πŸ”
R
63
star
94

roadoi

Use Unpaywall with R
R
63
star
95

parzer

Parse geographic coordinates
R
63
star
96

tiler

Generate geographic and non-geographic map tiles from R
R
63
star
97

rb3

A bunch of downloaders and parsers for data delivered from B3
R
62
star
98

rWBclimate

R interface for the World Bank climate data
R
62
star
99

codemetar

an R package for generating and working with codemeta
R
62
star
100

aRxiv

Programmatic interface to the Arxiv API
R
58
star