Metadata-Version: 1.0
Name: bandwitch
Version: 0.1.0
Summary: Enzyme selection for DNA verification and identification
Home-page: UNKNOWN
Author: Zulko
Author-email: UNKNOWN
License: MIT
Description: .. image:: https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/BandWitch/master/docs/_static/images/title.png
           :alt: [logo]
           :align: center
           :width: 600px
        
        BandWitch
        ==========
        
        .. image:: https://travis-ci.org/Edinburgh-Genome-Foundry/BandWitch.svg?branch=master
           :target: https://travis-ci.org/Edinburgh-Genome-Foundry/BandWitch
           :alt: Travis CI build status
        
        (the documentation is incomplete, come back later for more)
        
        Bandwitch (full documentation `here <https://edinburgh-genome-foundry.github.io/BandWitch/>`_)
        is a Python library for the planning and analysis of restriction
        experiments in DNA assembly operations. Bandwitch implements enzyme selection
        methods to validate or identify DNA assemblies, and routines to automatically
        validate/identify assemblies from experimental data.
        
        You can try BandWitch in this interactive webdemo.
        
        Installation
        -------------
        
        You can install DnaCauldron through PIP
        
        
        .. code:: shell
        
            sudo pip install bandwitch
        
        On Ubuntu at least, you may need to install libblas first:
        
        .. code::
        
            sudo apt-get install libblas-dev liblapack-dev
        
        Alternatively, you can unzip the sources in a folder and type
        
        .. code:: shell
        
            sudo python setup.py install
        
        
        Enzyme selection with BandWitch
        -------------------------------
        
        In the following examples, we assume that we have a set of 12 constructs which we will
        need to either validate (i.e. we digest these constructs and compare each pattern
        with the expected pattern for that construct) or identify (i.e. we will digest an
        a-priori unknown construct and use the migration patterns to un-ambiguously
        identify each construct among the 12 possible candidates).
        
        For validation purposes, the difficulty is to find a digestion that will produce
        harmonious patterns for all the constructs at once: well-spaced bands, and not
        too many or too few of them. For identification purposes, the difficulty is to
        find a digestion giving very distant patterns for each construct in the set of
        candidates.
        
        Every time when the problem cannot be solved with a single digestion, BandWitch
        can propose 2 or 3 digestions which collectively solve the problem.
        
        To select enzymes that will **produce nice patterns for all constructs, for validation:**
        
        .. code:: python
        
          from bandwitch import IdealDigestionsProblem, LADDERS, load_genbank
        
          # DEFINE THE SEQUENCES AND THE ENZYME SET
          enzymes = ["EcoRI", "BamHI", "XhoI", "EcoRV", "SpeI", "XbaI",
                     "NotI", "SacI", "SmaI", "HindIII", "PstI"]
          sequences = [
              load_genbank(genbank_file_path, name=f)
              for genbank_file_path in some_llist_of_files)
          ]
        
          # SELECT THE BEST SINGLE DIGESTION WITH AT MOST ENZYMES
          problem = IdealDigestionsProblem(enzymes=enzymes,
                                           ladder=LADDERS['100_to_4k'],
                                           sequences=sequences,
                                           max_enzymes_per_digestion=2)
          score, selected_digestions = problem.select_digestions(max_digestions=1)
        
          # PLOT THE BAND PATTERNS PRODUCED BY THE SELECTED DIGESTION
          problem.plot_digestions(
              digestions=selected_digestions,
              patterns_props={'label_fontdict': {'rotation': 35}}
              target_file="ideal_digestions.png"
          )
        
        Result:
        
        .. image:: https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/BandWitch/master/examples/ideal_digestions.png
           :alt: [logo]
           :align: center
        
        To select enzymes that will produce **different patterns for each construct, for identification:**
        
        .. code:: python
        
            from bandwitch import (SeparatingDigestionsProblem, list_common_enzymes,
                                   LADDERS, load_genbank)
        
        
            # DEFINE SEQUENCES AND ENZYME SET (6-CUTTERS WITH >3 COMMERCIAL PROVIDERS)
            enzymes = list_common_enzymes(site_length=(6,), min_suppliers=3)
            sequences = [
                load_genbank(genbank_file_path, name=f)
                for genbank_file_path in some_llist_of_files)
            ]
        
            # SELECT THE BEST DIGESTION PAIRS (AT MOST 1 ENZYME PER DIGESTION)
            problem = SeparatingDigestionsProblem(enzymes=enzymes,
                                                  ladder=LADDERS['100_to_4k'],
                                                  sequences=sequences,
                                                  max_enzymes_per_digestion=1)
            score, selected_digestions = problem.select_digestions(max_digestions=2)
        
            # GENERATE A FIGURE OF THE BAND PATTERNS
        
            problem.plot_digestions(
                selected_digestions,
                patterns_props={'label_fontdict': {'rotation': 35}},
                target_file="separating_digestions.png"
            )
        
            problem.plot_distances_map(digestions=selected_digestions,
                                       target_file="separating_digestions_distances.png")
        
        Result:
        
        .. image:: https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/BandWitch/master/examples/separating_digestions.png
           :alt: [logo]
           :align: center
        
        Usage: Construct validation or identification from experimental data
        ---------------------------------------------------------------------
        
        This part is still under construction.
        
        Bandwitch can process output files from an automated fragment analyzer and produce
        informative reports as illustrated below:
        
        .. image:: https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/BandWitch/master/docs/_static/images/bands_validation.png
           :alt: [logo]
           :align: center
           :width: 600px
        
        
        Contribute
        ----------
        
        BandWitch is an open-source library originally written at the
        Edinburgh Genome Foundry by Zulko_. It is released on Github_ under the MIT
        licence (¢ Edinburgh Genome Foundry), everyone is welcome to contribute.
        
        .. _Zulko: https://github.com/Zulko/
        .. _Github: https://github.com/EdinburghGenomeFoundry/BandWitch
        .. _PYPI: https://pypi.python.org/pypi/bandwitch
        
Keywords: Restriction enzyme synthetic biology DNA band patterns
Platform: UNKNOWN
