{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Fast5_to_seq_summary CLI Usage" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Activate virtual environment" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2020-01-09T16:59:07.547949Z", "start_time": "2020-01-09T16:59:06.847121Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(pycoQC) " ] }, { "ename": "", "evalue": "1", "output_type": "error", "traceback": [] } ], "source": [ "# Using virtualenvwrapper here but can also be done with Conda \n", "workon pycoQC" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Getting help" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2020-01-09T16:59:11.017141Z", "start_time": "2020-01-09T16:59:08.561543Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "usage: Fast5_to_seq_summary [-h] [--version] --fast5_dir FAST5_DIR\n", " --seq_summary_fn SEQ_SUMMARY_FN\n", " [--max_fast5 MAX_FAST5] [--threads THREADS]\n", " [--basecall_id BASECALL_ID]\n", " [--fields FIELDS [FIELDS ...]] [--include_path]\n", " [--verbose_level VERBOSE_LEVEL]\n", "\n", "Fast5_to_seq_summary generate a sequencing summary like file from a directory\n", "containing Fast5 files\n", "\n", "optional arguments:\n", " -h, --help show this help message and exit\n", " --version, -v show program's version number and exit\n", " --fast5_dir FAST5_DIR, -f FAST5_DIR\n", " Directory containing fast5 files. Can contain multiple\n", " subdirectories\n", " --seq_summary_fn SEQ_SUMMARY_FN, -s SEQ_SUMMARY_FN\n", " path of the summary sequencing file where to write the\n", " data extracted from the fast5 files\n", " --max_fast5 MAX_FAST5\n", " Maximum number of file to try to parse. 0 to\n", " deactivate (default: 0)\n", " --threads THREADS, -t THREADS\n", " Total number of threads to use. 1 thread is used for\n", " the reader and 1 for the writer. Minimum 3 (default:\n", " 4)\n", " --basecall_id BASECALL_ID\n", " id of the basecalling group. By default leave to 0,\n", " but if you perfome multiple basecalling on the same\n", " fast5 files, this can be used to indicate the\n", " corresponding group (1, 2 ...) (default: 0)\n", " --fields FIELDS [FIELDS ...]\n", " list of field names corresponding to attributes to try\n", " to fetch from the fast5 files (default: ['read_id',\n", " 'run_id', 'channel', 'start_time',\n", " 'sequence_length_template', 'mean_qscore_template',\n", " 'calibration_strand_genome_template',\n", " 'barcode_arrangement'])\n", " --include_path If given, the absolute path to the corresponding file\n", " is added in an extra column (default: False)\n", " --verbose_level VERBOSE_LEVEL\n", " Level of verbosity, from 2 (Chatty) to 0 (Nothing)\n", " (default: 0)\n", "(pycoQC) " ] }, { "ename": "", "evalue": "1", "output_type": "error", "traceback": [] } ], "source": [ "Fast5_to_seq_summary -h" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Usage examples" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Basic usage " ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2020-01-09T16:59:17.829814Z", "start_time": "2020-01-09T16:59:15.026532Z" }, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "22 reads [00:00, 811.31 reads/s]\n", "Total reads: 22 / Average speed: 543.6 reads/s\n", "\n", "(pycoQC) (pycoQC) read_id\trun_id\tchannel\tstart_time\tsequence_length_template\tmean_qscore_template\tcalibration_strand_genome_template\n", "5b7fadd0-c646-4c7b-9800-66ee658a5ca8\t40ebe55356ada6c830fa793745ef4c498d896c73\t150\t37\t468\t7.608\tfiltered_out\n", "e6a8e4d0-7b3c-471a-be26-fa7857d12663\t40ebe55356ada6c830fa793745ef4c498d896c73\t318\t15\t392\t8.304\tfiltered_out\n", "2c32553e-62c6-4c7a-bf05-249771364f04\t40ebe55356ada6c830fa793745ef4c498d896c73\t237\t11\t1151\t8.544\tfiltered_out\n", "f8325de9-a77e-4616-a4a8-69ecf32e1688\t40ebe55356ada6c830fa793745ef4c498d896c73\t354\t16\t568\t8.206\tfiltered_out\n", "6af04302-04c8-4d8d-8e87-aa69178b3f24\t40ebe55356ada6c830fa793745ef4c498d896c73\t36\t26\t832\t8.234\tfiltered_out\n", "3e81c32a-f2ee-4719-a88d-e0affe93d26f\t40ebe55356ada6c830fa793745ef4c498d896c73\t348\t24\t1137\t8.124\tfiltered_out\n", "68804104-71dc-465c-b82d-3a99a4689701\t40ebe55356ada6c830fa793745ef4c498d896c73\t38\t20\t1010\t8.325\tfiltered_out\n", "37dfa1d5-5d84-486c-bf47-9eb6438f5645\t40ebe55356ada6c830fa793745ef4c498d896c73\t410\t30\t555\t8.219\tfiltered_out\n", "3784283c-47cc-48ac-8d7b-7efd32123b56\t40ebe55356ada6c830fa793745ef4c498d896c73\t243\t20\t893\t8.54\tfiltered_out\n", "(pycoQC) " ] }, { "ename": "", "evalue": "1", "output_type": "error", "traceback": [] } ], "source": [ "Fast5_to_seq_summary \\\n", " -f data/ \\\n", " -s results/summary_sequencing.tsv\n", " \n", "head results/summary_sequencing.tsv" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Multi-threading support" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2020-01-09T16:59:22.029115Z", "start_time": "2020-01-09T16:59:19.426510Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "22 reads [00:00, 1129.77 reads/s]\n", "Total reads: 22 / Average speed: 650.82 reads/s\n", "\n", "(pycoQC) (pycoQC) read_id\trun_id\tchannel\tstart_time\tsequence_length_template\tmean_qscore_template\tcalibration_strand_genome_template\n", "5b7fadd0-c646-4c7b-9800-66ee658a5ca8\t40ebe55356ada6c830fa793745ef4c498d896c73\t150\t37\t468\t7.608\tfiltered_out\n", "e6a8e4d0-7b3c-471a-be26-fa7857d12663\t40ebe55356ada6c830fa793745ef4c498d896c73\t318\t15\t392\t8.304\tfiltered_out\n", "f8325de9-a77e-4616-a4a8-69ecf32e1688\t40ebe55356ada6c830fa793745ef4c498d896c73\t354\t16\t568\t8.206\tfiltered_out\n", "2c32553e-62c6-4c7a-bf05-249771364f04\t40ebe55356ada6c830fa793745ef4c498d896c73\t237\t11\t1151\t8.544\tfiltered_out\n", "6af04302-04c8-4d8d-8e87-aa69178b3f24\t40ebe55356ada6c830fa793745ef4c498d896c73\t36\t26\t832\t8.234\tfiltered_out\n", "68804104-71dc-465c-b82d-3a99a4689701\t40ebe55356ada6c830fa793745ef4c498d896c73\t38\t20\t1010\t8.325\tfiltered_out\n", "3e81c32a-f2ee-4719-a88d-e0affe93d26f\t40ebe55356ada6c830fa793745ef4c498d896c73\t348\t24\t1137\t8.124\tfiltered_out\n", "37dfa1d5-5d84-486c-bf47-9eb6438f5645\t40ebe55356ada6c830fa793745ef4c498d896c73\t410\t30\t555\t8.219\tfiltered_out\n", "3784283c-47cc-48ac-8d7b-7efd32123b56\t40ebe55356ada6c830fa793745ef4c498d896c73\t243\t20\t893\t8.54\tfiltered_out\n", "(pycoQC) " ] }, { "ename": "", "evalue": "1", "output_type": "error", "traceback": [] } ], "source": [ "Fast5_to_seq_summary \\\n", " -f data/ \\\n", " -s results/summary_sequencing.tsv \\\n", " -t 6\n", " \n", "head results/summary_sequencing.tsv" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Customize fields of the summary file" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2020-01-09T16:59:26.605976Z", "start_time": "2020-01-09T16:59:23.741610Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Check input data and options\n", "Start processing fast5 files\n", "22 reads [00:00, 821.28 reads/s]\n", "Overall counts \tvalid files: 22\n", "\n", "fields found \tmean_qscore_template: 22\n", "\tcalled_events: 22\n", "\tduration: 22\n", "\tstrand_score: 22\n", "\n", "fields not found \n", "Total reads: 22 / Average speed: 464.09 reads/s\n", "\n", "(pycoQC) (pycoQC) mean_qscore_template\tcalled_events\tduration\tstrand_score\n", "8.304\t1547\t23218\t-0.0008\n", "8.325\t3846\t57697\t-0.0004\n", "7.608\t1615\t24233\t-0.0007\n", "8.219\t2080\t31208\t-0.0011\n", "7.805\t1438\t21583\t-0.0006\n", "8.544\t3740\t56107\t-0.0003\n", "8.23\t2778\t51387\t-0.0007\n", "8.741\t3117\t46767\t-0.0006\n", "8.987\t4235\t63526\t-0.0003\n", "(pycoQC) " ] }, { "ename": "", "evalue": "1", "output_type": "error", "traceback": [] } ], "source": [ "Fast5_to_seq_summary \\\n", " -f data/ \\\n", " -s results/custom_summary_sequencing.tsv \\\n", " --verbose_level 1 \\\n", " --fields mean_qscore_template called_events duration strand_score\n", " \n", "head results/custom_summary_sequencing.tsv" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Add file path" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2020-01-09T16:59:30.169908Z", "start_time": "2020-01-09T16:59:27.269554Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Check input data and options\n", "Start processing fast5 files\n", "22 reads [00:00, 493.99 reads/s]\n", "Overall counts \tvalid files: 22\n", "\n", "fields found \tread_id: 22\n", "\trun_id: 22\n", "\tchannel: 22\n", "\tstart_time: 22\n", "\tsequence_length_template: 22\n", "\tmean_qscore_template: 22\n", "\tcalibration_strand_genome_template: 22\n", "\n", "fields not found \tbarcode_arrangement: 22\n", "\n", "Total reads: 22 / Average speed: 364.14 reads/s\n", "\n", "(pycoQC) (pycoQC) read_id\trun_id\tchannel\tstart_time\tsequence_length_template\tmean_qscore_template\tcalibration_strand_genome_template\tpath\n", "5b7fadd0-c646-4c7b-9800-66ee658a5ca8\t40ebe55356ada6c830fa793745ef4c498d896c73\t150\t37\t468\t7.608\tfiltered_out\t/home/aleg/Programming/Packages/pycoQC/docs/Fast5_to_seq_summary/data/20180625_FAH77625_MN23126_sequencing_run_S1_57529_read_10_ch_150_strand.fast5\n", "2c32553e-62c6-4c7a-bf05-249771364f04\t40ebe55356ada6c830fa793745ef4c498d896c73\t237\t11\t1151\t8.544\tfiltered_out\t/home/aleg/Programming/Packages/pycoQC/docs/Fast5_to_seq_summary/data/20180625_FAH77625_MN23126_sequencing_run_S1_57529_read_10_ch_237_strand.fast5\n", "e6a8e4d0-7b3c-471a-be26-fa7857d12663\t40ebe55356ada6c830fa793745ef4c498d896c73\t318\t15\t392\t8.304\tfiltered_out\t/home/aleg/Programming/Packages/pycoQC/docs/Fast5_to_seq_summary/data/20180625_FAH77625_MN23126_sequencing_run_S1_57529_read_10_ch_318_strand.fast5\n", "f8325de9-a77e-4616-a4a8-69ecf32e1688\t40ebe55356ada6c830fa793745ef4c498d896c73\t354\t16\t568\t8.206\tfiltered_out\t/home/aleg/Programming/Packages/pycoQC/docs/Fast5_to_seq_summary/data/20180625_FAH77625_MN23126_sequencing_run_S1_57529_read_10_ch_354_strand.fast5\n", "3e81c32a-f2ee-4719-a88d-e0affe93d26f\t40ebe55356ada6c830fa793745ef4c498d896c73\t348\t24\t1137\t8.124\tfiltered_out\t/home/aleg/Programming/Packages/pycoQC/docs/Fast5_to_seq_summary/data/20180625_FAH77625_MN23126_sequencing_run_S1_57529_read_10_ch_348_strand.fast5\n", "37dfa1d5-5d84-486c-bf47-9eb6438f5645\t40ebe55356ada6c830fa793745ef4c498d896c73\t410\t30\t555\t8.219\tfiltered_out\t/home/aleg/Programming/Packages/pycoQC/docs/Fast5_to_seq_summary/data/20180625_FAH77625_MN23126_sequencing_run_S1_57529_read_10_ch_410_strand.fast5\n", "9a1c5296-2ab1-4abd-8d50-e059754cf332\t40ebe55356ada6c830fa793745ef4c498d896c73\t319\t33\t1235\t8.119\tfiltered_out\t/home/aleg/Programming/Packages/pycoQC/docs/Fast5_to_seq_summary/data/20180625_FAH77625_MN23126_sequencing_run_S1_57529_read_10_ch_319_strand.fast5\n", "6af04302-04c8-4d8d-8e87-aa69178b3f24\t40ebe55356ada6c830fa793745ef4c498d896c73\t36\t26\t832\t8.234\tfiltered_out\t/home/aleg/Programming/Packages/pycoQC/docs/Fast5_to_seq_summary/data/20180625_FAH77625_MN23126_sequencing_run_S1_57529_read_10_ch_36_strand.fast5\n", "0ef36fa0-7c3f-47f5-8410-027f50724701\t40ebe55356ada6c830fa793745ef4c498d896c73\t108\t26\t915\t9.407\tfiltered_out\t/home/aleg/Programming/Packages/pycoQC/docs/Fast5_to_seq_summary/data/20180625_FAH77625_MN23126_sequencing_run_S1_57529_read_10_ch_108_strand.fast5\n", "(pycoQC) " ] }, { "ename": "", "evalue": "1", "output_type": "error", "traceback": [] } ], "source": [ "Fast5_to_seq_summary \\\n", " -f data/ \\\n", " -s results/fn_summary_sequencing.tsv \\\n", " --verbose_level 1 \\\n", " --include_path\n", " \n", "head results/fn_summary_sequencing.tsv" ] } ], "metadata": { "celltoolbar": "Initialization Cell", "hide_input": false, "kernelspec": { "display_name": "Bash", "language": "bash", "name": "bash" }, "language_info": { "codemirror_mode": "shell", "file_extension": ".sh", "mimetype": "text/x-sh", "name": "bash" }, "widgets": { "state": {}, "version": "1.1.1" } }, "nbformat": 4, "nbformat_minor": 1 }