Skip to main content

RNA-APoGee

RNA-APoGee (RNA Alignment to Personal Genomes) is a package to align RNA-seq data while minimizing reference biases. It can also be used to align RNA-seq data to haplotype resolved variants. Currently, RNA-APoGee relies on the Olego aligner, although other aligners could be used instead.

Pre-requisites:

  • RNA-APoGee has only been tested on Linux and requires Python 3.
  • Olego must be installed and on your PATH.
  • samtools

Installation

pip install RNA-APoGee

Command line utilities

Alignment involves two steps:

  1. Generating a "personalized" genome that has the variants of the individual embedded into the reference genome.
  2. Aligning against the reference and the personal genome (or against two haplotypes) and then merging the two sets of alignment to pick the best alignment for each read.

Generating a personal genome

create_genomes creates versions of an input FASTA with sample-specific SNVs replacing reference bases.

If you have phased variants, you can create two VCFs corresponding to the variants of each haplotype and then create two versions of the reference by calling create_genomes twice, once for each haplotype (unfortunately currently this script ignores the phasing of the variants.)

create_genomes --fasta FASTA
               --vcf VCF
               --outdir OUTDIR
               [--samples SAMPLES]
               [--min_gq MIN_GQ]
               [--chunk CHUNK]

  --fasta FASTA      FASTA file that will be used as the base for generating
                     personal genomes. For each sample in the input VCF, an
                     individual genome will be created by substituting the
                     sample's SNVs into this base FASTA. SNVs will be
                     considered only if the FILTER field is PASS, and the
                     genotype quality is greater than <min_gq>.

  --vcf VCF          VCF with variant calls. Can have multiple samples.

  --outdir OUTDIR    Personal genome for sample <sample> will be in
                     <outdir>/<sample>.fa

  --samples SAMPLES  (Optional) Comma separated list of samples from the input VCF. If
                     provided, only the personal genomes for these samples
                     will be created, otherwise personal genomes for all
                     samples in the input VCF will be created.

  --min_gq MIN_GQ    (Optional) Minimum genotype quality to consider a variant

  --chunk CHUNK      (Optional) How many bases to keep in memory. Reduce if running OOM.

Aligning against the reference and the personal genome

apogee aligns RNA-seq data to a personalized genome. Each read (or read-pair in case of paired data) is aligned against two FASTAs (correponding to two haplotypes or to a reference with and without an individual's variants). Then for each read (or read-pair) the best alignment across the two FASTAs is chosen. The order in which the two references are given (i.e. which one is specified as ref_fasta and which one is specified as alt_fasta) does not matter. Note that a lot of intermediate files are created. If tmp_dir is specified, all intermediate files will be stored there, with a prefix matching the prefix of the output BAM. In this case, it's up to you to delete that directory. If tmp_dir is not specified a temporary directory will be created, in the same directory as the output BAM and then deleted (so all intermediate files will be lost).

apogee --fq1 FQ1
       --ref_fasta REF_FASTA
       --alt_fasta ALT_FASTA
       --bam BAM
       [--fq2 FQ2]
       [--tmp_dir TMP_DIR]

  --fq1 FQ1              FASTQ file with all reads (for single-end) or read1
                         reads (for paired-end)
  --fq2 FQ2              (Optional) FASTQ file with read2 reads
  --ref_fasta REF_FASTA
                         First FASTA against which to align
  --alt_fasta ALT_FASTA
                         Second FASTA against which to align
  --bam BAM              Output BAM
  --tmp_dir TMP_DIR      (Optional) Directory of intermediate files
  --threads THREADS      (Optional) Number of threads for alignment [1]

Metadata

Release files for RNA-APoGee 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for RNA-APoGee 0.0.10
File Size Uploaded
RNA-APoGee-0.0.10.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for RNA-APoGee 0.0.10
File Interpreter ABI Platform
RNA_APoGee-0.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / RNA-APoGee-0.0.10.tar.gz

Download URL RNA-APoGee-0.0.10.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
71d2ab29ee95e555eafd33267926a267adb20ac60546af6f9cd674cd44cb84b2
BLAKE2b-256 checksum
How to use checksums
3272f56ddaa5f4d5cc0a2a046e1cdd73fa86d4a7646f7fb0a1f107ace8028b90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

Release files / RNA_APoGee-0.0.10-py3-none-any.whl

Download URL RNA_APoGee-0.0.10-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d79c2e54443246f3addd8938f3aa0c5da26cb69cd6c814d3650d038c2d21723
BLAKE2b-256 checksum
How to use checksums
08c93d30d19b5d1e34e1151a71347380dab58f3540e356e25c865ae64a728ac0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.10 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page