Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
maxibor committed Sep 26, 2018
1 parent 8af9685 commit e24f266
Show file tree
Hide file tree
Showing 12 changed files with 732 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = coproID
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
36 changes: 36 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=coproID

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
Binary file added docs/source/_static/_img/dag.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/_img/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
314 changes: 314 additions & 0 deletions docs/source/_static/simulated_coprolyte.html

Large diffs are not rendered by default.

166 changes: 166 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

from recommonmark.parser import CommonMarkParser

source_parsers = {
'.md': CommonMarkParser,
}

source_suffix = ['.rst', '.md']

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

project = 'coproID'
copyright = '2018, Maxime Borry'
author = 'Maxime Borry'

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = ''


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# 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.mathjax',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'coproIDdoc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'coproID.tex', 'coproID Documentation',
'Maxime Borry', 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'coproid', 'coproID Documentation',
[author], 1)
]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'coproID', 'coproID Documentation',
author, 'coproID', 'One line description of project.',
'Miscellaneous'),
]


# -- Extension configuration -------------------------------------------------
25 changes: 25 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.. coproID documentation master file, created by
sphinx-quickstart on Wed Sep 26 10:48:05 2018.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to coproID's documentation!
===================================

.. toctree::
:maxdepth: 2
:caption: Contents:

intro
installation
usage
output
troubleshooting


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
15 changes: 15 additions & 0 deletions docs/source/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Installation
============

## Requirements

- **OS:** Unix based operating system such as Ubuntu or Mac OS X
- **conda:** Install miniconda using the appropriated installers (no root permission required) [conda.io/miniconda.html](https://conda.io/miniconda.html)
- **Nextflow:** Install nextflow with conda by issuing the following command in your terminal: `conda install -c bioconda nextflow`

## Installation

Install **coproID** by issuing the following command in your terminal:
```
nextflow pull maxibor/coproid
```
67 changes: 67 additions & 0 deletions docs/source/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Introduction
============

<img src="_static/_img/logo.png" height="150">

**coproID** (**CO**prolite **ID**entification) is a tool developed at the [Max Planck insitute for the Science of Human History](http://www.shh.mpg.de/en) by [Maxime Borry](https://github.com/maxibor)

The purpose of **coproID** is to help identify the host of given sequenced microbiome when there is a doubt between two species.

**coproID** is a pipeline developed using [Nextflow](https://www.nextflow.io/) and [Conda](https://conda.io/docs/) to ensure scalability and reproducibility.

Even though it was developed with coprolite host identification in mind, it can be applied to any microbiome, provided they contain host DNA.

To run **coproID** you need to provide as input:
- microbiome sequencing paired end `fastq` files
- **two** reference genomes (either in `fasta` format, or already `bowtie2` indexed)
- the names of the two reference species
- if you choose to give the reference genomes as indexed `bowtie2` files, you also need to provide the genomes sizes.

## Quick start

Example:
```
nextflow run maxibor/coproid --genome1 'genome1.fa' --genome2 'genome2.fa' --name1 'Homo_sapiens' --name2 'Canis_familiaris' --reads '*_R{1,2}.fastq.gz'
```

## coproID help menu

```
$ nextflow run maxibor/coproid --help
N E X T F L O W ~ version 0.31.1
Launching `maxibor/coproid` [stupefied_borg] - revision: f062739210
=========================================
coproID: Coprolite Identification
Homepage / Documentation: https://github.com/maxibor/coproid
Author: Maxime Borry <borry@shh.mpg.de>
Version 0.4
Last updated on September 26th, 2018
=========================================
Usage:
The typical command for running the pipeline is as follows:
nextflow run maxibor/coproid --genome1 'genome1.fa' --genome2 'genome2.fa' --name1 'Homo_sapiens' --name2 'Canis_familiaris' --reads '*_R{1,2}.fastq.gz'
Mandatory arguments:
--reads Path to input data (must be surrounded with quotes)
--name1 Name of candidate 1. Example: "Homo sapiens"
--name2 Name of candidate 2. Example: "Canis familiaris"
Options:
--phred Specifies the fastq quality encoding (33 | 64). Defaults to 33
--genome1 Path to candidate 1 Coprolite maker's genome fasta file (must be surrounded with quotes) - If index1 is not set
--index1 Path to Bowtie2 index genome andidate 1 Coprolite maker's genome, in the form of /path/to/*.bt2 - If genome1 is not set
--genome1Size Size of candidate 1 Coprolite maker's genome in bp - If genome1 is not set
--genome2 Path to candidate 2 Coprolite maker's genome fasta file (must be surrounded with quotes)- If index2 is not set
--index2 Path to Bowtie2 index genome andidate 2 Coprolite maker's genome, in the form of /path/to/*.bt2 - If genome2 is not set
--genome2Size Size of candidate 2 Coprolite maker's genome in bp - If genome2 is not set
--identity Identity threshold to retain read alignment. Default = 0.85
--bowtie Bowtie settings for sensivity (very-fast | very-sensitive). Default = very-sensitive
Other options:
--results Name of result directory. Defaults to ./results
--help --h Shows this help page
```

## coproID example workFlow

![](_static/_img/dag.png)
21 changes: 21 additions & 0 deletions docs/source/output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Output
======

## coproID results

`results/{fastq_file_basename}.html`

This file is the report of **coproID** and contains explanations on how the calculation was performed, the files used, and your result.

An example **coproID** output file file can be found [here](_static/simulated_coprolyte.html)

## coproID logs

You can generate a log file report of coproID run by using nextflow reporting option `-with-report`

Example:
```
nextflow run maxibor/coproid --genome1 'path/to/data/genomes/hsapiens.fa' --genome2 'path/to/data/genomes/cfamiliaris.fa' --name1 'data/genomes/Homo_sapiens' --name2 'Canis_familiaris' --reads '*_R{1,2}.fastq.gz' -with-report report.html
```

The log file will be saved in `report.html`
8 changes: 8 additions & 0 deletions docs/source/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Troubleshooting
===============

## Known issues
On Mac OS X, the nextflow log reporting (`-with-report`) may not work with Nextflow v0.31.1. This should be fixed in future Nextflow releases

## Other issues
If you find a specific issue, please open an [issue](https://github.com/maxibor/coproid/issues) on [GitHub](https://github.com/maxibor/coproid/issues)

0 comments on commit e24f266

Please sign in to comment.