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.0.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.0.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spiralchronogram-1.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 32c1c643016ea937600975d214562e6689142bdfdf84ab21257158185f2f1b8c
MD5 4cf7da001983c7d4f023a07ab495264b
BLAKE2b-256 167d8e73c987b43e7eb2177dad2e220bc0c60df2722c11be83e837b2da6ce0da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spiralChronogram-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68c6c40dc096bf2eb98149d5c4d34ca3495412158c90784e743c202df2d606c1
MD5 2ad35bfe9a21e4b748d52b959660d13c
BLAKE2b-256 b912113d7438939687face7911f64a7562598b368dfb52a0432dd23b251bc09c

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