From 8887b5b5ee445cd529fc5b0ae367b35c71b648f0 Mon Sep 17 00:00:00 2001 From: acferris <29984203+acferris@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:39:34 -0700 Subject: [PATCH] removed umapMissingness graph This is currently broken because snpProportionNoInterpolation includes samples that are removed before the UMAP embedding. This could be fixed, but I don't think this figure is needed--histogramMissingness should be sufficient --- graphs.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/graphs.py b/graphs.py index 3ce186e..b309112 100644 --- a/graphs.py +++ b/graphs.py @@ -345,26 +345,6 @@ def heatmapReferences(snpProportion, sampleMeta, allVarieties, tick_type): plt.tight_layout() - - -def umapMissingness(snpProportionNoInterpolation, embedding, missingnessCutoff = 0.05): - """ - UMAP where samples are colored by percent data missing - - Args: - snpProportionNoInterpolation: SNP proportion data before interpolation - embedding: UMAP embedding of data - missingnessCutoff: plot samples with a missingness below this value as grey - """ - pm = snpProportionNoInterpolation.isna().sum(axis = 0)/snpProportionNoInterpolation.shape[0] - abovecut = np.where(pm > missingnessCutoff)[0] - - ax1, ax2 = plotTemplate() - ax1.scatter(embedding[:, 0], embedding[:, 1], s = 1, c='grey', alpha = 0.1) - SC = ax1.scatter(embedding[abovecut, 0], embedding[abovecut, 1], s = 1, c=pm[abovecut]) - plt.colorbar(SC, cax=ax2) - plt.tight_layout() - def histogramMissingness(snpProportionNoInterpolation): """ Histograms of missingness by sample and marker