Skip to content

Example data

A small set of synthetic example data for trying out the package and for the examples in this documentation: twelve motifs built from well-known consensus sites, promoter-like target sequences with some of those motifs planted in them alongside matching controls, and a file in each supported motif format.

example_motifs

example_motifs() -> list[Motif]

Twelve example DNA motifs.

The motifs are synthetic: each is built from a well-known consensus site, such as the TATA box, the AP-1 site or the plant W-box and G-box, with probabilities drawn at random around it and counts from a random number of sites sampled from those probabilities. They come as count matrices, with their family set and a pseudocount of 1.

Examples:

>>> import universalmotif as um
>>> motifs = um.example_motifs()
>>> [m.name for m in motifs[:4]]
['TATA-box', 'AP-1', 'CRE', 'G-box']

example_sequences

example_sequences(kind: str = 'targets') -> dict[str, str]

A hundred example DNA sequences of 1000 bases each.

The sequences are random and AT-rich, much like plant promoters. The "targets" have a W-box site planted in 60 of them and a G-box site in 40, both drawn from example_motifs() and placed towards the middle of the sequences, while the "controls" have nothing planted, which makes the two sets a small test case for enrichment.

Examples:

>>> import universalmotif as um
>>> targets = um.example_sequences()
>>> len(targets), len(targets["target_001"])
(100, 1000)

example_file

example_file(format: str) -> Path

The path to an example file in one of the supported formats.

format is one of "meme", "jaspar", "homer", "transfac", "cisbp", "uniprobe" and "matrix", each holding the first four example_motifs(), or "fasta" for the gzipped example target sequences.

Examples:

>>> import universalmotif as um
>>> path = um.example_file("jaspar")
>>> [m.name for m in um.read_jaspar(path)]
['TATA-box', 'AP-1', 'CRE', 'G-box']