Skip to content

Commit

Permalink
plot curves with draw_in_bounds so line does not go past points (#43)
Browse files Browse the repository at this point in the history
Draw neutralization curves using `draw_in_bounds=True` with `neutcurve` to avoid lines extrapolating beyond data. Addresses [this issue](jbloomlab/neutcurve#59).
  • Loading branch information
jbloom authored Apr 11, 2024
1 parent 069434a commit 3c762ad
Show file tree
Hide file tree
Showing 13 changed files with 382 additions and 354 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- `altair` to 5.3
- `python` to 3.12

- Draw neutralization curves using `draw_in_bounds=True` with `neutcurve` to avoid lines extrapolating beyond data. Addresses [this issue](https://github.com/jbloomlab/neutcurve/issues/59).

## version 3.0.0
- In `curvefit_params` in the YAML configuration, now `fixslope` should be specified in addition `fixtop` and `fixbottom`. In addition, all three of these can be set to constraint ranges rather than just totally free or to fixed values. Alongside this change, the slope of curve fits are now reported in key output files. Addresses [this issue](https://github.com/jbloomlab/neutcurve/issues/53) and [this issue](https://github.com/jbloomlab/seqneut-pipeline/issues/32).
- This is a **backward-incompatible change** in the configuration YAML, now you must specify `fixslope` under `curvefit_params`.
Expand Down
52 changes: 26 additions & 26 deletions docs/aggregate_qc_drops.html

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions docs/pilot_A23038d0_r32_75K_titers.html

Large diffs are not rendered by default.

166 changes: 84 additions & 82 deletions docs/process_H3N2_plate.html

Large diffs are not rendered by default.

170 changes: 86 additions & 84 deletions docs/process_plate11.html

Large diffs are not rendered by default.

172 changes: 90 additions & 82 deletions docs/process_plate2.html

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions docs/serum_M099d0_titers.html

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions docs/serum_M099d30_titers.html

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions docs/serum_Y044d30_titers.html

Large diffs are not rendered by default.

32 changes: 17 additions & 15 deletions docs/serum_Y154d182_titers.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion funcs.smk
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def process_plate(plate, plate_params):
plate_d = copy.deepcopy(plate_params)
plate_d["group"] = str(plate_d["group"])
plate_d["date"] = str(plate_d["date"])
if not re.fullmatch("\d{4}\-\d{2}\-\d{2}", str(plate_d["date"])):
if not re.fullmatch(r"\d{4}\-\d{2}\-\d{2}", str(plate_d["date"])):
raise ValueError(f"{plate =} {plate_d['date'] =} not in YYYY-MM-DD format")

# Process samples_csv to create the sample data frame
Expand Down
2 changes: 2 additions & 0 deletions notebooks/group_serum_titers.py.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@
" heightscale=1.2,\n",
" widthscale=1.2,\n",
" subplot_titles=\"{virus}\",\n",
" draw_in_bounds=True,\n",
" )\n",
" _ = fig.suptitle(\n",
" f\"neutralization curves for viruses failing QC for {group} {serum}\",\n",
Expand Down Expand Up @@ -532,6 +533,7 @@
" widthscale=1.2,\n",
" subplot_titles=\"{virus}\",\n",
" viruses=[v for v in viruses if v not in viruses_to_drop],\n",
" draw_in_bounds=True,\n",
")\n",
"_ = fig.suptitle(\n",
" f\"neutralization curves for retained viruses for {group} {serum}\",\n",
Expand Down
2 changes: 2 additions & 0 deletions notebooks/process_plate.py.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,7 @@
" titlesize=10,\n",
" ticksize=10,\n",
" ncol=6,\n",
" draw_in_bounds=True,\n",
" )\n",
" display(fig)\n",
" plt.close(fig)\n",
Expand Down Expand Up @@ -1417,6 +1418,7 @@
" titlesize=10,\n",
" ticksize=10,\n",
" ncol=6,\n",
" draw_in_bounds=True,\n",
" )\n",
"else:\n",
" print(\"No sera passed QC.\")"
Expand Down

0 comments on commit 3c762ad

Please sign in to comment.