pyigmap

[UNDER DEVELOPMENT] Pipeline for mapping and annotating T- and B-cell receptor gene rearrangement sequences

https://github.com/bostongene/pyigmap

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: ncbi.nlm.nih.gov, zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary

Keywords

airr-seq amplicon bcr-repertoire bioinformatics immunology nextflow rna-seq sequencing tcr-repertoire workflow
Last synced: 6 months ago · JSON representation ·

Repository

[UNDER DEVELOPMENT] Pipeline for mapping and annotating T- and B-cell receptor gene rearrangement sequences

Basic Info
  • Host: GitHub
  • Owner: BostonGene
  • License: gpl-3.0
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 13.1 MB
Statistics
  • Stars: 4
  • Watchers: 3
  • Forks: 0
  • Open Issues: 20
  • Releases: 1
Topics
airr-seq amplicon bcr-repertoire bioinformatics immunology nextflow rna-seq sequencing tcr-repertoire workflow
Created almost 2 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog Contributing License Citation

README.md

pyigmap

DOI Nextflow run with docker run with podman

Introduction

pyIgMap is a Nextflow-driven and Python-based pipeline for extracting and summarizing antigen receptor gene rearrangements from sequencing data.

[!NOTE] The pipeline is built upon open source components commonly used for AIRR-seq data processing. The output is provided in AIRR format enabling downstream analysis with AIRR-compliant software such as Immcantation.

Quick start

  1. This pipeline requires Docker or Podman, Java 11 (or later, up to 21), Bash and Make tool.

[!NOTE] To install the Make tool execute: sudo apt install make

  1. Clone the repository and go inside:

bash git clone https://github.com/BostonGene/pyigmap.git cd pyigmap

[!TIP] If you have Ubuntu 20.10 (amd64) or higher, you can install requirements above using:
make install-docker or make install-podman
make install-java

  1. Install Nextflow, build V(D)J references and Docker container images with a single command:

bash make

[!TIP] To use a Podman as a container engine, run: make ENGINE=podman

  1. Start running your own analysis!

bash uv run nextflow main.nf \ -profile <docker/podman> \ --library <amplicon/rnaseq> \ --fq1 "R1.fastq.gz" \ --fq2 "R2.fastq.gz" \ --outdir "./results"

[!WARNING] Please provide pipeline parameters via the CLI or Nextflow -params-file option. Custom config files including those provided by the -c Nextflow option can be used to provide any configuration except for parameters; see docs.

Pipeline summary

pyigmap allows the processing of raw BCR/TCR sequencing data from bulk and targeted sequencing protocols. For more details on the supported protocols, please refer to the usage documentation.

1. FASTQ pre-processing

  • RNASeq-bulk:

    • Merging overlapping reads, joining non-overlapping reads with a selected insert size, and raw read quality control (Fastp).
  • AIRR-Seq (target):

    • Extracting the UMI from the reads (PyUMI).
    • Alignment-free clustering of UMI tagged reads with subsequent consensus generation (Calib).
    • Merging overlapping reads, saving not-overlapping reads, and raw read quality control (Fastp).

2. V(D)J mapping

  • RNASeq-bulk:

    • Fast detecting V(D)J junctions from FASTQ reads using a seed-based heuristic without initial alignment to database germline sequences (Vidjil).
    • Mapping previously identified junctions against IMGT reference and producing AIRR-formatted table (IgBLAST).
  • AIRR-Seq (target):

    • Mapping FASTQ reads against IMGT reference and producing AIRR-formatted table (IgBLAST).

3. Cleansing and aggregating clonotypes

  • RNASeq-bulk and AIRR-Seq (target):

    • Filter out chimeric clonotypes, that have different locus in V-/J-segments (except for TRA and TRD).
    • Store the best aligned V, D, J and C genes call.
    • Discard clonotypes with undefined nucleotide or amino acid in CDR3 sequence.
    • Aggregate clonotypes based on Levenstein distance of 1 and read count ratio and subsequent duplicate_count column calculation.
  • Only RNASeq-bulk:

    • Compute generation probabilities (pgen column) of CDR3 amino acid sequences and remove clonotypes with pgen values less than or equal to the selected threshold (OLGA).
    • Store clonotypes with the most weighted and frequent C-gene call and V-gene alignment call.

Usage

A typical command to run the pipeline from RNASeq-bulk sequencing data is:

bash uv run nextflow -profile <docker/podman> \ --library rnaseq \ --fq1 "R1.fastq.gz" \ --fq2 "R2.fastq.gz" \ --outdir "./results"

For common AIRR-Seq targeted sequencing protocols we provide pre-set parameters, including a parameter for specifying a UMI barcode pattern.

Here is an example command to process the data from the AIRR-Seq targeted protocol, where there is a 19-base pair UMI located between two adapters in the reverse FASTQ file:

bash uv run nextflow -profile <docker/podman> \ --library amplicon \ --fq1 "R1.fastq.gz" \ --fq2 "R2.fastq.gz" \ --fq2_pattern "^TGGTATCAACGCAGAGTAC(UMI:N{19})TCTTGGGGG" \ --outdir "./results"

You can also use public data from these databases by using a sample ID: GEO, SRA, EMBL-EBI, DDBJ, NIH Biosample and ENCODE:

bash uv run nextflow -profile <docker/podman> \ --library rnaseq \ --sample_id SRR3743469 \ --outdir "./results"

Alternatively, you can provide an HTTP/HTTPS/FTP link to your FASTQ files.

bash uv run nextflow -profile <docker/podman> \ --library amplicon \ --fq1 https://zenodo.org/records/11103555/files/fmba_TRAB_R1.fastq.gz \ --fq2 https://zenodo.org/records/11103555/files/fmba_TRAB_R2.fastq.gz \ --outdir "./results"

Benchmark datasets

Datasets for testing data processing of various AIRR-seq protocols can be found here: 10.5281/zenodo.11103555

Contributing

Contributions are more than welcome. See the CONTRIBUTING.md file for details.

Citations

An extensive list of references for the tools used by the pipeline can be found in the CITATIONS.md file.

License

Pyigmap is GNU GPL3 licensed.

Owner

  • Name: BostonGene
  • Login: BostonGene
  • Kind: organization

Citation (CITATIONS.md)

# BostonGene/pyigmap: Citations

## [Nextflow](https://pubmed.ncbi.nlm.nih.gov/28398311/)

> Di Tommaso P, Chatzou M, Floden EW, Barja PP, Palumbo E, Notredame C. Nextflow enables reproducible computational workflows. Nat Biotechnol. 2017 Apr 11;35(4):316-319. doi: 10.1038/nbt.3820. PubMed PMID: 28398311.

## [nf-core](https://pubmed.ncbi.nlm.nih.gov/32055031/)

> Ewels PA, Peltzer A, Fillinger S, Patel H, Alneberg J, Wilm A, Garcia MU, Di Tommaso P, Nahnsen S. The nf-core framework for community-curated bioinformatics pipelines. Nat Biotechnol. 2020 Mar;38(3):276-278. doi: 10.1038/s41587-020-0439-x. PubMed PMID: 32055031.

## Pipeline tools

- [ffq](https://doi.org/10.1093/bioinformatics/btac667)
  
  > Gálvez-Merchán Á, Min KHJ, Pachter L, Booeshaghi AS. Metadata retrieval from sequence databases with ffq. Bioinformatics. 2023 Jan 1;39(1):btac667. doi: 10.1093/bioinformatics/btac667. PMID: 36610997; PMCID: PMC9883619.

- [Calib](https://doi.org/10.1093/bioinformatics/bty888)
  > Baraa Orabi, Emre Erhan, Brian McConeghy, Stanislav V Volik, Stephane Le Bihan, Robert Bell, Colin C Collins, Cedric Chauve, Faraz Hach; Alignment-free clustering of UMI tagged DNA molecules, Bioinformatics, , bty888, 10.1093/bioinformatics/bty888

- [Fastp](https://doi.org/10.1093/bioinformatics/bty560)

  > Shifu Chen, Yanqing Zhou, Yaru Chen, Jia Gu, fastp: an ultra-fast all-in-one FASTQ preprocessor, Bioinformatics. 2018 Sept 1; 34(17):i884–i890. doi: 10.1093/bioinformatics/bty560.'

- [SeqKit](https://doi.org/doi:10.1371/journal.pone.0163962)

  > Wei Shen*, Botond Sipos, and Liuyang Zhao. 2024. SeqKit2: A Swiss Army Knife for Sequence and Alignment Processing. iMeta e191. doi:10.1002/imt2.191.

  > Wei Shen, Shuai Le, Yan Li*, and Fuquan Hu*. SeqKit: a cross-platform and ultrafast toolkit for FASTA/Q file manipulation. PLOS ONE. doi:10.1371/journal.pone.0163962. 

- [Vidjil](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5106020/)

  > Marc Duez et al., “Vidjil: A web platform for analysis of high-throughput repertoire sequencing”, PLOS ONE 2016, 11(11):e0166126 10.1371/journal.pone.0166126

  > Mathieu Giraud, Mikaël Salson, et al., “Fast multiclonal clusterization of V(D)J recombinations from high-throughput sequencing”, BMC Genomics 2014, 15:409 10.1186/1471-2164-15-409

- [IgBLAST](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3692102/)

  > Ye J, Ma N, Madden TL, Ostell JM. (2013). IgBLAST: an immunoglobulin variable domain sequence analysis tool. Nucleic Acids Res.

- [OLGA](https://doi.org/10.1093/bioinformatics/btz035)
  
  > Zachary Sethna, Yuval Elhanati, Curtis G Callan, Aleksandra M Walczak, Thierry Mora, OLGA: fast computation of generation probabilities of B- and T-cell receptor amino acid sequences and motifs, Bioinformatics, Volume 35, Issue 17, September 2019, Pages 2974–2981, 10.1093/bioinformatics/btz035

## Software packaging/containerisation tools

- [Docker](https://dl.acm.org/doi/10.5555/2600239.2600241)

  > Merkel, D. (2014). Docker: lightweight linux containers for consistent development and deployment. Linux Journal, 2014(239), 2. doi: 10.5555/2600239.2600241.

- [Podman](https://doi.org/10.5281/zenodo.4735634)
  > Heon, M. et . al . (2018) “Podman - : A tool for managing OCI containers and pods”. Zenodo. doi: 10.5281/zenodo.4735634.

GitHub Events

Total
  • Issues event: 3
  • Watch event: 2
  • Delete event: 2
  • Push event: 46
  • Pull request event: 3
  • Create event: 2
Last Year
  • Issues event: 3
  • Watch event: 2
  • Delete event: 2
  • Push event: 46
  • Pull request event: 3
  • Create event: 2

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 3
  • Total pull requests: 3
  • Average time to close issues: 6 months
  • Average time to close pull requests: N/A
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.67
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 3
  • Average time to close issues: 4 months
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mikessh (2)
  • nsyzrantsev (1)
Pull Request Authors
  • nsyzrantsev (2)
  • VEK239 (1)
Top Labels
Issue Labels
enhancement (2) steps/cdr3nt_error_corrector (1) steps/vidjil (1)
Pull Request Labels

Dependencies

bin/calib_dedup/Dockerfile docker
  • image latest build
  • python 3.9-bullseye build
bin/cdr3nt_error_corrector/Dockerfile docker
  • image latest build
  • python 3.9-bullseye build
bin/downloader/Dockerfile docker
  • python 3.9-bullseye build
bin/fastp/Dockerfile docker
  • image latest build
  • python 3.9-bullseye build
bin/igblast/Dockerfile docker
  • image latest build
  • python 3.9-bullseye build
bin/pyumi/Dockerfile docker
  • image latest build
  • python 3.9-bullseye build
bin/vidjil/Dockerfile docker
  • image latest build
  • python 3.9-bullseye build
bin/cdr3nt_error_corrector/requirements.in pypi
  • olga ==1.2.4
  • pandas ==2.1.4
bin/cdr3nt_error_corrector/requirements.txt pypi
  • numpy ==1.26.4
  • olga ==1.2.4
  • pandas ==2.1.4
  • python-dateutil ==2.8.2
  • pytz ==2023.3.post1
  • six ==1.16.0
  • tzdata ==2023.4
bin/pyumi/requirements.in pypi
  • pyfastx ==2.1.0
  • regex ==2024.5.15
bin/pyumi/requirements.txt pypi
  • pyfastx ==2.1.0
  • regex ==2024.5.15
pyproject.toml pypi