Skip to content

Read preprocessing

CormacKinsella edited this page Oct 7, 2025 · 2 revisions

Fastp

Quality controls raw FASTQ files and reports statistics.

Sample type dependent behaviour:

  • Merges ancient paired-end data
  • Does not merge modern paired-end data
  • Allows for pre-merged data, in which case ancient and modern are treated the same

General behaviour:

  • Trims adapters
  • Applies length filter
  • Calculates duplication levels (removal is optional, see below)
  • Reports statistics in HTML and JSON formats
  • Carries out overrepresentation analysis
  • Corrects paired-end reads in overlapping regions

Usage: fastp [options] ...

Example grave command:

fastp --in1 ${reads[0]} --in2 ${reads[1]} --merge --merged_out ${meta.read_group}.fastp.fq.gz --html ${meta.read_group}.fastp.html --json ${meta.read_group}.fastp.json --dup_calc_accuracy ${params.dupCalcAccuracy} --overrepresentation_analysis --length_required ${params.readDiscardLength} --thread ${task.cpus} ${args} ${args2} --detect_adapter_for_pe --correction

  • --in1 forward read
  • --in2 reverse read
  • --merge for paired-end input, merge each pair of reads into a single read if they are overlapped
  • --merged_out in the merging mode, specify the file name to store merged output
  • --html html report file
  • --json json report file
  • --dup_calc_accuracy memory level to assign for exact hash duplication calculation (default 1, low memory - see args2)
  • --overrepresentation_analysis carry out analysis of overrepresented sequences
  • --length_required minimum length cutoff for reads
  • --thread worker thread number
  • ${args} controlled by user param --discardUnmerged. If false, supplies --include_unmerged (default false, keep unmerged)
  • ${args2} controlled by user param --fastpDedup. If true, turns on exact hash duplicate removal by supplying --dedup (default false, no deduplication). If setting true, it is recommended to increase memory provided to fastp via --dupCalcAccuracy (e.g. to 3+)
  • --detect_adapter_for_pe enable adapter detection for PE data to get ultra-clean data
  • --correction enable base correction in overlapped regions (only for PE data)

Fastqc

Reports quality metrics and statistics for FASTQ files. Grave runs this twice, once on the raw data and once on the fastp processed data.

Usage: fastqc seqfile1 seqfile2 .. seqfileN

Example grave command:

fastqc --format fastq --threads ${task.cpus} ${reads}

Clone this wiki locally