Skip to main content

A python toolbox for processing SPRITE-seq within the cooler universe

Project description

spritefridge

A python toolbox for processing SPRITEseq data

Installation

To be able to run everything correctly we need a few prerequisits installed especially bedtools. Furthermore, at the time of writing this some dependencies refused to compile when installing with pip (krbalancing). Installing these is easiest done using conda. For convenience we provide an environment file (env.yml) with this package Installation thus works like

conda env create -f env.yml
conda activate sprite
pip install spritefridge

Usage

spritefridge comprises five tools to process and annotate SPRITE-seq data and results. Below are some example commands. For more details please refer to the generated help messages spritefridge <subcommand> -h

extractbc

extractbc aims to extract barcodes from reads according to a list of used barcodes and barcode layouts (i.e. how the barcodes are aranged in read sequence) A typical command looks like this

spritefridge extractbc \
    -r1 r1.fq.gz \
    -r2 r2.fq.gz \
    -bc barcodes.tsv \
    -l1 DPM \
    -l2 'Y|SPACER|ODD|SPACER|EVEN|SPACER|ODD' \
    -m 'DPM:0,Y:0,EVEN:2,ODD:2' \
    -o out.bcextract.fq.gz \
    -p 4

This command will read in the barcodes and the try to find barcodes in the respective read sequence in the order given by the layouts starting from 5' end. -m gives the allowed mismatches for the barcode identification. In addition to out.bcextract.fq.gz which contains reads with the extracted barcodes appended to their names, the tool also outputs statistics for how many reads were found with 1, 2, 3, ... barcodes. -p specifies the number of processes to use for extraction.

pairs

pairs identifies barcode clusters from aligned reads and writes them into pairs files for each cluster size

spritefridge pairs \
    -b in.bam \
    -o pairs/out \
    -cl 2 \
    -ch 1000 \
    --separator '['

This command will read in alignments from in.bam (needs to be filtered for multimappers and quality) groups the reads by barcodes and then writes all possible pairs for each cluster of sizes between 2 and 1000 reads to a file named pairs/out_<clustersize>.pairs. This tool also outputs a dedicated bedfile containing all reads from each cluster to be used to annotated the Cooler bins later on (see annotate)

combine

combine merges cool files generated from cluster pairs files according to the SPRITE-seq recommendation by multiplying the counts of each Cooler by 2/n, where n is the cluster size, before merging. The cluster size is inferred from the file name which needs to be of the pattern <name>_<clustersize>.cool

spritefridge combine \
    -i coolers/* \
    -o merged.cool \
    --floatcounts

--floatcounts ensures that merged counts are stored as float and not be casted to int

annotate

annotate takes in a bedfile (see pairs) and annotated each bin with the overlapping reads of each cluster.

spritefridge annotate \
    -i merged.mcool \
    -b clusters.bed

merged.mcool is a zoomified version of the merged.cool file

balance

balance is used to balance the contact matrices of the resulting mcool file using iterative correction and Knight-Ruiz matrix balancing genomewide and per chromosome

spritefridge balance \
    -m testdata/sprite.new.mcool \
    -p 2 \
    --overwrite

-p specifies the number of processes to use for iterative correction and --overwrite will overwrite any existing weights with the same name in the Cooler

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

spritefridge-1.3.1.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spritefridge-1.3.1-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file spritefridge-1.3.1.tar.gz.

File metadata

  • Download URL: spritefridge-1.3.1.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for spritefridge-1.3.1.tar.gz
Algorithm Hash digest
SHA256 ed60ed24c41887b47d63462d8c1d057b646b985460724261841c2ee845f540ad
MD5 728983abe472055078c48e0a273f93ec
BLAKE2b-256 3f5ff4779ca444f96ec0db2b371f4d748f656632bdd31815d65043c9454db0db

See more details on using hashes here.

File details

Details for the file spritefridge-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: spritefridge-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for spritefridge-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 31a85105c5735f291d544feb5dcb833d69a61c03a94d0ca5976af473e255676a
MD5 dd06fd7702fc1cf340a719555b75526b
BLAKE2b-256 0c505dacc684b988d48f9a42ada14bac8152b5e3ccddb44708f2ae59a8256997

See more details on using hashes here.

Supported by

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