Skip to content

Commit

Permalink
Updated READMEs for package, Blast, Manager, Cookies.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdhutchins committed Jun 7, 2019
1 parent fe83f5b commit 09892f6
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 22 deletions.
20 changes: 12 additions & 8 deletions OrthoEvol/Cookies/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
Cookies Documentation
======================
For this project/package, we recommend using cookiecutter (along with Flask)
# Cookies Documentation

For this package, we recommend using cookiecutter (along with Flask or Dash which is built with Flask)
to set up your directory if you intend to create a web app/interface for your project.

Cookies makes it very easy to do this.
`Cookies` makes it very easy to do this.

Learn more about the [cookiecutter](https://github.com/audreyr/cookiecutter) package.

## Examples

The [Manager module](https://github.com/datasnakes/OrthoEvolution/tree/master/OrthoEvol/Manager)
uses the _CookBook_ and _Oven_ classes as a primary means of functioning.

### Simple Implementation
### A Simple Implementation

```python
from OrthoEvol.Cookies import Oven

Kitchen = Oven(repo="repo", user="user", project="project", output_dir="project_path")
Kitchen = Oven(repo="repo", user="username", project="project-name",
output_dir="path/to/project")
Pantry = Kitchen.Ingredients
Kitchen.bake_the_*()
```

# To create a user directory
Kitchen.bake_the_user()
```
3 changes: 1 addition & 2 deletions OrthoEvol/Manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,4 @@ dd.dispatch(dd.strategies, dd.dispatcher, dd.configuration)

## Notes

Please view our [BioSQL documentation](https://github.com/datasnakes/OrthoEvolution/tree/master/OrthoEvol/Manager/BioSQL/README.md) and view some of the
static/config related [files](https://github.com/datasnakes/OrthoEvolution/tree/master/OrthoEvol/Manager/config/).
Please view our [BioSQL documentation](https://github.com/datasnakes/OrthoEvolution/tree/master/OrthoEvol/Manager/BioSQL/README.md) and view some of the static/config related [files](https://github.com/datasnakes/OrthoEvolution/tree/master/OrthoEvol/Manager/config/).
16 changes: 6 additions & 10 deletions OrthoEvol/Orthologs/Blast/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,26 @@ Before you use this function, you need for `NCBI Blast+` to be installed and in
Download the latest standalone blast executables from
[here](ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/). We are currently using version `2.8.1`.


#### Our Blast Methods

NCBI's `blastn` can be configured (using its parameters) in a number of different ways
(for local or remote use or with seqidlists or taxids). For typical orthology analyses,
(i.e. local or remote use and with seqidlists or taxids). For typical orthology analyses,
it's important to take advantage of the speed and efficiency of NCBI's newest
preformatted blast databases ([blastdbv5](https://ftp.ncbi.nlm.nih.gov/blast/db/v5/)).
In order to do that, we've implemented a method (`1`) that uses taxids (taxonomic identifiers).
In order to do that, we've implemented a method (`1`) that uses taxids (taxonomic groups — species level and higher level taxa).
View more about our methods below.


Method | Description
Method | Description
----------|--------------------------------------------------------------------
1 | Local blast using taxids. Utilizes local databases (`refseq_rna_v5`).
2 | Remote blast using an entrez query. Uses entrez species name and query
None | A single query method not useful for orthology inference


#### Our Custom Accession File Format

We use a specifically formatted `accession file` with our headers as `Tier`, `Gene`,
`Organism` to store blast output and input. This allows for distinguishing genes
by families or features. The `Tier` header can be omitted, but the other headers are requirements.

We use a specifically formatted `accession file` with our headers as `Tier`, `Gene`,
`Organism` to store blast output and input. This allows for distinguishing genes
by families or features. The `Tier` header can be omitted, but the other headers are requirements.
The Accession numbers are stored in a `.csv` file. The following table is an example
of how we format our blast input file.

Expand Down
2 changes: 2 additions & 0 deletions OrthoEvol/Orthologs/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Orthologs Documentation

This top level module includes submodules such as [Align](https://github.com/datasnakes/OrthoEvolution/blob/master/OrthoEvol/Orthologs/Align/README.md) (for aligning multi fasta files),
[Phylogenetics](https://github.com/datasnakes/OrthoEvolution/blob/master/OrthoEvol/Orthologs/Phylogenetics/README.md) (for analyzing multiple sequence alignments), [BioSQL]() (for database creation),
[Blast](https://github.com/datasnakes/OrthoEvolution/tree/master/OrthoEvol/Orthologs/Blast) (includes tools for using NCBI's blastn command line), and [Genbank](https://github.com/datasnakes/OrthoEvolution/blob/master/OrthoEvol/Orthologs/Genbank/README.md).
(for tools to extract features from genbank files).

## Usage & Examples

These classes are optimized to be used together (very little work to do that),
but can also be used as standalone classes/methods.

Expand Down
73 changes: 71 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,82 @@ Examples
----------------
Check out this `tutorial <https://github.com/datasnakes/OrthoEvolution/wiki/Tutorial>`__ in our Wiki Docs.

Also, please view `examples <https://github.com/datasnakes/OrthoEvolution/examples>`__ of how to utilize this package to build tools.


Running a pre-configured local blast
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
import OrthoEvol
from OrthoEvol.Orthologs.Blast import OrthoBlastN
# Use an existing list of gpcr genes
gpcr_blastn = OrthoBlastN(project="orthology-gpcr", method=1,
save_data=True, acc_file="gpcr.csv",
copy_from_package=True)
# Run blast
gpcr_blastn.run()
Simple project creation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
from OrthoEvol.Manager.management import ProjectManagement
ProjectManagement(repo="test-repo", user=None,
project="test-[roject",
research=None,
research_type='comparative_genetics',
new_repo=False, new_user=False, new_project=True,
new_research=False)
Simple blast database downloading
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
from OrthoEvol.Tools.ftp import NcbiFTPClient
ncbiftp = NcbiFTPClient(email='[email protected]')
ncbiftp.getblastdb(database_name='refseq_rna', v5=True)
Creating projects and databases dynamically
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
from OrthoEvol.Manager.management import ProjectManagement
from OrthoEvol.Manager.database_dispatcher import DatabaseDispatcher
from OrthoEvol.Manager.config import yml
from pkg_resources import resource_filename
from pathlib import Path
import yaml
# Set up project management
pm_config_file = resource_filename(yml.__name__, "initialize_new.yml")
with open(pm_config_file, 'r') as f:
pm_config = yaml.load(f)
pm = ProjectManagement(**pm_config["Management_config"])
# Set up database management
db_config_file = resource_filename(yml.__name__, "databases.yml")
with open(db_config_file, 'r') as f:
db_config = yaml.load(f)
config = db_config.update(pm_config)
# Generate main config file for this job
config_file = pm.user_log / Path("upload_config.yml")
with open(str(config_file), 'w') as cf:
yaml.dump(config, cf, default_flow_style=False)
# Set up database dispatcher and dispatch the functions
dd = DatabaseDispatcher(config_file, pm)
dd.dispatch(dd.strategies, dd.dispatcher, dd.configuration)
Tests
----------------
To run tests, type ``nosetests Tests/`` in the OrthoEvolution directory.
To run tests, type ``nosetests tests/`` in the OrthoEvolution directory.

Contributors
----------------
Expand Down

0 comments on commit 09892f6

Please sign in to comment.