Skip to main content

Interactive Visualization Tool for Clustering Alignment

Project description

KAlignedoscope: An interactive visualization tool for aligned clustering results from population structures analyses

Powered by JavaScript D3

Feature Highlights

This tool aims to support user-interactivity and friendliness with aesthetic interface. There are three methods of reordering: by population, by dominant cluster of a selected mode, and by vertical cluster stacking order, with changes synced across all modes. There are several customizable features as well, including cluster name relabeling, cluster color picking, and title renaming. Users may also choose the visibility structure of minor modes and network connections when alignment cost and multi-modality is given. Beyond visual elements, information is also available through hovering tooltips across individuals' bars and above network connections.

Basic Usage

For installation, I will first assume that the user has Python installed (less custom to my tool, easier to write later).

Install the KAlignedoscope package

Inside of the command line, write:

pip install kalignedoscope

It will be useful to download the example datasets and follow the available tutorial. It may be accessed below here: https://github.com/ramachandran-lab/KAlignedoscope/tree/a9c6dbadbb3e4174a99e456b3af78d39a7b46f91/Data

To run KAlignedoscope on example dataset

Idea of how to explain this section nicely:

  1. Explain what the data is, and how it is formatted
  2. Confirm that they have installed it correctly and it is in the correct directory under the KAlignedoscope folder

Run the following lines in the terminal to initialize the tool:

python -m kalignedoscope 
--membership_folder Data/Cape_Verde_Data 
--alignment_file Data/Cape_Verde_Alignment.txt 

For help and more options write in the command line:

pythom -m kalignedoscope -h

Processing outputs from other tools

This tool primarily functions as a visualization and data navigation tool for alignment results, which may be created from running existing packages such as CLUMPPLING or PONG. These results may need to be processed before the datasets are fed into CLUMPICK. Two python functions are provided to assist with preparing data.

Notes on Running Directly from Clummpling Output Directory

We will need three files: modes_aligned folder, alignment_acrossK_avg.txt file, and ind_labels_grouped.txt file. To make the formatting usuable for our tool you will need to first run it through processFromExternal.py (need to make a output folder path for it to put the sorted data into), then addPopulation.py where you need to use the ind_labels_grouped.txt file (which you should first paste into a .CSV file under a column that matches case with "Population") to add another column to all the datasets. Then the data is ready to be used, but you may want to read in your alignment cost file as well, which should be processed through the convertAligned.py function (which just reads it into CSV format).

File input formatting

Title

KAlignedoscope reads each table as an individual structure plot, as such, the user should tuck all their .Q matrices or processed .CSV files into the data folder under KAlignedoscope. Due to the particular nature of this tool that relies on detecting particular K modes and M clusters for layout, each file in the folder should be consistently named with information that must be included in the title: K = X Clusters and M = Y Modes. For example: YourName_KXMY.Q

Data Layout

There should be a name column, optional population column, and $K$ amount of columns for the cluster proportions. It should be noted that the number of of $K$ clusters for each file should be matched across file name and number of cluster columns. If the user decides to use the processFromExternal.py function they will be safe on the formatting, otherwise the user should be sure their columns are named particularly (matching case): name, Population, Cluster1, Cluster2... and so on. Sum of clusters for each individual should be 1.

!!! Consider putting an image or table here to demonstrate?

Alignment Data

Alignment data is used to render across-K edges in the Network Connections feature. Designed to read directly from Clumppling's results, which users should download the alignment_acrossK.txt file by navigating to the output folder in Clumppling's directory after performing a sucessful run of the program. Otherwise, it is important to format files in the following for compatibility with KAlignedoscope.

For example, this is the top three rows of Cape Verde alignment data from Clumppling's outout. Please be sure to format as Mode1-Mode2.

Mode1-Mode2 Cost
K4M1-K5M1 0.0042625183996884055
K4M2-K5M1 0.06438957610509989
K4M1-K5M2 0.005455565400171093

processFromExternal.py

which matches case and title structures, converting from .Q matrice file shapes.

addPopulation.py

which adds a Population column if given.

convertAligned.py

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

kalignedoscope-0.1.0.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

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

kalignedoscope-0.1.0-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

Details for the file kalignedoscope-0.1.0.tar.gz.

File metadata

  • Download URL: kalignedoscope-0.1.0.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.3 Windows/11

File hashes

Hashes for kalignedoscope-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ab8fc0dba03db64047c37eedc91dbd7e49884d77f9e473585d9b316d10ea8cd2
MD5 20134d0b11948b8547a1d0c3c06f7a0c
BLAKE2b-256 0e0a3dbfa9c93df60f615322a428c8f4dcdb114e6148149d783b3e76dd1441be

See more details on using hashes here.

File details

Details for the file kalignedoscope-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kalignedoscope-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.3 Windows/11

File hashes

Hashes for kalignedoscope-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 343ee81d111448b5c23171903d9ad65022f1f7227b118b713199ac3adcd39144
MD5 90829870673be816226e5b985e0f53f2
BLAKE2b-256 af1cb8ac9bf6c4d929d90a1c8ad27dd0093ec685e7afcf0aa4e800f57524d9b1

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