Skip to content

Commit

Permalink
removed umapMissingness graph
Browse files Browse the repository at this point in the history
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
  • Loading branch information
acferris committed Oct 12, 2024
1 parent 70c8ec6 commit 8887b5b
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8887b5b

Please sign in to comment.