Since the use of High-throughput sequencing (HTS) was first introduced to analyze
immunoglobulin (B-cell receptor, antibody) and T-cell receptor repertoires
(Freeman et al, 2009; Robins et al, 2009; Weinstein et al, 2009),
the increasing number of studies making use of this technique has produced enormous
amounts of data and there exists a pressing need to develop and adopt common standards,
protocols, and policies for generating and sharing data sets. The Adaptive Immune
Receptor Repertoire (AIRR) Community formed in
2015 to address this challenge (Breden et al, 2017) and has stablished the set of
minimal metadata elements (MiAIRR) required for describing published AIRR
datasets (Rubelt et al, 2017) as well as file formats to represent this data in a
machine-readable form. The airr
R package provide read, write and validation of data
following the AIRR Data Representation schemas. This vignette provides a set of
simple use examples.
The AIRR Community's recommendations for a minimal set of metadata that should be used to describe an AIRR-seq data set when published or deposited in a AIRR-compliant public repository are described in Rubelt et al, 2017. The primary aim of this effort is to make published AIRR datasets FAIR (findable, accessible, interoperable, reusable); with sufficient detail such that a person skilled in the art of AIRR sequencing and data analysis will be able to reproduce the experiment and data analyses that were performed.
Following this principles, V(D)J reference alignment annotations are saved in standard tab-delimited files (TSV) with associated metadata provided in accompanying YAML formatted files. The column names and field names in these files have been defined by the AIRR Data Representation Working Group using a controlled vocabulary of standardized terms and types to refer to each piece of information.
The airr
package contains the function read_rearrangement
to read and validate
files containing AIRR Rearrangement records, where a Rearrangement record describes
the collection of optimal annotations on a single sequence that has undergone V(D)J reference alignment.
The usage is straightforward, as the file format is a typical tabulated file.
The argument that needs attention is base
, with possible values "0"
and "1"
.
base
denotes the starting index for positional fields in the input file.
Positional fields are those that contain alignment coordinates and names
ending in "_start" and "_end". If the input file is using 1-based closed
intervals (R style), as defined by the standard, then positional fields will
not be modified under the default setting of base="1"
. If the input file is using
0-based coordinates with half-open intervals (python style), then
positional fields may be converted to 1-based closed
intervals using the argument base="0"
.
# Imports library(airr) library(tibble) # Read Rearrangement example file f1 <- system.file("extdata", "rearrangement-example.tsv.gz", package="airr") rearrangement <- read_rearrangement(f1) glimpse(rearrangement)
AIRR Data Model records, such as Repertoire and GermlineSet, can be read from either a YAML or JSON formatted file into a nested list.
# Read Repertoire example file f2 <- system.file("extdata", "repertoire-example.yaml", package="airr") repertoire <- read_airr(f2) glimpse(repertoire) # Read GermlineSet example file f3 <- system.file("extdata", "germline-example.json", package="airr") germline <- read_airr(f3) glimpse(germline)
The airr
package contains the function write_rearrangement
to write
Rearrangement records to the AIRR TSV format.
x1 <- file.path(tempdir(), "airr_out.tsv") write_rearrangement(rearrangement, x1)
AIRR Data Model records can be written to either YAML or JSON using the write_airr
function.
x2 <- file.path(tempdir(), "airr_repertoire_out.yaml") write_airr(repertoire, x2, format="yaml") x3 <- file.path(tempdir(), "airr_germline_out.json") write_airr(germline, x3, format="json")
The airr
package contains the function validate_rearrangement
to validate
tabular (data.frame
) Rearrangement records and AIRR Data Model objects, respectively.
# Validate Rearrangement data.frame validate_rearrangement(rearrangement) # Validate an AIRR Data Model validate_airr(repertoire) # Validate AIRR Data Model records individual validate_airr(germline, each=TRUE)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.