Skip to main content

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

Project description

Installation

Install in the usual manner from PyPI:

> pip3 install airr --user

Or from the downloaded source code directory:

> python3 setup.py 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('input.tsv')

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

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('output.tsv')
for row in reader:  writer.write(row)

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

Project details


Download files

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

Source Distribution

airr-1.2.0.tar.gz (34.9 kB view details)

Uploaded Source

File details

Details for the file airr-1.2.0.tar.gz.

File metadata

  • Download URL: airr-1.2.0.tar.gz
  • Upload date:
  • Size: 34.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.3.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.6.6

File hashes

Hashes for airr-1.2.0.tar.gz
Algorithm Hash digest
SHA256 187d8ad2a24e4c36ce7fba0a3d9ce7f4f9bfd8f410ff37e466a5f112ec359fb8
MD5 ba9047973c6b2aaf69bfb4744490d5bc
BLAKE2b-256 44bc4e76698ab4318e7431ada038fb13ed1c50a01135927cf181e6c6b32824f5

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page