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

Uploaded Python 3

File details

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

File metadata

  • Download URL: spiralchronogram-1.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 4dd168a1b065bff4e40c72b0d7b1db1533cbb0790ff806fcc3f35a304642ba7d
MD5 066b89e898e6956af6bda2cc5c900289
BLAKE2b-256 fb861c1df2542a19b093d73f6e4fe0db79c0d23fd729f25bca3974a94a766f8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spiralChronogram-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1d87ef74a1aae3f9e1aa8940511b6085189322280861d11fd78e6cab1e025c3
MD5 63630bd46cf22b4500c0f53183363b39
BLAKE2b-256 975cb0f738933701df855c4778fed2c4c06203ef789d14c90e97db7e00812067

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