[BioRuby] Options for ClustalW wrapper

Naohisa GOTO ngoto at gen-info.osaka-u.ac.jp
Tue Jul 29 06:01:42 EDT 2008


Hi,

On Tue, 29 Jul 2008 08:46:55 +0200
Marc Hoeppner <marc.hoeppner at molbio.su.se> wrote:

> Hi,
> 
> I am sorry if there is a good tutorial for this somewhere, but I 
> couldn't find it. The API didn't help either, so here is my question:
> 
> I want to use ClustalW to create an alignment using
> 
> factory = Bio::ClustalW.new
> 
> How exactly can I pass options to ClustalW here? Like gap open penalty 
> and such?

Command-line options passed to clustalw can be set when creating
factory object, or later by using Bio::Clustalw#options method.

#-----------------------------------------------------------
  factory = Bio::ClustalW.new('clustalw',
                              [ '-kimura', '-endgaps' ])
  gap_open = 1.0
  factory.options.push "-gapopen=#{gap_open}"
  gap_ext = 1.0
  factory.options.push "-gapext=#{gap_ext}"

  more_options = [ '-nopgap', '-nohgap' ]
  factory.options.concat more_options

  p factory.options

  seqs = [ 'atgaaaca', 'aagaaca', 'acgaaca', 'acgaaacg' ]
  seqs = seqs.collect{ |x| Bio::Sequence::NA.new(x) }

  result = factory.query(seqs)

  print result.raw
#-----------------------------------------------------------

List of command line options of clustalw can be seen
by executing clustalw with '-help' option. 
  % clustalw -help

Cheers,

Naohisa Goto
ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org



More information about the BioRuby mailing list