Skip to content

Commit

Permalink
Replace t2pks.hmm with RREFam in documentation [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Apr 20, 2024
1 parent 8cf9a2e commit c5234e5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/examples/performance_tips.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"outputs": [],
"source": [
"import pyhmmer\n",
"%timeit list(pyhmmer.plan7.HMMFile(\"data/hmms/txt/t2pks.hmm\"))\n",
"%timeit list(pyhmmer.plan7.HMMFile(\"data/hmms/bin/t2pks.h3m\"))"
"%timeit list(pyhmmer.plan7.HMMFile(\"data/hmms/txt/RREFam.hmm\"))\n",
"%timeit list(pyhmmer.plan7.HMMFile(\"data/hmms/bin/RREFam.h3m\"))"
]
},
{
Expand Down Expand Up @@ -68,13 +68,13 @@
"import time\n",
"import pyhmmer\n",
"\n",
"with pyhmmer.plan7.HMMFile(\"data/hmms/bin/t2pks.h3m\") as hmms:\n",
"with pyhmmer.plan7.HMMFile(\"data/hmms/bin/RREFam.h3m\") as hmms:\n",
" with pyhmmer.easel.SequenceFile(\"data/seqs/938293.PRJEB85.HG003687.faa\", digital=True) as seqs:\n",
" t1 = time.time()\n",
" total = sum(len(hits) for hits in pyhmmer.hmmer.hmmsearch(hmms, seqs))\n",
" print(f\"- hmmsearch found a total of {total} hits in {time.time() - t1:.3} seconds\")\n",
" \n",
"with pyhmmer.plan7.HMMFile(\"data/hmms/bin/t2pks.h3m\") as hmms:\n",
"with pyhmmer.plan7.HMMFile(\"data/hmms/bin/RREFam.h3m\") as hmms:\n",
" with pyhmmer.easel.SequenceFile(\"data/seqs/938293.PRJEB85.HG003687.faa\", digital=True) as seqs:\n",
" t1 = time.time()\n",
" total = sum(len(hits) for hits in pyhmmer.hmmer.hmmscan(seqs, hmms))\n",
Expand Down Expand Up @@ -119,7 +119,7 @@
"source": [
"# loading targets iteratively - slow, but no extra memory needed\n",
"t1 = time.time()\n",
"with pyhmmer.plan7.HMMFile(\"data/hmms/bin/t2pks.h3m\") as hmms:\n",
"with pyhmmer.plan7.HMMFile(\"data/hmms/bin/RREFam.h3m\") as hmms:\n",
" with pyhmmer.easel.SequenceFile(\"data/seqs/938293.PRJEB85.HG003687.faa\", digital=True) as seqs:\n",
" total = sum(len(hits) for hits in pyhmmer.hmmer.hmmsearch(hmms, seqs))\n",
" print(f\"- hmmsearch without prefetching took {time.time() - t1:.3} seconds\")\n",
Expand All @@ -128,7 +128,7 @@
"t1 = time.time()\n",
"with pyhmmer.easel.SequenceFile(\"data/seqs/938293.PRJEB85.HG003687.faa\", digital=True) as seq_file:\n",
" seqs = seq_file.read_block()\n",
"with pyhmmer.plan7.HMMFile(\"data/hmms/bin/t2pks.h3m\") as hmms:\n",
"with pyhmmer.plan7.HMMFile(\"data/hmms/bin/RREFam.h3m\") as hmms:\n",
" total = sum(len(hits) for hits in pyhmmer.hmmer.hmmsearch(hmms, seqs))\n",
" print(f\"- hmmsearch with prefetching took {time.time() - t1:.3} seconds\")"
]
Expand Down Expand Up @@ -184,7 +184,7 @@
"print(f\"Available memory: {available_memory/1024:.1f} KiB\")\n",
"print(f\"Database on-disk size: {target_size/1024:.1f} KiB\")\n",
"\n",
"with pyhmmer.plan7.HMMFile(\"data/hmms/bin/t2pks.h3m\") as hmm_file:\n",
"with pyhmmer.plan7.HMMFile(\"data/hmms/bin/RREFam.h3m\") as hmm_file:\n",
" with pyhmmer.easel.SequenceFile(\"data/seqs/938293.PRJEB85.HG003687.faa\", digital=True) as seq_file:\n",
" if target_size < available_memory * 0.1:\n",
" print(\"Pre-fetching targets into memory\")\n",
Expand Down Expand Up @@ -228,7 +228,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down

0 comments on commit c5234e5

Please sign in to comment.