import unittest from Bio import SeqIO from MEvoLib import MissingExtDependencyError from MEvoLib import Inference from MEvoLib._py3k import getoutput, viewkeys #------------------------------------------------------------------------------- # Try to avoid problems when the OS is in another language os.environ['LANG'] = 'C' fasttree_exe = None if (sys.platform == 'win32'): raise MissingExtDependencyError('Testing with FastTree not implemented on' \ ' Windows yet') else: output = getoutput('fasttree') if (('not found' not in output) and ('FastTree' in output)): fasttree_exe = 'fasttree' if (not fasttree_exe): raise MissingExtDependencyError('Install FastTree if you want to use it ' \ 'from MEvoLib.Inference.get_phylogeny().') #------------------------------------------------------------------------------- class InferenceTestCase(unittest.TestCase): def setUp(self): self.files_to_clean = set()
from Bio import SeqIO from MEvoLib import MissingExtDependencyError from MEvoLib import Inference from MEvoLib._py3k import getoutput, viewkeys #------------------------------------------------------------------------------- # Try to avoid problems when the OS is in another language os.environ['LANG'] = 'C' raxml_exe = None if ( sys.platform == 'win32' ) : raise MissingExtDependencyError('Testing with RAxML not implemented on' \ ' Windows yet') else : output = getoutput('raxml') if ( ('not found' not in output) and ('RAxML' in output) ) : raxml_exe = 'raxml' if ( not raxml_exe ) : raise MissingExtDependencyError('Install raxml if you want to use it from' \ ' MEvoLib.Inference.get_phylogeny().') #------------------------------------------------------------------------------- class InferenceTestCase ( unittest.TestCase ) : def setUp ( self ) : self.files_to_clean = set()
import unittest from Bio import SeqIO from MEvoLib import MissingExtDependencyError from MEvoLib import Align from MEvoLib._py3k import getoutput, viewkeys, viewitems #------------------------------------------------------------------------------- # Try to avoid problems when the OS is in another language os.environ['LANG'] = 'C' mafft_exe = None if (sys.platform == 'win32'): raise MissingExtDependencyError('Testing with MAFFT not implemented on ' \ 'Windows yet') else: output = getoutput('mafft --help') if (('not found' not in output) and ('MAFFT' in output)): mafft_exe = 'mafft' if (not mafft_exe): raise MissingExtDependencyError('Install MAFFT if you want to use it from' \ ' MEvoLib.Align.get_alignment().') #------------------------------------------------------------------------------- class AlignTestCase(unittest.TestCase): def setUp(self): self.files_to_clean = set()
from Bio import Phylo from MEvoLib import MissingExtDependencyError from MEvoLib import PhyloAssemble from MEvoLib._py3k import getoutput, viewkeys #------------------------------------------------------------------------------- # Try to avoid problems when the OS is in another language os.environ['LANG'] = 'C' consense_exe = None if ( sys.platform == 'win32' ) : raise MissingExtDependencyError('Testing with Consense not implemented on' \ ' Windows yet') else : output = getoutput('type consense') if ( 'not found' not in output ) : consense_exe = 'consense' if ( not consense_exe ) : raise MissingExtDependencyError('Install Consense if you want to use it ' \ 'from MEvoLib.PhyloAssemble.get_consensus_tree().') #------------------------------------------------------------------------------- class PhyloAssembleTestCase ( unittest.TestCase ) : def setUp ( self ) : self.files_to_clean = set()
import unittest from Bio import SeqIO from MEvoLib import MissingExtDependencyError from MEvoLib import Cluster from MEvoLib._py3k import getoutput, viewvalues #------------------------------------------------------------------------------- # Try to avoid problems when the OS is in another language os.environ['LANG'] = 'C' dcm3_exe = None if (sys.platform == 'win32'): raise MissingExtDependencyError('Testing with PRD not implemented on ' \ 'Windows yet') else: output = getoutput('dcm') if (('not found' not in output) and ('dcm' in output)): dcm3_exe = 'dcm' if (not dcm3_exe): raise MissingExtDependencyError('Install DCM if you want to use it from' \ ' MEvoLib.Cluster.get_subsets().') #------------------------------------------------------------------------------- class ClusterTestCase(unittest.TestCase): def setUp(self): self.files_to_clean = set()
import unittest from Bio import SeqIO from MEvoLib import MissingExtDependencyError from MEvoLib import Align from MEvoLib._py3k import getoutput, viewkeys, viewitems #------------------------------------------------------------------------------- # Try to avoid problems when the OS is in another language os.environ['LANG'] = 'C' muscle_exe = None if (sys.platform == 'win32'): raise MissingExtDependencyError('Testing with Muscle not implemented on ' \ 'Windows yet') else: output = getoutput('muscle --help') if (('not found' not in output) and ('MUSCLE' in output)): muscle_exe = 'muscle' if (not muscle_exe): raise MissingExtDependencyError('Install Muscle if you want to use it ' \ 'from MEvoLib.Align.get_alignment().') #------------------------------------------------------------------------------- class AlignTestCase(unittest.TestCase): def setUp(self): self.files_to_clean = set()
from MEvoLib import MissingExtDependencyError from MEvoLib import Align from MEvoLib._py3k import getoutput, viewkeys, viewitems #------------------------------------------------------------------------------- # Try to avoid problems when the OS is in another language os.environ['LANG'] = 'C' clustalo_exe = None output = getoutput('clustalo --help') if ( ('not found' not in output) and ('Clustal Omega' in output) ) : clustalo_exe = 'clustalo' if ( not clustalo_exe ) : raise MissingExtDependencyError('Install Clustal Omega if you want to use' \ ' it from MEvoLib.Align.get_alignment().') #------------------------------------------------------------------------------- class AlignTestCase ( unittest.TestCase ) : def setUp ( self ) : self.files_to_clean = set() def tearDown ( self ) : for filename in self.files_to_clean : if ( os.path.isfile(filename) ) : os.remove(filename)