thasso / pyjip

JIP Pipeline System
http://pyjip.readthedocs.org
Other
19 stars 8 forks source link

Wrong Output --dry #36

Open marcDabad opened 10 years ago

marcDabad commented 10 years ago

Command:

jip run --dry MethRep.jip -i test_files/all.mult_diff.map -r test_files/rmsk.clean.bed -b TEST
#######################################################################################
|                               Pipeline Configuration                                |
+--------------------------------+----------------------------------------------------+
|              Name              |                       Value                        |
+================================+====================================================+
| input                          | test_files/all.mult_diff.map                       |
| repBed                         | test_files/rmsk.clean.bed                          |
| base                           | TEST                                               |
| p                              | False                                              |
+--------------------------------+----------------------------------------------------+
#######################################################################################
|                                Job - FilterMapping                                  |
+--------------------------------+----------------------------------------------------+
|              Name              |                       Value                        |
+================================+====================================================+
| input                          | test_files/all.mult_diff.map                       |
| base                           | TEST                                               |
| p                              | False                                              |
| unique                         | TEST.unique.map                                    |
| multi                          | TEST.mult.map                                      |
| uniqOEA                        | TEST.uniq_OEA.map                                  |
| multOEA                        | TEST.mult_OEA.map                                  |
| multD                          | TEST.mult_diff.map                                 |
+--------------------------------+----------------------------------------------------+
#######################################################################################
|                                     Job - TEST                                      |
+--------------------------------+----------------------------------------------------+
|              Name              |                       Value                        |
+================================+====================================================+
| input                          | [u'TEST.mult.map', u'TEST.unique.map',             |
|                                | u'TEST.mult_OEA.map']                              |
| cmd                            | [u'echo TEST.unique.map']                          |
| outfile                        |                                                    |
| output                         | <<STREAM>>                                         |
+--------------------------------+----------------------------------------------------+
#######################################################################################
|                                    Job - TEST.1                                     |
+--------------------------------+----------------------------------------------------+
|              Name              |                       Value                        |
+================================+====================================================+
| input                          | [u'TEST.mult.map', u'TEST.unique.map',             |
|                                | u'TEST.mult_OEA.map']                              |
| cmd                            | [u'echo TEST.mult.map']                            |
| outfile                        |                                                    |
| output                         | <<STREAM>>                                         |
+--------------------------------+----------------------------------------------------+
#######################################################################################
|                                    Job - TEST.2                                     |
+--------------------------------+----------------------------------------------------+
|              Name              |                       Value                        |
+================================+====================================================+
| input                          | [u'TEST.mult.map', u'TEST.unique.map',             |
|                                | u'TEST.mult_OEA.map']                              |
| cmd                            | [u'echo TEST.mult_OEA.map']                        |
| outfile                        |                                                    |
| output                         | <<STREAM>>                                         |
+--------------------------------+----------------------------------------------------+
#####################################################################################################################################################
|                                                                    Job states                                                                     |
+--------------------------------+--------+----------------------------------------------------+----------------------------------------------------+
|              Name              | State  |                       Inputs                       |                      Outputs                       |
+================================+========+====================================================+====================================================+
| FilterMapping                  | Hold   | test_files/all.mult_diff.map                       | TEST.unique.map, TEST.mult.map, TEST.uniq_OEA.map, |
|                                |        |                                                    | TEST.mult_OEA.map, TEST.mult_diff.map              |
| TEST                           | Hold   | TEST.mult.map, TEST.unique.map, TEST.mult_OEA.map  |                                                    |
| TEST.1                         | Hold   | TEST.mult.map, TEST.unique.map, TEST.mult_OEA.map  |                                                    |
| TEST.2                         | Hold   | TEST.mult.map, TEST.unique.map, TEST.mult_OEA.map  |                                                    |
+--------------------------------+--------+----------------------------------------------------+----------------------------------------------------+
#####################
|  Job hierarchy    |
#####################
FilterMapping (MethRep)
├─TEST
├─TEST.1
└─TEST.2
#####################
| Tasks:         4  |
| Jobs:          4  |
| Named Groups:  1  |
| Job Groups:    1  |
#####################

Files used:

FilterMap.jip:

#!/usr/bin/env jip
# Split map files by their mappings
#
# Usage:
#    FilterMap.jip -i <MapFile> [-b <prefix_output>] [-p]
#
# Inputs:
#    -i, --input <MapFilet>        MAP file
#
# Options:
#    -b, --base <prefix_output>    Prefix name output [default: out]
#    -p                Data is paired-end
#
#
#

#%begin init
add_output('unique', '${base}.unique.map')
add_output('multi', '${base}.mult.map')
add_output('uniqOEA', '${base}.uniq_OEA.map')
add_output('multOEA', '${base}.mult_OEA.map')
add_output('multD', '${base}.mult_diff.map')
#%end

echo "${input}" 
python filter_map.py -i ${input} -o ${base} ${p|arg("-p")} 

MethRep.jip:

! /usr/bin/env jip

#
#Locate reads that map in repetitive regions
#
#Usage:
#    MetRep.jip -i <input> -r <rmsk.bed> -b <prefix_output> [-p]
#
#Inputs:
#    -i, --input <input>            Mapping file from gem
#    -r, --repBed <rmsk.bed>        Repetitive regions in BED format
#
#
#Options:
#    -b, --base <prefix_output>    Prefix output 
#    -p                            Flag if mapping is paired
#
#%begin pipeline
sepMap = job('FilterMapping').run("FilterMap", input=opts["input"], base=base, p=p)

f = job("${base}").bash("echo ${input}", input=[sepMap.unique, sepMap.multi, sepMap.multOEA])

#%end