Skip to main content

spaTyper.py: Generate spa type identification

DOI

Version: 0.3.3

USAGE: spaTyper [-h] [-r REPEAT_FILE] [-o REPEAT_ORDER_FILE] [-d FOLDER] [-f FASTA [FASTA ...]] [-g GLOB] [--output OUTPUT] [-e] [--version] [--debug]

Prints spa type to stdout - egenomics letter combination and then the ridom spa type. If multiple pcr products are found will print spa types for each product. It downloads sparepeats.fasta and spatypes.txt from the ridom server to repository directory if files not provided or already in directory.

optional arguments:
-h, --help            show this help message and exit
-r REPEAT_FILE, --repeat_file REPEAT_FILE List of spa repeats (http://spa.ridom.de/dynamic/sparepeats.fasta)
-o REPEAT_ORDER_FILE, --repeat_order_file REPEAT_ORDER_FILE List spa types and order of repeats (http://spa.ridom.de/dynamic/spatypes.txt)
-d FOLDER, --folder FOLDER Folder to save downloaded files from Ridom/Spa server
-f FASTA [FASTA ...], --fasta FASTA [FASTA ...] List of one or more fasta files.
-g GLOB, --glob GLOB  Uses unix style pathname expansion to run spa typing on all files. If your shell autoexpands wildcards use -f.
-e, --do_enrich       Do PCR product enrichment. [Default: False]
--output OUTPUT	Provide an output file or print by default using standard out.
--version             show program's version number and exit
--debug               Developer messages

Installation

It requires python 3. Install it using pip package (https://pypi.org/project/spaTyper/)

pip install spaTyper

or clone the repository and install it using setup.py

git clone https://github.com/JFsanchezherrero/spa_typing.git
cd spa_typing
pip install setup.py

How it works

Given a fasta file or multiple fasta files, this script identifies the repeats and the order and generates a spa type.

The repeat sequences and repeat orders found on http://spaserver2.ridom.de/ are used to identify the spa type of each enriched sequence.

Ridom spa type and the egenomics repeat sequence are then reported back to the user.

If enriched option provided, the script searches for 50bp to 5000bp sequences produced by the following primer sets

TAAAGACGATCCTTCGGTGAG, CAGCAGTAGTGCCGTTTGCTT
AGACGATCCTTCGGTGAGC, GCTTTTGCAATGTCATTTACTG
ATAGCGTGATTTTGCGGTT, CTAAATATAAATAATGTTGTCACTTGGA
CAACGCAATGGTTTCATCCA, GCTTTTGCAATGTCATTTACTG

If an enriched sequence is found by a primer set, subsequent primer sets are not used.

Load it as a module

This scripts can be loaded and installed as a python module. Python 3 version only.

	import spaTyper

	## download file repeats   
	repeat_file = spaTyper.utils.download_file_repeats(folder, False)

	## download file repeats   
	repeat_order_file = spaTyper.utils.download_file_types(folder, False)

	## Get the SpaTypes in fasta sequences
	seqDict, letDict, typeDict, seqLengths = spaTyper.spa_typing.getSpaTypes(repeat_file, repeat_order_file, False)

	## read fasta file
	fasta_file = "my_genome.fasta"
	qDict = spaTyper.utils.fasta_dict(fasta_file)

	## find pattern
	for i in qDict.keys():
		pattern = spaTyper.spa_typing.findPattern(qDict[i], seqDict, seqLengths, debug)
		if pattern:
			if j in pattern.keys():
				splitted = pattern[j].split('::')
				print("Sequence name: ",j, "Repeats:", splitted[2], "Repeat Type:", splitted[1], '\n')    

Original code written by mjsull (https://github.com/mjsull/spa_typing)

Jose F. Sanchez-Herrero updated the code, change to python3, and set to use it as a module

DOI

Metadata

Release files for spaTyper 0.3.3

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

Source distribution (sdist)

Source distribution for spaTyper 0.3.3
File Size Uploaded Provenance Actions
spaTyper-0.3.3.tar.gz 157.7 kB Without provenance Details for spaTyper-0.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spaTyper 0.3.3
File Interpreter ABI Platform Actions
spaTyper-0.3.3-py3-none-any.whl Python 3 none any Details for spaTyper-0.3.3-py3-none-any.whl

Total release size: 322.8 kB

Release files / spaTyper-0.3.3.tar.gz

Download URL spaTyper-0.3.3.tar.gz
Size 157.7 kB
Tags Source
SHA-256 checksum
How to use checksums
885398b7a4044419430ec51464c6fe2267bdb6487c0fc945fde302145e659b0c
BLAKE2b-256 checksum
How to use checksums
5dabc0c69c52a945f2170e54fa3ad9647352ca53a8519515aa0c355b2ba02171
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.6

Release files / spaTyper-0.3.3-py3-none-any.whl

Download URL spaTyper-0.3.3-py3-none-any.whl
Size 165.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc990e16205716415797400c86f90c358acaccc311edc854d69acfd8acc27349
BLAKE2b-256 checksum
How to use checksums
8dee86f01f6c2be70aa7b5d5e71dbd4a34f4290808a7eefb1b136bbee76f8c3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.6

Security for spaTyper 0.3.3

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