Skip to main content

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. -l1 and -l2 can also be left empty if barcodes are only to be extracted from one read.

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). Additionally, one can specify the a list of barcode name prefixes to ignore when generating the clusters via --ignoreprefix e.g. when having RPM and DPM sequences present which should really be in the same cluster (--ignoreprefix "RPM,DPM")

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

Metadata

Release files for spritefridge 1.3.6

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

Source distribution (sdist)

Source distribution for spritefridge 1.3.6
File Size Uploaded Provenance Actions
spritefridge-1.3.6.tar.gz 21.3 kB Without provenance Details for spritefridge-1.3.6.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for spritefridge 1.3.6
File Interpreter ABI Platform Actions
spritefridge-1.3.6-py3-none-any.whl Python 3 none any Details for spritefridge-1.3.6-py3-none-any.whl
spritefridge-1.3.6-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details for spritefridge-1.3.6-cp312-cp312-macosx_10_13_x86_64.whl

Total release size: 88.3 kB

Release files / spritefridge-1.3.6.tar.gz

Download URL spritefridge-1.3.6.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f7bf49b4855288003269893b4531262920bde4633eff704e75c00e898a3d2589
BLAKE2b-256 checksum
How to use checksums
02968331efa547909705088df4188b78bd7a010320da03d530cde407c0788eab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / spritefridge-1.3.6-py3-none-any.whl

Download URL spritefridge-1.3.6-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ba4e5f19d626b4c255530c6023b8e0ab55f9f043d4a7de96656a94fabb1451d
BLAKE2b-256 checksum
How to use checksums
302c5dfab3c25575a6a3f9229aa0b71bc7b1b1e8d4649fe3a0fc5b8dc81c26f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / spritefridge-1.3.6-cp312-cp312-macosx_10_13_x86_64.whl

Download URL spritefridge-1.3.6-cp312-cp312-macosx_10_13_x86_64.whl
Size 41.3 kB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
b7a1acaa627da62617ea98fb9cf79fca52bcc77f9de760a2e8a36a323331c999
BLAKE2b-256 checksum
How to use checksums
2ab403bfb5619855b0810d0d96b899919cb8c4eb4a506f65d8a8d322c78d8e24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Security for spritefridge 1.3.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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