Assembly II: Assembling with IDBA-UD¶
Objectives
All work for this exercise will occur in the 2.assembly/ directory.
The standard input files for IDBA-UD¶
Although they both make use of the same types of data, IDBA-UD has a different preference from SPAdes for how sequence data is provided. So what does IDBA-UD accept?
Load IDBA-UD and check parameters
IDBA-UD parameters
-o, --out arg (=out) output directory
-r, --read arg fasta read file (<=128)
--read_level_2 arg paired-end reads fasta for second level scaffolds
--read_level_3 arg paired-end reads fasta for third level scaffolds
--read_level_4 arg paired-end reads fasta for fourth level scaffolds
--read_level_5 arg paired-end reads fasta for fifth level scaffolds
-l, --long_read arg fasta long read file (>128)
--mink arg (=20) minimum k value (<=124)
--maxk arg (=100) maximum k value (<=124)
--step arg (=20) increment of k-mer of each iteration
--inner_mink arg (=10) inner minimum k value
--inner_step arg (=5) inner increment of k-mer
--prefix arg (=3) prefix length used to build sub k-mer table
--min_count arg (=2) minimum multiplicity for filtering k-mer when building the graph
--min_support arg (=1) minimum support in each iteration
--num_threads arg (=0) number of threads
--seed_kmer arg (=30) seed kmer size for alignment
--min_contig arg (=200) minimum size of contig
--similar arg (=0.95) similarity for alignment
--max_mismatch arg (=3) max mismatch of error correction
--min_pairs arg (=3) minimum number of pairs
--no_bubble do not merge bubble
--no_local do not use local assembly
--no_coverage do not iterate on coverage
--no_correct do not do correction
--pre_correction perform pre-correction before assembly
'Short' or 'long' reads, and only a single file for each. This means that if we want to assemble our community data using IDBA-UD we will need to pool the paired-end data into a single, interleaved FASTA file. Interleaved means that instead of having a pair of files that contain the separate forward and reverse sequences, the read pairs are in a single file in alternating order. For example
# Paired-end file, forward
>read1_1
...
>read2_1
...
# Paired-end file, reverse
>read1_2
...
>read2_2
...
# Interleaved file
>read1_1
...
>read1_2
...
>read2_1
...
>read2_2
...
Fortunately, the IDBA set of tools comes with some helper scripts to achieve just this. Unfortunately we cannot apply this shuffling operation to compressed data, so we must decompress the data first.
Decompress, interleave, and then concatenate sequence files
Basic assembly parameters¶
Setting the k-mer size¶
For IDBA-UD, we can select the k-mer size using
Unlike SPAdes, we do not have fine-scale control over the k-mer sizes used in the assembly. We instead provide IDBA-UD with the first and last k-mer size to use, then specify the increment to use between these. In either case, it is important that we are always assembling using a k-mer of odd lengths in order to avoid the creation of palindromic k-mers.
Specifying the number of threads¶
This is simply:
If no thread count is specified by the user IDBA-UD will use all available threads, which can be problematic if you are using a shared compute environment that does not use a resource management system like slurm.
Setting a memory limit¶
No such parameter exists in IDBA-UD, but it requires far less RAM than SPAdes, so you are less likely to need it.
Submitting an IDBA-UD job to NeSI using slurm¶
Create a new slurm script using nano to run an equivalent assembly with IDBA-UD
Paste or type in the following:
slurm script