Skip to content

Commit

Permalink
Fix typos, drop GCT
Browse files Browse the repository at this point in the history
  • Loading branch information
shntnu committed Mar 20, 2021
1 parent 907d031 commit 4a0de4f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 114 deletions.

This file was deleted.

2 changes: 1 addition & 1 deletion consensus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The pipeline can be reproduced by executing the following:
# Make sure conda environment is activated
conda activate lincs

# Reproduce thepipeline for producing bulk signatures
# Reproduce the pipeline for producing bulk signatures
ipython scripts/nbconverted/build-consensus-signatures.py
```

Expand Down
78 changes: 0 additions & 78 deletions consensus/build-consensus-signatures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"from pycytominer.aggregate import aggregate\n",
"from pycytominer.consensus import modz_base\n",
"from pycytominer.feature_select import feature_select\n",
"\n",
"from pycytominer.cyto_utils import infer_cp_features"
]
},
Expand Down Expand Up @@ -635,83 +634,6 @@
" index=False,\n",
" )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Save whole plate MODZ consensus signature as GCT\n",
"\n",
"Whole-plate-normalized + MODZ aggregated consensus profiles will be made available on clue.io/morphology as a GCT file."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Now Writing: Consensus Operation: modz; Norm Strategy: whole_plate\n",
"File: 2016_04_01_a549_48hr_batch1/2016_04_01_a549_48hr_batch1_consensus_modz.gct\n",
"(8340, 1790)\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" setTimeout(function() {\n",
" var nbb_cell_id = 11;\n",
" var nbb_unformatted_code = \"import pycytominer.write_gct\\n\\noperation = \\\"modz\\\"\\nnorm_strat = \\\"whole_plate\\\"\\nfile_suffix = \\\".gct\\\"\\nconsensus_file = f\\\"{batch}_consensus_{operation}{file_suffix}\\\"\\nconsensus_file = pathlib.Path(batch, consensus_file)\\n\\nconsensus_df = all_consensus_dfs[norm_strat][operation][\\\"no_feat_select\\\"]\\n\\nprint(\\n f\\\"Now Writing: Consensus Operation: {operation}; Norm Strategy: {norm_strat}\\\\nFile: {consensus_file}\\\"\\n)\\nprint(consensus_df.shape)\\n\\npycytominer.write_gct(consensus_df, consensus_file)\";\n",
" var nbb_formatted_code = \"import pycytominer.write_gct\\n\\noperation = \\\"modz\\\"\\nnorm_strat = \\\"whole_plate\\\"\\nfile_suffix = \\\".gct\\\"\\nconsensus_file = f\\\"{batch}_consensus_{operation}{file_suffix}\\\"\\nconsensus_file = pathlib.Path(batch, consensus_file)\\n\\nconsensus_df = all_consensus_dfs[norm_strat][operation][\\\"no_feat_select\\\"]\\n\\nprint(\\n f\\\"Now Writing: Consensus Operation: {operation}; Norm Strategy: {norm_strat}\\\\nFile: {consensus_file}\\\"\\n)\\nprint(consensus_df.shape)\\n\\npycytominer.write_gct(consensus_df, consensus_file)\";\n",
" var nbb_cells = Jupyter.notebook.get_cells();\n",
" for (var i = 0; i < nbb_cells.length; ++i) {\n",
" if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n",
" if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n",
" nbb_cells[i].set_text(nbb_formatted_code);\n",
" }\n",
" break;\n",
" }\n",
" }\n",
" }, 500);\n",
" "
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import pycytominer.write_gct\n",
"\n",
"operation = \"modz\"\n",
"norm_strat = \"whole_plate\"\n",
"file_suffix = \".gct\"\n",
"consensus_file = f\"{batch}_consensus_{operation}{file_suffix}\"\n",
"consensus_file = pathlib.Path(batch, consensus_file)\n",
"\n",
"consensus_df = all_consensus_dfs[norm_strat][operation][\"no_feat_select\"]\n",
"\n",
"print(\n",
" f\"Now Writing: Consensus Operation: {operation}; Norm Strategy: {norm_strat}\\nFile: {consensus_file}\"\n",
")\n",
"print(consensus_df.shape)\n",
"\n",
"pycytominer.write_gct(consensus_df, consensus_file)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
32 changes: 0 additions & 32 deletions consensus/scripts/nbconverted/build-consensus-signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from pycytominer.aggregate import aggregate
from pycytominer.consensus import modz_base
from pycytominer.feature_select import feature_select

from pycytominer.cyto_utils import infer_cp_features


Expand Down Expand Up @@ -270,34 +269,3 @@ def consensus_apply(df, operation, cp_features, replicate_cols):
index=False,
)


# ## Save whole plate MODZ consensus signature as GCT
#
# Whole-plate-normalized + MODZ aggregated consensus profiles will be made available on clue.io/morphology as a GCT file.

# In[11]:


import pycytominer.write_gct

operation = "modz"
norm_strat = "whole_plate"
file_suffix = ".gct"
consensus_file = f"{batch}_consensus_{operation}{file_suffix}"
consensus_file = pathlib.Path(batch, consensus_file)

consensus_df = all_consensus_dfs[norm_strat][operation]["no_feat_select"]

print(
f"Now Writing: Consensus Operation: {operation}; Norm Strategy: {norm_strat}\nFile: {consensus_file}"
)
print(consensus_df.shape)

pycytominer.write_gct(consensus_df, consensus_file)


# In[ ]:




0 comments on commit 4a0de4f

Please sign in to comment.