Skip to content

Commit

Permalink
remove blank figures and edit code
Browse files Browse the repository at this point in the history
  • Loading branch information
jenna-tomkinson committed Jan 19, 2023
1 parent 0f2e400 commit 8da9f1c
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 78 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
108 changes: 36 additions & 72 deletions 5_analyze_data/notebooks/Heatmap_analysis/nf1_heatmap.ipynb

Large diffs are not rendered by default.

105 changes: 99 additions & 6 deletions 5_analyze_data/notebooks/Heatmap_analysis/nf1_heatmap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# coding: utf-8

# # Create correlation heatmap from normalized and feature selected NF1 data
# # Create correlation heatmap from normalized and feature selected NF1 data for both CellProfiler and DeepProfiler

# ## Import libraries

Expand All @@ -18,7 +18,9 @@
import UMAPutils as utils


# ## Read in NF1 data `csv`
# ## CellProfiler data

# ### Read in NF1 data `csv`

# In[2]:

Expand All @@ -31,7 +33,7 @@
data.head()


# ## Split NF1 data `csv`
# ### Split NF1 data `csv`

# In[3]:

Expand All @@ -40,7 +42,7 @@
feature_data


# ## Transpose the NF1 dataframe
# ### Transpose the NF1 dataframe

# In[4]:

Expand All @@ -49,7 +51,7 @@
data_trans


# ## Create correlation heatmap
# ### Create correlation heatmap

# In[5]:

Expand All @@ -62,7 +64,7 @@
plt.savefig(save_path, bbox_inches="tight")


# ## Create clustermap with correlation heatmap
# ### Create clustermap with correlation heatmap

# In[6]:

Expand All @@ -74,3 +76,94 @@
save_path = pathlib.Path("figures/correlation_clustermap_sc.png")
plt.savefig(save_path, bbox_inches="tight")


# ## DeepProfiler data

# In[7]:


norm_fs_data_nuc = pathlib.Path("../../../4_processing_features/data/nf1_sc_norm_fs_deepprofiler_nuc.csv.gz")
norm_fs_data_cyto = pathlib.Path("../../../4_processing_features/data/nf1_sc_norm_fs_deepprofiler_cyto.csv.gz")

data_nuc = pd.read_csv(norm_fs_data_nuc)
data_cyto = pd.read_csv(norm_fs_data_cyto)

print(data_nuc.shape)
data_nuc.head()


# In[8]:


metadata_dataframe_nuc, feature_data_nuc = utils.split_data(data_nuc)

feature_data_nuc = feature_data_nuc.drop(['Location_Center_X', 'Location_Center_Y'], axis=1)

print(feature_data_nuc.shape)
feature_data_nuc.head()


# In[9]:


metadata_dataframe_cyto, feature_data_cyto = utils.split_data(data_cyto)

feature_data_cyto = feature_data_cyto.drop(['Location_Center_X', 'Location_Center_Y'], axis=1)

print(feature_data_cyto.shape)
feature_data_cyto.head()


# In[10]:


data_trans_nuc = feature_data_nuc.transpose()
data_trans_cyto = feature_data_cyto.transpose()

print(data_trans_nuc.shape)
data_trans_nuc.head()


# In[11]:


data_trans_nuc_heatmap = sb.heatmap(data_trans_nuc.corr())

plt.show()


# In[12]:


data_trans_cyto_heatmap = sb.heatmap(data_trans_cyto.corr())

plt.show()


# In[13]:


sb.clustermap(data_trans_nuc.corr(),
cmap='RdBu_r',
)

save_path = pathlib.Path("figures/correlation_clustermap_sc_dp_nuc.png")
plt.savefig(save_path, bbox_inches="tight")


# In[14]:


sb.clustermap(data_trans_cyto.corr(),
cmap='RdBu_r',
)

save_path = pathlib.Path("figures/correlation_clustermap_sc_dp_cyto.png")
plt.savefig(save_path, bbox_inches="tight")


# In[ ]:




0 comments on commit 8da9f1c

Please sign in to comment.