Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #34

Merged
merged 58 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
97d3d0f
initial commit of documentation for readthedocs format
evanroyrees Mar 13, 2020
c936532
first commit
Sidduppal Mar 19, 2020
02c8fde
Commiting all files in Scripts folder
Sidduppal Mar 19, 2020
b55d480
Modification to COPYRIGHT and config.py
Sidduppal Mar 19, 2020
2db1629
stable build
Sidduppal Mar 20, 2020
e7f71f8
Removed scripts_2, can now be fetched and run by any user
Sidduppal Mar 23, 2020
d4c2cf4
Create README.md
Sidduppal Mar 25, 2020
025dec5
Update README.md
Sidduppal Mar 25, 2020
ad624d2
Update README.md
Sidduppal Mar 25, 2020
241dd7a
Update README.md
Sidduppal Mar 25, 2020
a876c33
Update README.md
Sidduppal Mar 25, 2020
8e18f9c
Update README.md
Sidduppal Mar 26, 2020
7b71bbe
automatic argparse, autosummary, automatic copyright update, last upd…
Sidduppal Mar 26, 2020
903e04c
Merge branch 'documentation' of https://github.com/Sidduppal/Autometa…
Sidduppal Mar 26, 2020
60cf464
Update README.md
Sidduppal Mar 26, 2020
f603dd9
Update README.md
Sidduppal Mar 26, 2020
9946922
modified all copyrights added usage and autodoc for all scripts
Sidduppal Mar 31, 2020
25422b3
Merge branch 'documentation' of https://github.com/Sidduppal/Autometa…
Sidduppal Mar 31, 2020
7f8cd8b
changed autometa to run_autometa
Sidduppal Mar 31, 2020
6f639f0
initial commit of documentation for readthedocs format
evanroyrees Mar 13, 2020
c5bc237
first commit
Sidduppal Mar 19, 2020
bdab032
Commiting all files in Scripts folder
Sidduppal Mar 19, 2020
068ec49
Modification to COPYRIGHT and config.py
Sidduppal Mar 19, 2020
2c155c5
stable build
Sidduppal Mar 20, 2020
9d0a8fc
Removed scripts_2, can now be fetched and run by any user
Sidduppal Mar 23, 2020
edc58ca
Create README.md
Sidduppal Mar 25, 2020
0e1757d
Update README.md
Sidduppal Mar 25, 2020
8b3b283
Update README.md
Sidduppal Mar 25, 2020
12c3d01
Update README.md
Sidduppal Mar 25, 2020
8fc2c69
Update README.md
Sidduppal Mar 25, 2020
976420a
Update README.md
Sidduppal Mar 26, 2020
c189649
automatic argparse, autosummary, automatic copyright update, last upd…
Sidduppal Mar 26, 2020
4859440
Update README.md
Sidduppal Mar 26, 2020
1b9ab8d
Update README.md
Sidduppal Mar 26, 2020
9cf7bc4
modified all copyrights added usage and autodoc for all scripts
Sidduppal Mar 31, 2020
a20ecef
changed autometa to run_autometa
Sidduppal Mar 31, 2020
6941c85
Merge branch 'documentation' of https://github.com/Sidduppal/Autometa…
Sidduppal Mar 31, 2020
0fb0178
Applied changes to scripts and docs source files to remove warnings e…
evanroyrees Mar 31, 2020
46923be
Merge branch 'dev' of https://github.com/WiscEvan/Autometa into docum…
evanroyrees Mar 31, 2020
aaa83da
Merge branch 'Sidduppal-documentation' into documentation
evanroyrees Mar 31, 2020
e52c707
fixes PR Review comments Sidduppal/Autometa#1
evanroyrees Apr 1, 2020
68bec2b
environment.yaml and .readthedocs.yaml files for readthedocs integration
evanroyrees Apr 1, 2020
22eb064
attempt to reduce memory consumption in readthedocs.org. Removed pack…
evanroyrees Apr 1, 2020
db0d3c4
removed most dependencies from conda env and have moved to docs/requi…
evanroyrees Apr 1, 2020
1faf667
changed conda file to conda environment.
evanroyrees Apr 1, 2020
df572d8
added pip in environment.yaml dependencies.
evanroyrees Apr 1, 2020
794b469
removed numba from docs/requirements.txt
evanroyrees Apr 1, 2020
081d25e
fixes Sidduppal/documentation#1. minor changes in template.py to refl…
evanroyrees Apr 2, 2020
77150a6
Merge pull request #1 from WiscEvan/documentation
Sidduppal Apr 2, 2020
255d882
addressed Jason's comments for merge to dev
Sidduppal Apr 2, 2020
de08e73
todo box added, function to automatically input modules, sidebar, and…
Sidduppal Apr 3, 2020
51964c7
Updated markers docstring (fixed incorrect f-string) to allow paramet…
evanroyrees Apr 3, 2020
27797f1
Merge pull request #2 from WiscEvan/markers-docstring
Sidduppal Apr 3, 2020
b899010
addressed Jason's comments for merge to dev
Sidduppal Apr 2, 2020
4ef34db
todo box added, function to automatically input modules, sidebar, and…
Sidduppal Apr 3, 2020
f0ccdff
Merge branch 'documentation' of https://github.com/Sidduppal/Autometa…
Sidduppal Apr 3, 2020
01b10e8
final changes, added Ian to copyright, removed hardcoded copyright
Sidduppal Apr 3, 2020
a9fca2c
added reference for todo.py
Sidduppal Apr 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/source/Scripts/Binning/binning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ Binning
.. toctree::
:maxdepth: 2
:caption: Table of Contents
:glob:

recursive_dbscan
14 changes: 0 additions & 14 deletions docs/source/Scripts/Common/External/bedtools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
bedtools.py
===========

File containing wrapper functions for bedtools.

**Running the script as stand alone module**
While in the Autometa directory</path/to/output/file/prots.out> and with the conda environment activated, run:

.. code-block:: bash

python -m autometa.common.external.prodigal </path/to/BAM/alignment.bam>
</path/to/genome/output/lengths.tsv> </path/to/output/alignment.bed> --[options]

**Inputs** : ibam file

**Returns** : A tab-delimited table with index = contig and column = coverage

.. rubric:: Usage and command line options

.. program-output:: cd ../.. ; python -m autometa.common.external.bedtools -h
Expand Down
15 changes: 0 additions & 15 deletions docs/source/Scripts/Common/External/diamond.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@
diamond.py
==========

File containing class and functions related to running diamond on metagenome sequences

**Running the script as stand alone module**
While in the Autometa directory and with the conda environment activated, run:

.. code-block:: bash

python -m autometa.common.external.diamond <path/to/input/file.faa>
</path/to/diamond/formatted/database> </path/to/ncbi/prot.accession2taxid.gz>
</path/to/diamond/output/file> <blastp or blastx> --[options]

**Inputs** : Protein file (faa format)

**Returns** : A dictionary of Blastp hits, with key = qseqid and value = Diamond result

.. rubric:: Usage and command line options

.. program-output:: cd ../.. ; python -m autometa.common.external.diamond -h
Expand Down
14 changes: 0 additions & 14 deletions docs/source/Scripts/Common/External/prodigal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
prodigal.py
===========

File containing functions to retrieve orfs from provided assembly using prodigal.

**Running the script as stand alone module**
While in the Autometa directory and with the conda environment activated, run:

.. code-block:: bash

python -m autometa.common.external.prodigal </path/to/assembly/input/file>
</path/to/output/file/nucls.out> </path/to/output/file/prots.out> --[options]

**Inputs** : Assembly file (fasta format)

**Returns** : Nucleotide file (ffn format) and protein file (faa format) containing orfs

.. rubric:: Usage and command line options

.. program-output:: cd ../.. ; python -m autometa.common.external.prodigal -h
Expand Down
6 changes: 6 additions & 0 deletions docs/source/Scripts/Common/common.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
Common
======

.. sidebar:: Script under external

The external directory is a subdirectory of common.
All scripts in there come under common.

Sidduppal marked this conversation as resolved.
Show resolved Hide resolved
.. toctree::

External/external


.. autosummary::
:toctree:

Expand Down
15 changes: 0 additions & 15 deletions docs/source/Scripts/Common/kmers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@
kmers.py
=========

File containing functions to count and retrieve k-mers of a given sequences.

**Running the script as stand alone module**
While in the Autometa directory and with the conda environment activated, run:

.. code-block:: bash

python -m autometa.common.kmers --fasta <path/to/input/fasta/file.fasta>
--kmers <path/to/output/file.tsv> --[options]

**Inputs** : Assembly file (in fna format), k-mer size

**Returns** : A tab-delimited matrix of k-mer frequency counts with an index column corresponding
to each contig in the input fasta file

.. rubric:: Usage and command line options

.. program-output:: cd ../.. ; python -m autometa.common.kmers -h
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Scripts/Common/utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ utilities.py
============

.. note::
File containing utilities functions for Autometa pipeline, cannot be run as a standalone module.
This file contains custom exceptions for Autometa and should not be run directly

.. rubric:: Functions

Expand Down
2 changes: 1 addition & 1 deletion docs/source/Scripts/Config/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Config
:caption: Table of Contents

databases
evnviron
environ
project
user
1 change: 0 additions & 1 deletion docs/source/Scripts/scripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Scripts
.. toctree::
:maxdepth: 3
:caption: Table of Contents
:glob:

autometa
Binning/binning
Expand Down
127 changes: 127 additions & 0 deletions docs/source/_ext/todo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
from docutils import nodes
from docutils.parsers.rst import Directive

from sphinx.locale import _
from sphinx.util.docutils import SphinxDirective


class todo(nodes.Admonition, nodes.Element):
pass


class todolist(nodes.General, nodes.Element):
pass


def visit_todo_node(self, node):
self.visit_admonition(node)


def depart_todo_node(self, node):
self.depart_admonition(node)


class TodolistDirective(Directive):

def run(self):
return [todolist('')]


class TodoDirective(SphinxDirective):

# this enables content in the directive
has_content = True

def run(self):
targetid = 'todo-%d' % self.env.new_serialno('todo')
targetnode = nodes.target('', '', ids=[targetid])

todo_node = todo('\n'.join(self.content))
todo_node += nodes.title(_('Todo'), _('Todo'))
self.state.nested_parse(self.content, self.content_offset, todo_node)

if not hasattr(self.env, 'todo_all_todos'):
self.env.todo_all_todos = []

self.env.todo_all_todos.append({
'docname': self.env.docname,
'lineno': self.lineno,
'todo': todo_node.deepcopy(),
'target': targetnode,
})

return [targetnode, todo_node]


def purge_todos(app, env, docname):
if not hasattr(env, 'todo_all_todos'):
return

env.todo_all_todos = [todo for todo in env.todo_all_todos
if todo['docname'] != docname]


def process_todo_nodes(app, doctree, fromdocname):
if not app.config.todo_include_todos:
for node in doctree.traverse(todo):
node.parent.remove(node)

# Replace all todolist nodes with a list of the collected todos.
# Augment each todo with a backlink to the original location.
env = app.builder.env

if not hasattr(env, 'todo_all_todos'):
env.todo_all_todos = []

for node in doctree.traverse(todolist):
if not app.config.todo_include_todos:
node.replace_self([])
continue

content = []

for todo_info in env.todo_all_todos:
para = nodes.paragraph()
filename = env.doc2path(todo_info['docname'], base=None)
description = (
_('(The original entry is located in %s, line %d and can be found ') %
(filename, todo_info['lineno']))
para += nodes.Text(description, description)

# Create a reference
newnode = nodes.reference('', '')
innernode = nodes.emphasis(_('here'), _('here'))
newnode['refdocname'] = todo_info['docname']
newnode['refuri'] = app.builder.get_relative_uri(
fromdocname, todo_info['docname'])
newnode['refuri'] += '#' + todo_info['target']['refid']
newnode.append(innernode)
para += newnode
para += nodes.Text('.)', '.)')

# Insert into the todolist
content.append(todo_info['todo'])
content.append(para)

node.replace_self(content)


def setup(app):
app.add_config_value('todo_include_todos', False, 'html')

app.add_node(todolist)
app.add_node(todo,
html=(visit_todo_node, depart_todo_node),
latex=(visit_todo_node, depart_todo_node),
text=(visit_todo_node, depart_todo_node))

app.add_directive('todo', TodoDirective)
app.add_directive('todolist', TodolistDirective)
app.connect('doctree-resolved', process_todo_nodes)
app.connect('env-purge-doc', purge_todos)

return {
'version': '0.1',
'parallel_read_safe': True,
'parallel_write_safe': True,
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another GH annotation of no newline at the end of this file.

Also, a note about the script as a whole:

Is this pulled from somewhere or did you write this?

  • If you retrieved this from somewhere you need to reference/attribute this at least within this script.
  • If you did write this, some comments would be helpful to understand what is going on.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not write it, it was taken from here https://www.sphinx-doc.org/en/master/development/tutorials/todo.html.
Any particular format to reference the source?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple of sphinx documentation that tell you how to build extensions. Fortunately, they had one for making a todo extension.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should at least place this as a comment in todo.py

13 changes: 5 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@
from datetime import datetime


sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('../../autometa/common'))
sys.path.insert(0, os.path.abspath('../../autometa/config'))
sys.path.insert(0, os.path.abspath('../../autometa/binning'))
sys.path.insert(0, os.path.abspath('../../autometa/datasets'))
sys.path.insert(0, os.path.abspath('../../autometa/validation'))
sys.path.insert(0, os.path.abspath('../../autometa/taxonomy'))
sys.path.insert(0, os.path.abspath('../../autometa/common/external'))
sys.path.append(os.path.abspath("./_ext"))

for (dir_path,dir_names,file_name) in os.walk('../../', topdown=True):
sys.path.insert(0, os.path.abspath(dir_path))
Sidduppal marked this conversation as resolved.
Show resolved Hide resolved

# -- Project information -----------------------------------------------------

Expand All @@ -38,6 +34,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
Expand Down
3 changes: 1 addition & 2 deletions docs/source/contribution-guidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
Contribution Guidelines
=======================

Guidelines about how to contribute
.. todo:: Guidelines about how to contribute

Sidduppal marked this conversation as resolved.
Show resolved Hide resolved
Can link this to the GitHub page ?
2 changes: 1 addition & 1 deletion docs/source/examining-results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Examining Results
=================


TODO: Overview of figures/summaries generated from results.
.. todo:: Overview of figures/summaries generated from results.
Sidduppal marked this conversation as resolved.
Show resolved Hide resolved


.. csv-table:: Autometa Results
Expand Down
21 changes: 9 additions & 12 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@
Autometa documentation
======================

**Autometa: automated extraction of microbial genomes from individual shotgun metagenomes**
| **Autometa: automated extraction of microbial genomes from individual shotgun metagenomes**
| An automated binning pipeline for single metagenomes, in particular host-associated and highly complex ones.

An automated binning pipeline for single metagenomes, in particular
host-associated and highly complex ones. Autometa is copyright 2020
Ian J. Miller, Evan R. Rees, Izaak Miller and Jason C. Kwan, and is
released under the GNU Affero General Public License v3 (see :ref:`License`).

If you find Autometa useful to your work, please cite our Autometa_ paper:

Miller, I. J.; Rees, E. R.; Ross, J.; Miller, I.; Baxa, J.; Lopera, J.;
Kerby, R. L.; Rey, F. E.; Kwan, J. C. Autometa: Automated extraction of microbial
genomes from individual shotgun metagenomes. *Nucleic Acids Research*, **2019**.
DOI: https://doi.org/10.1093/nar/gkz148
| If you find Autometa useful to your work, please cite our Autometa_ paper:
| Miller, I. J.; Rees, E. R.; Ross, J.; Miller, I.; Baxa, J.; Lopera, J.; Kerby, R. L.; Rey, F. E.; Kwan, J. C. Autometa: Automated extraction of microbial genomes from individual shotgun metagenomes. *Nucleic Acids Research*, **2019**. DOI: https://doi.org/10.1093/nar/gkz148

Quickstart
==========
Expand All @@ -38,11 +30,16 @@ Guide
api
license


Contact
-------
For suggestions, queries or appreciation feel free to contact `Dr.JasonKwan <https://apps.pharmacy.wisc.edu/sopdir/jason_kwan/>`_
at jason.kwan@wisc.edu

Copyright and License
Copy link
Collaborator

@evanroyrees evanroyrees Apr 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could probably just remove this section (Line 39) since License is in the sidebar. At least remove the Copyright portion

---------------------
Autometa is copyright 2020 Ian J. Miller, Evan R. Rees, Izaak Miller and Jason C. Kwan,
and is released under the GNU Affero General Public License v3 (see :ref:`License`).
Sidduppal marked this conversation as resolved.
Show resolved Hide resolved

Indices and tables
------------------
Expand Down
1 change: 0 additions & 1 deletion docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ Now download autometa to your desired directory using:

``git clone https://github.com/KwanLab/Autometa.git``

You should now add the Autometa directory to your $PATH environmental variable
Loading