We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jensen-Shannon Distance (JSD) plot
use deeptools npz output as input to jsd
encode: https://github.com/ENCODE-DCC/chip-seq-pipeline2/blob/master/src/encode_task_jsd.py
The text was updated successfully, but these errors were encountered:
import numpy as np from scipy.spatial.distance import jensenshannon import seaborn as sns import matplotlib.pyplot as plt # Load data data = np.load("summary.npz") coverage_matrix = data["data"] labels = data["labels"] # Normalize per sample coverage_matrix += 1e-10 # Handle zeros normalized_matrix = coverage_matrix / coverage_matrix.sum(axis=0, keepdims=True) # Compute JSD matrix num_samples = normalized_matrix.shape[1] jsd_matrix = np.zeros((num_samples, num_samples)) for i in range(num_samples): for j in range(num_samples): jsd_matrix[i, j] = jensenshannon(normalized_matrix[:, i], normalized_matrix[:, j]) # Plot heatmap sns.heatmap(jsd_matrix, xticklabels=labels, yticklabels=labels, annot=True, fmt=".2f", cmap="viridis") plt.title("Pairwise Jensen-Shannon Distances") plt.show()
Sorry, something went wrong.
No branches or pull requests
Jensen-Shannon Distance (JSD) plot
use deeptools npz output as input to jsd
encode: https://github.com/ENCODE-DCC/chip-seq-pipeline2/blob/master/src/encode_task_jsd.py
The text was updated successfully, but these errors were encountered: