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.3.0.tar.gz (14.0 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.3.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for spiralchronogram-1.3.0.tar.gz
Algorithm Hash digest
SHA256 907ac140d249d4ac7bbe11fdd7c98ecb00067c8e4592fab7cb68b2d084cb8e50
MD5 f6d50fd9d95b0f74e6bb08046512b91e
BLAKE2b-256 7e495b21c0a843bdab9e12c8eba7af0333c66903709a757896090e770bc7d679

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spiralChronogram-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c7f7cad966ca54100fab2b6c3bd5aca7ff0d39e332240fd6f5085a52a65844c
MD5 474c1a4756a3fb1ccb69f39e93ea69b7
BLAKE2b-256 0551fa6aefe851d56aae2dcb3464122c3bfa1c4f73a33043052044a92cc90340

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