-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated READMEs for package, Blast, Manager, Cookies.
- Loading branch information
1 parent
fe83f5b
commit 09892f6
Showing
5 changed files
with
92 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
---------------- | ||
|