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(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.

Source Distribution

airr-1.1.0.tar.gz (33.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: airr-1.1.0.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for airr-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7f43b80abcf9c31d714fdea0c9900b8c391c67afe96088d282b651fbbed6e8a2
MD5 5914cbd8b22e6f24a6363f7afab58f3b
BLAKE2b-256 11b08fd015f82e0e4e9a2de32ecde43faed6a584bde8f6b8995550f733e09718

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