flowcraft.templates.spades module

Purpose

This module is intended execute Spades on paired-end FastQ files.

Expected input

The following variables are expected whether using NextFlow or the main() executor.

  • sample_id : Sample Identification string.
    • e.g.: 'SampleA'
  • fastq_pair : Pair of FastQ file paths.
    • e.g.: 'SampleA_1.fastq.gz SampleA_2.fastq.gz'
  • kmers : Setting for Spades kmers. Can be either 'auto', 'default' or a user provided list.
    • e.g.: 'auto' or 'default' or '55 77 99 113 127'
  • opts : List of options for spades execution.
    1. The minimum number of reads to consider an edge in the de Bruijn graph during the assembly.
      • e.g.: '5'
    2. Minimum contigs k-mer coverage.
      • e.g.: ['2' '2']
  • clear : If ‘true’, remove the input fastq files at the end of the

    component run, IF THE FILES ARE IN THE WORK DIRECTORY

Generated output

  • contigs.fasta : Main output of spades with the assembly
    • e.g.: contigs.fasta
  • spades_status : Stores the status of the spades run. If it was successfully executed, it stores 'pass'. Otherwise, it stores the STDERR message.
    • e.g.: 'pass'

Code documentation

flowcraft.templates.spades.set_kmers(kmer_opt, max_read_len)[source]

Returns a kmer list based on the provided kmer option and max read len.

Parameters:
kmer_opt : str

The k-mer option. Can be either 'auto', 'default' or a sequence of space separated integers, '23, 45, 67'.

max_read_len : int

The maximum read length of the current sample.

Returns:
kmers : list

List of k-mer values that will be provided to Spades.

flowcraft.templates.spades.clean_up(fastq)[source]

Cleans the temporary fastq files. If they are symlinks, the link source is removed

Parameters:
fastq : list

List of fastq files.