<commit_before>Tools Documentation
===================

The Tools module is a collection of often used classes or functions that
either enhance our other modules and create reusable functions to be
used in various modules.

We've incorporated tools for sge tools for use with pbs, a pandoc script
and class for converting docx files to markdown formats, multiprocessing
in multiprocess, and a ftp module that aids in downloading files from
NCBI's ftp repository.

Examples
--------

Take a look at the examples below to get an idea of how to incorporate
these tools in your project and how we use these tools in our project.

Download NCBI databases with our NCBI FTP Client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    from OrthoEvol.Tools.ftp import NcbiFTPClient

    ncbiftp = NcbiFTPClient(email='<EMAIL>')
    ncbiftp.getblastdb(database_name='refseq_rna')

View detailed :doc:`ftp <tools/ftpreadme>` documentation.

List all subdirectories in a NCBI FTP Path
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python


    ncbiftp.listdirectories(path='/blast/db/')
    Out[54]: ['FASTA', 'cloud']

Utilize multiprocessing to speed up your code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    from OrthoEvol.Tools.parallel import Multiprocess


    def printwords(word):
        print(word)


    words = ['bae', 'luh', 'cuh']

    if __name__ == '__main__':
        mp = Multiprocess()
        mp.map2function(printwords, words)

View detailed `parallel <parallelreadme.rst>`__ documentation.

Integrate logging in a simple and quick way
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    from OrthoEvol.Tools.logit import LogIt

    # Set up your loggers
    logit = LogIt()default(logname='test1 log', logfile='log.txt')<commit_msg>Updated links in toolsreadme.rst<commit_after>Tools Documentation
===================

The Tools module is a collection of often used classes or functions that
either enhance our other modules and create reusable functions to be
used in various modules.

We've incorporated tools for sge tools for use with pbs, a pandoc script
and class for converting docx files to markdown formats, multiprocessing
in multiprocess, and a ftp module that aids in downloading files from
NCBI's ftp repository.

Examples
--------

Take a look at the examples below to get an idea of how to incorporate
these tools in your project and how we use these tools in our project.

Download NCBI databases with our NCBI FTP Client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    from OrthoEvol.Tools.ftp import NcbiFTPClient

    ncbiftp = NcbiFTPClient(email='<EMAIL>')
    ncbiftp.getblastdb(database_name='refseq_rna')

View detailed `ftp <ftpreadme>`__` documentation.

List all subdirectories in a NCBI FTP Path
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python


    ncbiftp.listdirectories(path='/blast/db/')
    Out[54]: ['FASTA', 'cloud']

Utilize multiprocessing to speed up your code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    from OrthoEvol.Tools.parallel import Multiprocess


    def printwords(word):
        print(word)


    words = ['bae', 'luh', 'cuh']

    if __name__ == '__main__':
        mp = Multiprocess()
        mp.map2function(printwords, words)

View detailed `parallel <parallelreadme>`__ documentation.

Integrate logging in a simple and quick way
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    from OrthoEvol.Tools.logit import LogIt

    # Set up your loggers
    logit = LogIt()default(logname='test1 log', logfile='log.txt')
{'fraction_non_alphanumeric': 0.17986206896551724, 'fraction_numerical': 0.002206896551724138, 'mean_word_length': 4.355982274741507, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2476984', 'n_tokens_mistral': 1076, 'n_tokens_neox': 981, 'n_words': 378}