bb_plot_quality_per_base - ampinzonv/BB3 GitHub Wiki

Function: bb_plot_quality_per_base

Plot an ASCII vertical histogram showing average quality per base position from a FASTQ file.


๐Ÿ” Description

This function calculates the average quality score for each base position across a sample of FASTQ reads. The result is plotted as a vertical ASCII histogram showing quality scores by base position.


๐Ÿ“ฅ Input

  • FASTQ file (plain or gzipped)
  • STDIN is supported via --input -

๐Ÿ“ค Output

  • An ASCII chart showing vertical bars of quality scores per base position.
  • Default output is STDOUT, or you can specify a file with --outfile.


๐Ÿงช Examples

Use 10% of reads (default):

bb_plot_quality_per_base --input reads.fastq

Use 25% of reads and change Phred offset:

bb_plot_quality_per_base --input reads.fastq --sample_size 25 --phred_offset 64

Save plot to file:

bb_plot_quality_per_base --input reads.fastq --outfile qual_per_base.txt

Use compressed input:

bb_plot_quality_per_base --input reads.fastq.gz

โš™๏ธ Usage

bb_plot_quality_per_base --input FILE [--sample_size PCT] [--phred_offset N] [--outfile FILE] [--quiet] [--force]

๐Ÿงต Options

Option Description
--input FILE FASTQ file or - for STDIN (required)
--sample_size PCT Percentage of reads to sample (default: 10)
--phred_offset N ASCII offset for quality encoding (default: 33)
--outfile FILE Output file for the histogram (default: STDOUT)
--quiet Suppress log messages
--force Overwrite output file if it exists

๐Ÿ“Œ Notes

  • ASCII histogram uses * and | symbols to display the vertical plot.
  • Output includes X-axis position labels and Y-axis quality scale.
  • Works well for detecting base-specific drops in read quality (e.g., 3'-end degradation).