Skip to main content

CLI library to generate UCSC trackhubs from sequencing data

Project description

TrackNado

TrackNado builds UCSC Genome Browser track hubs from local track files and a small table of metadata. Use it when you want a repeatable way to stage bigWig, bigBed, BAM, and annotation tracks for a UCSC hub.

The command-line interface is the simplest way to start. The Python API exposes the same build steps for pipelines and scripts.

Install

pip install tracknado

Build a hub

This example creates a hub for four tracks on hg38.

  1. Make an editable metadata table from the files:

    tracknado design \
      -i tracks/*.bw \
      -i tracks/*.bb \
      -o tracks.csv
    
  2. Edit tracks.csv. Every row is one track. file_path is required; the other columns describe how the track should appear in the browser.

    file_path,name,ext,assay,cell_type,color
    tracks/k562_ctcf.bw,K562 CTCF,bigWig,ChIP-seq,K562,crimson
    tracks/gm12878_ctcf.bw,GM12878 CTCF,bigWig,ChIP-seq,GM12878,#4169E1
    tracks/k562_atac.bw,K562 ATAC,bigWig,ATAC-seq,K562,darkorange
    tracks/peaks.bb,Called peaks,bigBed,Peaks,All,#464646
    
  3. Build and stage the hub:

    tracknado create \
      --metadata tracks.csv \
      --output my_hub \
      --hub-name project_tracks \
      --hub-email you@example.org \
      --genome-name hg38 \
      --subgroup-by assay \
      --subgroup-by cell_type
    
  4. Check the staged hub:

    tracknado validate my_hub
    

my_hub now contains project_tracks.hub.txt, the genome and trackDb files, copied track files, and tracknado_config.json. Publish that directory through a web server, then give UCSC the URL to the .hub.txt file.

Common changes

  • Add a top-level folder-like grouping: --supergroup-by assay.
  • Give tracks colours from a categorical metadata field: --color-by cell_type.
  • Combine related signal tracks in one display: --overlay-by condition.
  • Convert BED, GTF, or GFF inputs while building: add --convert --chrom-sizes hg38.chrom.sizes.
  • Build an assembly hub for a private genome: add --custom-genome --twobit reference.2bit --organism "Species name".

See the documentation for the complete walkthrough, metadata rules, track layouts, and Python examples.

Python API

import pandas as pd
import tracknado as tn

tracks = pd.read_csv("tracks.csv")
hub = (
    tn.HubBuilder()
    .add_tracks_from_df(tracks)
    .group_by("assay", "cell_type")
    .build(
        name="project_tracks",
        genome="hg38",
        outdir="my_hub",
        hub_email="you@example.org",
    )
)
hub.stage_hub()

License

TrackNado is distributed under the GNU General Public License v3.

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

tracknado-0.3.2.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

tracknado-0.3.2-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file tracknado-0.3.2.tar.gz.

File metadata

  • Download URL: tracknado-0.3.2.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for tracknado-0.3.2.tar.gz
Algorithm Hash digest
SHA256 2de9d4d8e7e4d210305b90e7871675d05915d83e1e2c7626870769dc73acf52a
MD5 d276c851bf624ecb2adeb7e8ba34ac3b
BLAKE2b-256 2c576ade7ac2ac0a918fc37adff14a9cfb918814a339fc2b9e9943bda74336f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for tracknado-0.3.2.tar.gz:

Publisher: python-publish.yml on alsmith151/TrackNado

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tracknado-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: tracknado-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for tracknado-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9618edc71a15d3c13ef2bf8e63d7116677b251f893297d4391ba5739f3b6a0a5
MD5 9a0238bf9a4d3240ead258895290b42a
BLAKE2b-256 056be041374d08f37304ce0349562fed8e4a69a975d8d443251dcf7c381bf6f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for tracknado-0.3.2-py3-none-any.whl:

Publisher: python-publish.yml on alsmith151/TrackNado

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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