text: user357: Is there a good way of obtaining the labels (e.g. genes) within individual clusters that haven been clustered hierarchically in Python (preferentially, but not necessarily, by seaborn)?
  I found these difficulties highlighted elsewhere (here, and here), and would hope for some simple option (e.g.: like in MATLAB where cutoff can be specified, and corresponding genes would be returned), without potential risk that the plotted hierarchical heatmap differed from the cluster assignment ( see here) 
  
  user77: Clustering like this is typically done with scipy. Here's the code we use in deepTools (original context here):
  from scipy.cluster.hierarchy import fcluster, linkage
  Z = linkage(some_matrix)  # You might want to set `method` and `metric`
  groups = fcluster(Z, nGroups)  # You might want to set `criterion`
  
  groups is then a vector containing the group assignment of the input matrix according to the clustering. As an aside, this is exactly the same as what's shown in the last link in your post, so I'm not sure how you didn't find it.
  BTW, at least in python, hierarchical clustering is painfully slow with large datasets.
  
original_text: 357: <p>Is there a good way of obtaining the labels (e.g. genes) within individual clusters that haven been clustered hierarchically in Python (preferentially, but not necessarily, by seaborn)?</p>
  
  <p>I found these difficulties highlighted elsewhere (<a href="http://altanalyze.blogspot.com/2012/06/hierarchical-clustering-heatmaps-in.html" rel="nofollow noreferrer">here</a>, and <a href="https://stackoverflow.com/questions/42470289/get-values-included-in-each-cluster">here</a>), and would hope for some simple option (e.g.: like in MATLAB where cutoff can be specified, and corresponding genes would be returned), without potential risk that the plotted hierarchical heatmap differed from the cluster assignment ( see <a href="https://stackoverflow.com/questions/28687882/cutting-scipy-hierarchical-dendrogram-into-clusters-via-a-threshold-value">here</a>) </p>
   77: <p>Clustering like this is typically done with scipy. Here's the code we use in deepTools (original context <a href="https://github.com/fidelram/deepTools/blob/master/deeptools/heatmapper.py#L1192-L1196" rel="noreferrer">here</a>):</p>
  
  <pre><code>from scipy.cluster.hierarchy import fcluster, linkage
  Z = linkage(some_matrix)  # You might want to set `method` and `metric`
  groups = fcluster(Z, nGroups)  # You might want to set `criterion`
  </code></pre>
  
  <p><code>groups</code> is then a vector containing the group assignment of the input matrix according to the clustering. As an aside, this is exactly the same as what's shown in the last link in your post, so I'm not sure how you didn't find it.</p>
  
  <p>BTW, at least in python, hierarchical clustering is painfully slow with large datasets.</p>
  