NanoPlot

repository·master·Indexed 20 days ago

https://github.com/wdecoster/nanoplot

A specialized plotting tool for visualizing long read sequencing data and alignments. It supports various input formats including FASTQ, FASTA, BAM, and CRAM, generating statistical summaries, various plots, and an HTML summary file.

Tokens
1.1K
Snippets
2
Records
6
Agent score
19%

What's inside NanoPlot

  1. Use NanoPlot to plot sequencing data

    master

    NanoPlot is a tool for plotting long read sequencing data and alignments. It generates a statistical summary, various plots, and an HTML summary file.

    Basic Usage Patterns:

    • From a summary file (fastest):
      NanoPlot --summary sequencing_summary.txt --loglength -o summary-plots-log-transformed
    • From FASTQ files with filtering and specific plot types:
      NanoPlot -t 2 --fastq reads1.fastq.gz reads2.fastq.gz --maxlength 40000 --plots dot --legacy hex
    • From BAM files with downsampling:
      NanoPlot --color yellow --bam alignment1.bam alignment2.bam alignment3.bam --downsample 10000 -o bamplots_downsampled
    NanoPlot --summary sequencing_summary.txt --loglength -o summary-plots-log-transformed
  2. Install NanoPlot via pip or conda

    master

    NanoPlot can be installed using pip or conda. It is written for Python 3.

    Using pip:

    pip install NanoPlot

    To upgrade to a newer version:

    pip install NanoPlot --upgrade

    Using conda:

    conda install -c bioconda nanoplot
    pip install NanoPlot
  3. Configure NanoPlot filtering and transformation options

    master

    Use these options to modify the data before plotting:

    OptionDescription
    --maxlength NHide reads longer than N
    --minlength NHide reads shorter than N
    --drop_outliersDrop outlier reads with extreme long length
    --downsample NReduce dataset to N reads by random sampling (done after data collection)
    --loglengthShow logarithmic scaling of lengths in plots
    --percentqualUse qualities as theoretical percent identities
    --alengthUse aligned read lengths rather than sequenced length (for BAM mode)
    --minqual NDrop reads with an average quality lower than N
    --runtime_until NOnly take the first N hours of a run
    --readtype {1D,2D,1D2}Specify read type for summary extraction
    --barcodedSplit summary file by barcode
    --no_supplementaryRemove supplementary alignments
  4. Configure NanoPlot general execution options

    master

    General flags for controlling execution and output directory:

    OptionDescription
    -t, --threads THREADSSet number of threads
    --verboseWrite log messages to terminal
    --storeStore extracted data in a pickle file
    --rawStore extracted data in a TSV file
    --hugeFlag for very large single input files
    -o, --outdir OUTDIRSpecify output directory
    --no_staticDo not make static (png) plots
    -p, --prefix PREFIXSpecify output file prefix
    --tsv_statsOutput stats file as a formatted TSV
    --info_in_reportAdd NanoPlot run info to the report
  5. Configure NanoPlot plot customization and output

    master

    Customize the visual appearance and output formats of the generated plots:

    OptionDescription
    -c, --color COLORSpecify a matplotlib color
    -cm, --colormap COLORMAPSpecify a matplotlib colormap for heatmaps
    -f, --format [formats]Output formats: png, jpg, jpeg, webp, svg, pdf, eps, json
    --plots [types]Specify bivariate plots to make (uses Plotly for kde and dot; hex is ignored here)
    --legacy [types]Specify bivariate plots using legacy mode (uses Seaborn/Matplotlib; required for hex)
    --listcolorsList available colors and exit
    --listcolormapsList available colormaps and exit
    --no-N50Hide N50 mark in read length histogram
    --N50Show N50 mark in read length histogram
    --title TITLEAdd a title to all plots
    --font_scale FONT_SCALEScale plot fonts
    --dpi DPISet image DPI
    --hide_statsHide Pearson R stats in some bivariate plots
  6. Configure NanoPlot input data sources

    master

    NanoPlot requires exactly one of the following input source flags. You can provide multiple files for most of these.

    FlagDescription
    --fastq file [file ...]Default FASTQ files (supports bgzip, bzip2, gzip)
    --fasta file [file ...]FASTA files (supports bgzip, bzip2, gzip)
    --fastq_rich file [file ...]FASTQ files from albacore, MinKNOW, or guppy with channel/time info
    --fastq_minimal file [file ...]Swiftly extracted FASTQ files from albacore, MinKNOW, or guppy
    --summary file [file ...]Summary files from albacore or guppy
    --bam file [file ...]Sorted BAM files
    --ubam file [file ...]Unmapped BAM files
    --cram file [file ...]Sorted CRAM files
    --pickle picklePreviously stored pickle file
    --feather/--arrow file [file ...]Feather or Arrow files