Class: BioDSL::AlignSeqMothur
- Inherits:
-
Object
- Object
- BioDSL::AlignSeqMothur
- Includes:
- AuxHelper
- Defined in:
- lib/BioDSL/commands/align_seq_mothur.rb
Overview
Align sequences in the stream using Mothur.
This is a wrapper for the mothur
command align.seqs(). Basically, it aligns sequences to a reference alignment.
Please refer to the manual:
www.mothur.org/wiki/Align.seqs
Mothur must be installed for align_seq_mothurs
to work. Read more here:
Usage
align_seq_mothur(<template_file: <file>>[, cpus: <uint>])
Options
-
template_file: <file> - File with template alignment in FASTA format.
-
cpus: <uint> - Number of CPU cores to use (default=1).
Examples
To align the entries in the FASTA file ‘test.fna` to the template alignment in the file `template.fna` do:
BD.new.
read_fasta(input: "test.fna").
align_seq_mothur(template_file: "template.fna").
run
Constant Summary collapse
- STATS =
%i(records_in records_out sequences_in sequences_out residues_in residues_out)
Instance Method Summary collapse
-
#initialize(options) ⇒ AlignSeqMothur
constructor
Constructor for the AlignSeqMothur class.
-
#lmb ⇒ Proc
Return a lambda for the align_seq_mothur command.
Methods included from AuxHelper
Constructor Details
#initialize(options) ⇒ AlignSeqMothur
Constructor for the AlignSeqMothur class.
76 77 78 79 80 81 82 |
# File 'lib/BioDSL/commands/align_seq_mothur.rb', line 76 def initialize() @options = aux_exist('mothur') defaults end |
Instance Method Details
#lmb ⇒ Proc
Return a lambda for the align_seq_mothur command.
87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/BioDSL/commands/align_seq_mothur.rb', line 87 def lmb lambda do |input, output, status| status_init(status, STATS) TmpDir.create('input.fna', 'input.align') do |tmp_in, tmp_out, tmp_dir| process_input(input, output, tmp_in) run_mothur(@options[:template_file], @options[:cpus], tmp_dir, tmp_in) process_output(output, tmp_out) end end end |