Skip to content

Commit

Permalink
Merge pull request #41 from broadinstitute/updates
Browse files Browse the repository at this point in the history
Analysis updates
  • Loading branch information
mtegtmey authored Apr 19, 2024
2 parents f59bfd6 + 5ad15c9 commit b0922ca
Show file tree
Hide file tree
Showing 60 changed files with 3,100 additions and 460 deletions.
59 changes: 59 additions & 0 deletions 5.reanalysis/4.analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,65 @@
"\n",
"run_analysis(data_level, feature_cols_pattern=\"Cells_|Cytoplasm_|Nuclei_\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Analyzing category: progen\n",
"Analyzing category: neuron\n",
"Analyzing category: stem\n",
"Analyzing category: astro\n",
"Analysis complete. Summary results saved to output/analysis_results/var_mad_int_featselect/control_vs_deletion/summary_results.parquet\n",
"WARNING: The following values in Metadata_cell_type were not mapped and will be excluded from the analysis: <StringArray>\n",
"['progen', 'astro']\n",
"Length: 2, dtype: string\n",
"Analyzing category: control\n",
"Analyzing category: deletion\n",
"Analysis complete. Summary results saved to output/analysis_results/var_mad_int_featselect/cell_type_a_vs_b/stem_vs_neuron/summary_results.parquet\n",
"WARNING: The following values in Metadata_cell_type were not mapped and will be excluded from the analysis: <StringArray>\n",
"['neuron', 'astro']\n",
"Length: 2, dtype: string\n",
"Analyzing category: control\n",
"Analyzing category: deletion\n",
"Analysis complete. Summary results saved to output/analysis_results/var_mad_int_featselect/cell_type_a_vs_b/stem_vs_progen/summary_results.parquet\n",
"WARNING: The following values in Metadata_cell_type were not mapped and will be excluded from the analysis: <StringArray>\n",
"['progen', 'neuron']\n",
"Length: 2, dtype: string\n",
"Analyzing category: control\n",
"Analyzing category: deletion\n",
"Analysis complete. Summary results saved to output/analysis_results/var_mad_int_featselect/cell_type_a_vs_b/stem_vs_astro/summary_results.parquet\n",
"WARNING: The following values in Metadata_cell_type were not mapped and will be excluded from the analysis: <StringArray>\n",
"['stem', 'astro']\n",
"Length: 2, dtype: string\n",
"Analyzing category: control\n",
"Analyzing category: deletion\n",
"Analysis complete. Summary results saved to output/analysis_results/var_mad_int_featselect/cell_type_a_vs_b/neuron_vs_progen/summary_results.parquet\n",
"WARNING: The following values in Metadata_cell_type were not mapped and will be excluded from the analysis: <StringArray>\n",
"['progen', 'stem']\n",
"Length: 2, dtype: string\n",
"Analyzing category: control\n",
"Analyzing category: deletion\n",
"Analysis complete. Summary results saved to output/analysis_results/var_mad_int_featselect/cell_type_a_vs_b/neuron_vs_astro/summary_results.parquet\n",
"WARNING: The following values in Metadata_cell_type were not mapped and will be excluded from the analysis: <StringArray>\n",
"['neuron', 'stem']\n",
"Length: 2, dtype: string\n",
"Analyzing category: control\n",
"Analyzing category: deletion\n",
"Analysis complete. Summary results saved to output/analysis_results/var_mad_int_featselect/cell_type_a_vs_b/progen_vs_astro/summary_results.parquet\n"
]
}
],
"source": [
"data_level = \"var_mad_int_featselect\"\n",
"\n",
"run_analysis(data_level, feature_cols_pattern=\"Cells_|Cytoplasm_|Nuclei_\")"
]
}
],
"metadata": {
Expand Down
512 changes: 489 additions & 23 deletions 5.reanalysis/5.inspect-analysis.ipynb

Large diffs are not rendered by default.

194 changes: 194 additions & 0 deletions 5.reanalysis/7.replicability_map.ipynb

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions 5.reanalysis/copy_reprocessed_profiles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import shutil
from pathlib import Path
import logging

logging.basicConfig(level=logging.INFO)

# Define file mappings
files = [
(
Path("~/Documents/GitHub/jump-profiling-recipe/outputs/stem_public/profiles_var_mad_int_featselect.parquet").expanduser(),
Path("output/processed/var_mad_int_featselect/combined.parquet").expanduser(),
),
(
Path("~/Documents/GitHub/jump-profiling-recipe/outputs/stem_public/profiles_var_mad_int.parquet").expanduser(),
Path("output/processed/var_mad_int/combined.parquet").expanduser(),
),
(
Path("~/Documents/GitHub/jump-profiling-recipe/outputs/stem/metrics/profiles_var_mad_int_featselect_ap_nonrep.parquet").expanduser(),
Path("output/analysis_results/var_mad_int_featselect/metrics/ap_nonrep.parquet").expanduser(),
),
(
Path("~/Documents/GitHub/jump-profiling-recipe/outputs/stem/metrics/profiles_var_mad_int_featselect_map_nonrep.parquet").expanduser(),
Path("output/analysis_results/var_mad_int_featselect/metrics/map_nonrep.parquet").expanduser(),
)
]

# Copy and rename files
for source, target in files:
if not source.exists():
logging.warning(f"Source file {source} does not exist. Skipping.")
continue

if target.exists():
logging.warning(f"Target file {target} already exists. Skipping.")
continue

target_dir = target.parent
if not target_dir.exists():
try:
target_dir.mkdir(parents=True, exist_ok=True)
except OSError as e:
logging.error(f"Error creating directory {target_dir}: {e}")
continue

try:
shutil.copy(source, target)
logging.info(f"Copied {source} to {target}")
except IOError as e:
logging.error(f"Error copying file {source} to {target}: {e}")
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.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
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.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
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.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
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.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
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.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
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.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions 5.reanalysis/output/processed/var_mad_int/combined.parquet
Git LFS file not shown
Git LFS file not shown
1 change: 1 addition & 0 deletions ncp/src/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def visualize_results(input_file, output_dir):
capsize=3, # Adds caps to the error bars
)

plt.xlim(0.5, 1)
plt.title("Logistic Regression Accuracy vs Number of Significant Features")
plt.xlabel("Logistic Regression Accuracy")
plt.ylabel("Number of Significant Features")
Expand Down
Loading

0 comments on commit b0922ca

Please sign in to comment.