Skip to content

Commit

Permalink
improved docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fiers committed May 30, 2012
1 parent 49164ad commit bde341f
Show file tree
Hide file tree
Showing 38 changed files with 71 additions and 109 deletions.
4 changes: 2 additions & 2 deletions lib/jinja2/plugin.index.rst.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ moa.plugin
.. toctree::
:maxdepth: 2

{% for plugin in plugins -%}
{{plugin}}
{% for category, plugin in plugins -%}
{{category}}__{{plugin}}
{% endfor %}
2 changes: 1 addition & 1 deletion lib/jinja2/plugin.rst.jinja2
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.. automodule:: moa.plugin.{{name}}
.. automodule:: {{module}}
:members:
2 changes: 1 addition & 1 deletion lib/python/moa/backend/ruff/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def generate_data_map():
for x in self.job.data.inputs]

l.debug('pushing job with inputs %s' % ", ".join(inputs[:10]))

fsDict = dict([(x, self.job.data.filesets[x]['files'][i])
for x in self.job.data.inputs + self.job.data.outputs])

Expand Down
8 changes: 6 additions & 2 deletions sphinx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ help:

ghpages:
cp -r $(BUILDDIR)/html/* $(GHPAGES)/
cd $(GHPAGES) && git commit -m 'rebuild documentation' -a || true && pwd && git push
cd $(GHPAGES) && \
sh add_all_to_repo.sh && \
git commit -m 'rebuild documentation' -a || true && \
pwd && \
git push

clean:
-rm -rf $(BUILDDIR)/*

prepare:
cd templates && rm -r *.rst && ./refresh_templates
cd templates && ( rm -rf *.rst || true ) && ./refresh_templates
cd commands && ./update_commands

html: prepare pdf
Expand Down
2 changes: 0 additions & 2 deletions sphinx/api/plugin/adhoc.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/checkversion.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/configure.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/doc.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/extraCommands.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/fileset.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/help.rst

This file was deleted.

49 changes: 22 additions & 27 deletions sphinx/api/plugin/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,26 @@ moa.plugin
.. toctree::
:maxdepth: 2

adhoc
checkversion
configure
doc
extraCommands
fileset
help
info
lock
logger
logo
mail
metavar
moaGit
moautil
newjob
parameterCheck
project
prompt
report
sgeActor
status
template
test
twit
umask
varInject
job__metavar
system__adhoc
system__configure
system__doc
system__extraCommands
system__fileset
system__help
system__info
system__lock
system__logger
system__moaGit
system__moautil
system__newjob
system__parameterCheck
system__project
system__remoteLogger
system__smw
system__status
system__template
system__test
system__umask
system__varInject

2 changes: 0 additions & 2 deletions sphinx/api/plugin/info.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/lock.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/logger.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/logo.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/mail.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/metavar.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/moaGit.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/moautil.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/newjob.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/parameterCheck.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/project.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/prompt.rst

This file was deleted.

30 changes: 16 additions & 14 deletions sphinx/api/plugin/refresh_plugins
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#!/usr/bin/env python

import os
import sys
import yaml
import moa.utils
import moa.template

import moa.logger as l


from moa.sysConf import sysConf

from jinja2 import Template as jTemplate

tPluginFile = os.path.join(
Expand All @@ -17,22 +21,20 @@ tIndexFile = os.path.join(
tPlugin = jTemplate(open(tPluginFile).read())
tIndex = jTemplate(open(tIndexFile).read())

os.chdir(os.path.join(moa.utils.getMoaBase(), 'sphinx', 'api', 'plugin'))

all_plugs = []
l.warning("start parsing plugins")
plugindir = os.path.join(moa.utils.getMoaBase(), 'lib', 'python', 'moa', 'plugin')
l.warning("in directory %s" % plugindir)

for plugin in os.listdir(plugindir):
if not os.path.isdir(os.path.join(plugindir, plugin)):
continue
pluginfile = os.path.join(plugindir, plugin, '__init__.py')
name = plugin
print 'Found plugin: ' + name
all_plugs.append(name)
with open('%s.rst' % name, 'w') as F:
F.write(tPlugin.render({'name' : name}))
#plugindir = os.path.join(moa.utils.getMoaBase(), 'lib', 'python', 'moa', 'plugin')
#l.warning("in directory %s" % plugindir)

for category in ['job', 'system']:
for plugin in sysConf.plugins[category].keys():
plugInfo = sysConf.plugins[category].get(plugin, {})
module = plugInfo.module
name = plugin
print 'Found plugin: ', category, name
all_plugs.append((category, name))
with open('%s__%s.rst' % (category, name), 'w') as F:
F.write(tPlugin.render({'module' : module}))

all_plugs.sort()
with open("index.rst", 'w') as F:
Expand Down
2 changes: 0 additions & 2 deletions sphinx/api/plugin/report.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/sgeActor.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/status.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/template.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/test.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/twit.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/umask.rst

This file was deleted.

2 changes: 0 additions & 2 deletions sphinx/api/plugin/varInject.rst

This file was deleted.

6 changes: 3 additions & 3 deletions sphinx/commands/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ moa **change**
~~~~~~~~~~~~~~~~~~
usage: moa change [-h] [-r] [-v] [--profile]

Add entry to Changelog.md This function allows the user to add an entry to
Changelog.md (including a timestamp). Use it as follows:: $ moa change Enter
Add entry to CHANGELOG.md This function allows the user to add an entry to
CHANGELOG.md (including a timestamp). Use it as follows:: $ moa change Enter
your changelog message (ctrl-d on an empty line to finish) ... enter your
message here .. [ctrl-d] Note: the ctrl-d needs to be given on an empty line.
The text is appended to moa.desciption. In the web interface this is converted
Expand Down Expand Up @@ -390,7 +390,7 @@ moa **readme**
~~~~~~~~~~~~~~~~~~
usage: moa readme [-h] [-r] [-v] [--profile]

Edit the Readme.md file for this job You could, obviously, also edit the file
Edit the README.md file for this job You could, obviously, also edit the file
yourself - this is a mere shortcut to try to stimulate you in maintaining one

optional arguments:
Expand Down
1 change: 1 addition & 0 deletions sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Table of contents:
intro
install
coretemplates
sync
#using
#configuration
#filesets
Expand Down
10 changes: 6 additions & 4 deletions sphinx/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ and many more
Installing git (from github)
----------------------------

Moa is hosted on and can be installed from `github <http://github.com/mfiers/Moa>`_::
Moa is hosted on, and can be installed from, `github <http://github.com/mfiers/Moa>`_::

cd ~
git clone git://github.com/mfiers/Moa.git moa

Note - their is also a copy of moa in the python package index - this
one is almost certainly outdated, and is currently not supported.

Configuration
-------------
Expand Down Expand Up @@ -108,9 +110,9 @@ are a few options that you can pursue:
Installing the web interface
----------------------------

Note - this is experimental - you will probably need to fiddle a
little with the configuration to get it working. Start with installing
apache2.
Note - this is highly experimental - you will probably need to fiddle
with the configuration files to get it working. Start with installing
apache2.

Then - assuming that:
* Your Moa work directory is under /home/moa/work
Expand Down
5 changes: 4 additions & 1 deletion sphinx/templates/refresh_templates
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ os.chdir(os.path.join(moa.utils.getMoaBase(), 'sphinx', 'templates'))
_allTemplates = []
for tfile in moa.template.templateList():
print tfile
template = moa.template.getMoaFile(tfile)
template = moa.template.getMoaFile(tfile)
if not template:
continue

tname = template.moa_id
assert(template.moa_id == tfile)

Expand Down
9 changes: 9 additions & 0 deletions template2/hagfish.jinja2
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
### run

echo "Running Hagfish:"
echo "Input file is {{ input }}"
echo "Output file is {{ output }}"

mkdir -p touch
echo hagfish_extract -v --low {{ min_ok }} --high {{ max_ok }} {{ input }}
hagfish_extract -v --low {{ min_ok }} --high {{ max_ok }} {{ input }}
echo touch {{ output }}
touch {{ output }}

### finish

echo hagfish_gapfinder -v -f {{ fasta }}
hagfish_gapfinder -v -f {{ fasta }}
echo hagfish_coverage_combine -v
hagfish_coverage_combine -v
echo hagfish_report -v
hagfish_report -v

### clean
Expand Down

0 comments on commit bde341f

Please sign in to comment.