Module: MuscleBio

Defined in:
lib/muscle_bio.rb,
lib/muscle_bio/version.rb

Constant Summary collapse

VERSION =
"0.5.0"

Class Method Summary collapse

Class Method Details

.exec(fileIn, fileOut, algorithm = :PPP) ⇒ Object

two algorithms to choose, :PPP or Super5



23
24
25
26
27
28
29
30
31
32
# File 'lib/muscle_bio.rb', line 23

def self.exec(fileIn, fileOut, algorithm = :PPP)
  if algorithm == :PPP
    cmd = "-align " + fileIn + " -output " + fileOut
  elsif algorithm == :Super5
    cmd = "-super5 " + fileIn + " -output " + fileOut
  else
    raise "algorithm not found. Muscle aborted."
  end
	self.run(cmd)
end

.run(cmd) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/muscle_bio.rb', line 5

def self.run(cmd)
  case RUBY_PLATFORM
  when /arm64/
    file = "muscle5.1.macos_arm64"
  when /x86.*darwin/
    file = "muscle5.1.macos_intel64"
  when /cygwin|mswin|mingw|bccwin|wince|emx/
    file = "muscle5.1.win64.exe"
  else
    file = "muscle5.1.linux_intel64"
  end

	file = File.join( File.dirname(__FILE__), 'runnable/'+file)
	cmd = file + "\s" + cmd + " -quiet"
 `#{cmd}`
end