Class: BioDSL::AssembleSeqSpades
- Inherits:
-
Object
- Object
- BioDSL::AssembleSeqSpades
- Includes:
- AuxHelper
- Defined in:
- lib/BioDSL/commands/assemble_seq_spades.rb
Overview
Assemble sequences the stream using SPAdes.
assemble_seq_spades
is a wrapper around the single prokaryotic genome assembler SPAdes:
Any records containing sequence information will be included in the assembly, but only the assembled contig sequences will be output to the stream.
The sequences records may contain qualty scores, and if the sequence names indicates that the sequence order is inter-leaved paired-end assembly will be performed.
Usage
assemble_seq_spades([careful: <bool>[, cpus: <uint>[, kmers: <list>]]])
Options
-
careful: <bool> - Run SPAdes with the careful flag set.
-
cpus: <uint> - Number of CPUs to use (default: 1).
-
kmers: <list> - List of kmers to use (default: auto).
Examples
If you have two pair-end sequence files with the Illumina data then you can assemble these using assemble_seq_spades like this:
BD.new.
read_fastq(input: "file1.fq", input2: "file2.fq).
assemble_seq_spades(kmers: [55,77,99,127]).
write_fasta(output: "contigs.fna").
run
rubocop:disable ClassLength
Constant Summary collapse
- STATS =
%i(records_in records_out sequences_in sequences_out residues_in residues_out records_out assembled)
Instance Method Summary collapse
-
#initialize(options) ⇒ AssembleSeqSpades
constructor
Constructor for the AssembleSeqSpades class.
-
#lmb ⇒ Proc
Return a lambda for the AssembleSeqSpades command.
Methods included from AuxHelper
Constructor Details
#initialize(options) ⇒ AssembleSeqSpades
Constructor for the AssembleSeqSpades class.
88 89 90 91 92 93 94 95 96 |
# File 'lib/BioDSL/commands/assemble_seq_spades.rb', line 88 def initialize() @options = @lengths = [] @type = nil aux_exist('spades.py') defaults end |
Instance Method Details
#lmb ⇒ Proc
Return a lambda for the AssembleSeqSpades command.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/BioDSL/commands/assemble_seq_spades.rb', line 101 def lmb lambda do |input, output, status| status_init(status, STATS) TmpDir.create('reads.fq', 'reads.fa') do |in_fq, in_fa, tmp_dir| process_input(in_fq, in_fa, input, output) input_file = (@type == :fastq) ? in_fq : in_fa execute_spades(input_file, tmp_dir) process_output(output, File.join(tmp_dir, 'scaffolds.fasta')) end calc_n50(status) end end |