Skip to content

Commit

Permalink
clearer error message in QC
Browse files Browse the repository at this point in the history
  • Loading branch information
jykr committed Jul 2, 2024
1 parent 5214932 commit 13cbd6d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
2. [`profile`](https://pinellolab.github.io/crispr-bean/profile.html): Profile editing preferences of your editor.
3. [`qc`](https://pinellolab.github.io/crispr-bean/qc.html): Quality control report and filtering out / masking of aberrant sample and guides
4. [`filter`](https://pinellolab.github.io/crispr-bean/filter.html): Filter reporter alleles; essential for `tiling` mode that allows for all alleles generated from gRNA.
5. [`run`](https://pinellolab.github.io/crispr-bean/run.html): Quantify targeted variants' effect sizes from screen data. **See more about the [model](https://pinellolab.github.io/crispr-bean/model.html) & [output](https://github.com/pinellolab/crispr-bean/tree/main/docs/example_run_output)**
5. [`run`](https://pinellolab.github.io/crispr-bean/run.html): Quantify targeted variants' effect sizes from screen data. **See more about the [model](https://pinellolab.github.io/crispr-bean/model.html) & [output](https://pinellolab.github.io/crispr-bean/run.html#output)**
* Screen data is saved as [`ReporterScreen` object](https://pinellolab.github.io/crispr-bean/reporterscreen.html) in the pipeline.
BEAN stores mapped gRNA and allele counts in `ReporterScreen` object which is compatible with [AnnData](https://anndata.readthedocs.io/en/latest/index.html).

Expand Down
29 changes: 18 additions & 11 deletions bean/notebooks/sample_quality_report.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -262,17 +262,24 @@
"metadata": {},
"outputs": [],
"source": [
"ax = pt.qc.plot_lfc_correlation(\n",
" bdata,\n",
" selected_guides,\n",
" method=\"Spearman\",\n",
" cond1=comp_cond1,\n",
" cond2=comp_cond2,\n",
" rep_col=replicate_label,\n",
" compare_col=condition_label,\n",
" figsize=(10, 10),\n",
")\n",
"\n",
"try:\n",
" ax = pt.qc.plot_lfc_correlation(\n",
" bdata,\n",
" selected_guides,\n",
" method=\"Spearman\",\n",
" cond1=comp_cond1,\n",
" cond2=comp_cond2,\n",
" rep_col=replicate_label,\n",
" compare_col=condition_label,\n",
" figsize=(10, 10),\n",
" )\n",
"except ValueError as e:\n",
" if \"rep_col\" in str(e):\n",
" raise ValueError(f\"Column `{replicate_label}` fed in with `--replicate-col {replicate_label}` does not exist in the input .h5ad file. Please check your input.\") from e\n",
" elif \"compare_col\" in str(e):\n",
" raise ValueError(f\"Column `{condition_label}` fed in with `--condition-col {condition_label}` does not exist in the input .h5ad file. Please check your input.\") from e\n",
" elif \"cond1\" in str(e):\n",
" raise ValueError(f\"Samples with `{condition_label}` value of `{comp_cond1}` or `{comp_cond2}` does not exist. Check your input argument fed in with `--lfc-conds `{comp_cond1},{comp_cond2}`.\")\n",
"ax.set_title(\"top/bot LFC correlation, Spearman\")\n",
"plt.yticks(rotation=0)\n",
"plt.xticks(rotation=90)\n",
Expand Down

0 comments on commit 13cbd6d

Please sign in to comment.