Skip to main content

AIRR Community Data Representation Standard reference library for antibody and TCR sequencing data.

Project description


Install in the usual manner from PyPI:

> pip3 install airr --user

Or from the downloaded source code directory:

> python3 install --user

Reading AIRR formatted files

The airr package contains functions to read and write AIRR data files as either iterables or pandas data frames. The usage is straightforward, as the file format is a typical tab delimited file, but the package performs some additional validation and type conversion beyond using a standard CSV reader.

import airr

# Create an iteratable that returns a dictionary for each row
reader = airr.read_rearrangement(open('input.tsv', 'r'))

# Load the entire file into a pandas data frame
df = airr.load_rearrangement(open('input.tsv', 'r'))

Writing AIRR formatted files

Similar to the read operations, write functions are provided for either creating a writer class to perform row-wise output or writing the entire contents of a pandas data frame to a file. Again, usage is straightforward with the airr output functions simply performing some type conversion and field ordering operations.

import airr

# Create a writer class for iterative row output
writer = airr.create_rearrangement(open('output.tsv', 'w'))
for row in reader:  writer.write(row)

# Write an entire pandas data frame to a file
airr.dump_rearrangement(df, open('file.tsv', 'w'))

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for airr, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size airr-1.1.0.tar.gz (33.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page