Skip to main content

A package to generate various types of 2D representations of data and spiral chronograms.

Project description

Chronogram Plotting Package

This package provides a function to plot a chronogram (triangular or spiral) based on a distance matrix and corresponding dates. The main function, plot_chronogram, generates these plots with customizable parameters. Here are some sample outputs generated using NCBI Virus SARS-CoV-2 Data.

Triangular Chronogram Spiral Chronogram

Description

The main.py function plots a chronogram (triangular or spiral) based on the provided distance matrix and dates.

Parameters

  • distance_matrix_path (str): Path to the distance matrix file.
  • dates_file_path (str): Path to the dates file.
  • threshold (int, default=1000): Threshold for the spiral, number of date units in each circle.
  • pattern (str, default='nonoverlap'): Pattern indicating overlap or non-overlap if spiral has more than one circle.
  • transform (bool, default=False): Whether to apply log transformation to angles.
  • aggregate_data (bool, default=False): Whether to aggregate the data before plotting.
  • gap (int, default=100): Gap between circles for the spiral.
  • color (str, default='Spectral'): Color map for the plot.
  • plot_type (str, default='spiral'): Type of chronogram to plot ('triangular', 'spiral', 'upper_triangle', 'spiral_3d').
  • date_type (str, default='D'): Unit of the dates ("D": days, "M": months, "Y": years).
  • tick_step (int, default=100): The increment of highlight tick.
  • plot_title (str, default = None): The plot title.

Installation

  1. Download the repository as a ZIP file from GitHub: https://github.com/thushari93/Spiral_Chronogram

  2. Extract the ZIP file.

  3. Navigate to the extracted folder:

cd <path-to-extracted-folder>
  1. Install the necessary dependencies:
pip install -r requirements.txt

Example Usage

Command to compute distance matrix and extract collection dates:

python process_sequences.py --input_pattern "data_*.csv" --aligned_sequence_file "aligned_sequences.fasta"

Command to generate the plot under default settings:

python main.py --distance_matrix_path <path> --dates_file_path  <path> 

Command to generate a customized plot:

python main.py --distance_matrix_path 'distance_matrix_FL.npy' --dates_file_path  'Dates_FL.csv'
--plot_type 'spiral' --aggregate_data --transform --threshold 600 

Contributing

Feel free to submit issues to mho1@illinois.edu, fork the repository, and send pull requests!

Aknowledgement

This project was funded by Institute for Mathematical and Statistical innovation (IMSI) and the University of Illinois Urbana-Champaign (UIUC) under the supervision of Dr. Wilson and Dr. Ho.

License

This project is licensed under the Creative Commons License.

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

spiralchronogram-1.1.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

spiralChronogram-1.1.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file spiralchronogram-1.1.0.tar.gz.

File metadata

  • Download URL: spiralchronogram-1.1.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for spiralchronogram-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0e706b2091881b896fb3b46d01cfdfc0fc2290f075f4aa5a7c509d8ea1ba95d7
MD5 7d15e49b9fe518631aab247a2af0387f
BLAKE2b-256 e3d6ada177ce4dfce798fdda0964ddf622a2fdf458d8c69f8a0b5e5639078b8c

See more details on using hashes here.

File details

Details for the file spiralChronogram-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for spiralChronogram-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67c3986f4e6a21034eebbf95f6d68be4bb92a0f6863cd898cdb9ca5d4e6af025
MD5 b697434ea4909a0b95687afb94deb065
BLAKE2b-256 7a8c174042c4ccfcd16b742b8255c748adb37ab58b280aabd39fe16d7a8618c6

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