How to use the biolib.external.execute.check_dependencies function in biolib

To help you get started, we’ve selected a few biolib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dparks1134 / RefineM / refinem / main.py View on Github external
def ssu_erroneous(self, options):
        """Erroneous SSU command"""
        
        check_dependencies(('nhmmer', 'blastn'))

        check_dir_exists(options.genome_nt_dir)
        check_dir_exists(options.taxon_profile_dir)
        
        make_sure_path_exists(options.output_dir)
        
        genome_files = self._genome_files(options.genome_nt_dir, options.genome_ext)
        if not self._check_nuclotide_seqs(genome_files):
            self.logger.warning('All files must contain nucleotide sequences.')
            sys.exit()
             
        # identify scaffolds with 16S sequences
        ssu = SSU(options.cpus)
        ssu_hits = ssu.identify(genome_files, options.evalue, options.concatenate, options.output_dir)
        ssu_seq_files = ssu.extract(genome_files, ssu_hits, options.output_dir)
        ssu_classifications = ssu.classify(ssu_seq_files, options.ssu_db, options.ssu_taxonomy_file, options.evalue, options.output_dir)
github Ecogenomics / GTDBTk / src / gtdbtk / gtdbtk.py View on Github external
def infer(self, options):
        """Infer tree from MSA."""
        
        check_file_exists(options.msa_file)
        make_sure_path_exists(options.out_dir)
        
        if (options.cpus > 1):
            check_dependencies(['FastTreeMP'])
        else:
            check_dependencies(['FastTree'])
        
        self.logger.info('Inferring tree with FastTree using %s+GAMMA.' % options.prot_model)
        fasttree = FastTree(multithreaded=(options.cpus > 1))

        tree_unrooted_output = os.path.join(options.out_dir, options.prefix + '.unrooted.tree')
        tree_log = os.path.join(options.out_dir, options.prefix + '.tree.log')
        tree_output_log = os.path.join(options.out_dir, 'fasttree.log')
        fasttree.run(options.msa_file, 
                        'prot', 
                        options.prot_model, 
                        tree_unrooted_output, 
                        tree_log, 
                        tree_output_log)
github dparks1134 / RefineM / refinem / taxon_profile.py View on Github external
def __init__(self, cpus, output_dir):
        """Initialization.

        Parameters
        ----------
        cpus : int
            Number of cpus to use.
        output_dir : str
            Directory to store results.
        """

        self.logger = logging.getLogger('timestamp')
        
        check_dependencies(('diamond', 'ktImportText'))

        self.cpus = cpus
        self.output_dir = output_dir

        # profile for each genome
        self.profiles = {}
github dparks1134 / RefineM / scripts / make_database.py View on Github external
def __init__(self):
        """Initialize."""

        check_dependencies(['comparem', 'diamond', 'makeblastdb'])

        self.underclassified = 'underclassified'

        self.rank_prefixes = Taxonomy.rank_prefixes
        self.rank_index = Taxonomy.rank_index
        self.rank_labels = Taxonomy.rank_labels

        self.time_keeper = TimeKeeper()
github dparks1134 / RefineM / refinem / reference.py View on Github external
def __init__(self, cpus, output_dir):
        """Initialization.

        Parameters
        ----------
        cpus : int
            Number of cpus to use.
        output_dir : str
            Directory to store results.
        """

        self.logger = logging.getLogger('timestamp')
        
        check_dependencies(('diamond', 'ktImportText'))

        self.cpus = cpus
        self.output_dir = output_dir