-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure docs, add hello, world! example
- Loading branch information
Showing
10 changed files
with
168 additions
and
62 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
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
Installing and Hello World | ||
============================== | ||
|
||
Release versions are posted on the GitHub `releases page <https://github.com/epigen/pypiper/releases>`_. You can install the latest version directly from GitHub using pip: | ||
|
||
.. code-block:: bash | ||
pip install --user https://github.com/epigen/pypiper/zipball/master | ||
Update with: | ||
|
||
.. code-block:: bash | ||
pip install --user --upgrade https://github.com/epigen/pypiper/zipball/master | ||
Now, to test pypiper, follow the commands in the `Hello, Pypiper! tutorial: just run these 3 lines of code and you're running your first pypiper pipeline! | ||
|
||
.. code:: bash | ||
|
||
# Install the latest version of pypiper: | ||
pip install --user https://github.com/epigen/pypiper/zipball/master | ||
|
||
# download hello_pypiper.py | ||
wget https://github.com/databio/pypiper/example_pipelines/hello_pypiper.py | ||
|
||
# Run it: | ||
python hello_pypiper.py | ||
|
||
|
||
You should see printed to screen some output like this: | ||
|
||
.. code:: | ||
|
||
---------------------------------------- | ||
##### [Pipeline run code and environment:] | ||
* Command: `hello_pypiper.py` | ||
* Compute host: puma | ||
* Working dir: /home/nsheff/code/pypiper/example_pipelines | ||
* Outfolder: hello_pypiper_results/ | ||
* Pipeline started at: (03-02 14:58:20) elapsed:0:00:00 _TIME_ | ||
|
||
##### [Version log:] | ||
* Python version: 2.7.12 | ||
* Pypiper dir: `/home/nsheff/.local/lib/python2.7/site-packages/pypiper` | ||
* Pipeline dir: `/home/nsheff/code/pypiper/example_pipelines` | ||
* Pipeline version: fa2c12d8fba0a9b50a678e7682f39a7a756e0ead | ||
* Pipeline branch: * dev | ||
* Pipeline date: 2017-01-27 14:05:15 -0500 | ||
|
||
##### [Arguments passed to pipeline:] | ||
|
||
---------------------------------------- | ||
|
||
|
||
Change status from initializing to running | ||
Hello! (03-02 14:58:20) elapsed:0:00:00 _TIME_ | ||
|
||
Target to produce: `hello_pypiper_results/output.txt` | ||
> `echo 'Hello, Pypiper!' > hello_pypiper_results/output.txt` | ||
|
||
<pre> | ||
</pre> | ||
Process 22693 returned: (0). Elapsed: 0:00:00. | ||
|
||
Change status from running to completed | ||
> `Time` 0:00:00 hello_pypiper _RES_ | ||
> `Success` 03-02 14:58:20 hello_pypiper _RES_ | ||
|
||
##### [Epilogue:] | ||
* Total elapsed time: 0:00:00 | ||
* Peak memory used: 0.0 GB | ||
* Pipeline completed at: (03-02 14:58:20) elapsed:0:00:00 _TIME_ | ||
|
||
Pypiper terminating spawned child process 22679 | ||
|
||
Now observe your results in the folder ``hello_pypiper_results``: | ||
|
||
* hello_pypiper_commands.sh | ||
* hello_pypiper_completed.flag | ||
* hello_pypiper_log.md | ||
* hello_pypiper_profile.tsv | ||
* output.txt | ||
* stats.tsv | ||
|
||
These files are explained in more detail in the :doc:`Outputs <outputs>` section. |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
Using Pipelines | ||
========================= | ||
|
||
Pypiper pipelines are python scripts. There is no special requirement or syntax. To run a pypiper pipeline, you run it as you would any basic script, usage will vary based on the script. Pipeline authors determine what command line arguments their pipeline will recognize. You can usually figure this out by passing the ``--help argument``, like so: ``script.py --help``. You should check the individual Pypiper script you're using to see what it does. | ||
|
||
Many pipelines employ default pypiper arguments which are detailed below: | ||
|
||
- ``-R, --recover`` | ||
Recover mode, overwrite locks. This argument will tell pypiper to recover from a failed previous run. Pypiper will execute commands until it encounters a locked file, at which point it will re-execute the failed command and continue from there. | ||
- ``-F, --follow`` | ||
Run follow-functions. :doc:`the follow argument <the-follow-argument>`. |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env python | ||
import pypiper | ||
outfolder = "hello_pypiper_results" # Choose a folder for your results | ||
pm = pypiper.PipelineManager(name="hello_pypiper", outfolder=outfolder) | ||
|
||
|
||
pm.timestamp("Hello!") | ||
target_file = "hello_pypiper_results/output.txt" | ||
cmd = "echo 'Hello, Pypiper!' > " + target_file | ||
pm.run(cmd, target_file) | ||
|
||
pm.stop_pipeline() |