Skip to content

Commit

Permalink
DOC: save grid fig from tut; rerun tut; Ecoli time
Browse files Browse the repository at this point in the history
So I was like "why is the E. coli example now taking like ~36 sec
to run, when it was taking ~29 seconds yesterday?" and from testing
it seems to go back down to ~30 sec when I closed all firefox tabs
except the jupyter one & the github one i had open LOLLLLL

so yeah idk. i updated the readme to say ~35 sec, which I think is
fair (erring on the side of being too harsh towards myself), but I
don't wanna slide into doing the stereotypical cs cherry picking
benchmarking jank. you know how it is
  • Loading branch information
fedarko committed Dec 29, 2024
1 parent 15c1aa9 commit dc57d37
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ from matplotlib import pyplot
# (skipping the part where I loaded the genomes into memory as e1s and e2s...)

# Create the matrix
# This takes ~30 seconds on a laptop with 8 GB of RAM
# This takes ~35 seconds on a laptop with 8 GB of RAM
em = wp.DotPlotMatrix(e1s, e2s, 20, verbose=True)

# Visualize the matrix using matplotlib's spy() function
Expand Down
58 changes: 26 additions & 32 deletions docs/Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,8 @@
" axes[row, col].axis(\"off\")\n",
"\n",
"fig.suptitle(f\"Dot plots ($k$ = {K}) of five random sequences\", fontsize=24, y=0.94)\n",
"fig.set_size_inches(15, 15)"
"fig.set_size_inches(15, 15)\n",
"fig.savefig(os.path.join(\"img\", \"grid.png\"), **savefig_kwargs)"
]
},
{
Expand Down Expand Up @@ -1198,15 +1199,16 @@
"output_type": "stream",
"text": [
"0.00s: Validating inputs...\n",
"0.46s: Finding forward matches between s1 and s2...\n",
"24.35s: Found 3,357,713 forward match cell(s).\n",
"24.35s: Computing ReverseComplement(s2)...\n",
"24.37s: Finding reverse-complementary matches between s1 and s2...\n",
"33.31s: Found 3,536,693 total (fwd and/or RC) match cell(s).\n",
"33.31s: Dot plot matrix density = 0.00%.\n",
"33.31s: Converting match information to COO format inputs...\n",
"35.11s: Creating sparse matrix from COO format inputs...\n",
"36.37s: Done creating the matrix.\n"
"0.47s: Will find matches using common_substrings().\n",
"0.47s: Finding forward matches between s1 and s2...\n",
"20.19s: Found 3,357,713 forward match cell(s).\n",
"20.19s: Computing ReverseComplement(s2)...\n",
"20.22s: Finding reverse-complementary matches between s1 and s2...\n",
"27.36s: Found 3,536,693 total (fwd and/or RC) match cell(s).\n",
"27.36s: Dot plot matrix density = 0.00%.\n",
"27.37s: Converting match information to COO format inputs...\n",
"29.24s: Creating sparse matrix from COO format inputs...\n",
"30.38s: Done creating the matrix.\n"
]
}
],
Expand All @@ -1219,7 +1221,7 @@
"id": "8902f8f0",
"metadata": {},
"source": [
"Creating the matrix usually takes about 30 seconds (on my six-year old laptop with 8 GB of RAM). All things considered, not too shabby!"
"Creating the matrix usually takes about 30 seconds (on my six-year old laptop with 8 GB of RAM). (... Or closer to 40 seconds when I have a lot of stuff open.) All things considered, not too shabby!"
]
},
{
Expand Down Expand Up @@ -1304,7 +1306,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 30,
"id": "f8bc2e3a",
"metadata": {},
"outputs": [
Expand All @@ -1314,13 +1316,13 @@
"text": [
"0.03s: binary is not True, so we'll draw matches in different colors.\n",
"0.03s: Visualizing \"1\" cells with spy()...\n",
"0.52s: Done visualizing \"1\" cells.\n",
"0.52s: Visualizing \"-1\" cells with spy()...\n",
"0.75s: Done visualizing \"-1\" cells.\n",
"0.75s: Visualizing \"2\" cells with spy()...\n",
"0.99s: Done visualizing \"2\" cells.\n",
"0.99s: Slightly restyling the visualization...\n",
"0.99s: Done.\n"
"0.42s: Done visualizing \"1\" cells.\n",
"0.42s: Visualizing \"-1\" cells with spy()...\n",
"0.66s: Done visualizing \"-1\" cells.\n",
"0.66s: Visualizing \"2\" cells with spy()...\n",
"0.91s: Done visualizing \"2\" cells.\n",
"0.91s: Slightly restyling the visualization...\n",
"0.91s: Done.\n"
]
},
{
Expand Down Expand Up @@ -1364,18 +1366,18 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 31,
"id": "7bf44264",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.03s: binary is True; visualizing all match cells with spy()...\n",
"0.17s: Done visualizing all match cells.\n",
"0.18s: Slightly restyling the visualization...\n",
"0.18s: Done.\n"
"0.05s: binary is True; visualizing all match cells with spy()...\n",
"0.24s: Done visualizing all match cells.\n",
"0.24s: Slightly restyling the visualization...\n",
"0.24s: Done.\n"
]
},
{
Expand All @@ -1398,14 +1400,6 @@
"ax.set_ylabel(f\"$E. coli$ O157:H7 str. Sakai ({len(e2s)/1e6:.2f} Mbp) \\u2192\")\n",
"fig.set_size_inches(8, 8)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e9a33a5b",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Binary file added docs/img/grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dc57d37

Please sign in to comment.