Skip to content

Commit

Permalink
Add cmo_list2bed 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hisplan committed Apr 28, 2017
1 parent 2277ef2 commit a3d783f
Show file tree
Hide file tree
Showing 18 changed files with 360 additions and 8 deletions.
2 changes: 1 addition & 1 deletion REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
23
24
1 change: 1 addition & 0 deletions build/containers/list2bed/1.0.1/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
25 changes: 25 additions & 0 deletions build/containers/list2bed/1.0.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM python:2.7.13-alpine
MAINTAINER Jaeyoung Chun ([email protected])

LABEL maintainer="Jaeyoung Chun ([email protected])" \
version.container="1.0" \
version.list2bed="1.0.1" \
version.alpine="3.4.6" \
source.gatk="https://github.com/mskcc/list2bed/releases/tag/1.0.1"

ENV LIST2BED_VERSION 1.0.1

# to build pybedtools : build-base musl-dev zlib-dev cython
RUN apk add --update \
&& apk add ca-certificates openssl \
&& apk add build-base musl-dev zlib-dev bzip2-dev xz-dev cython \
&& pip install pybedtools \
&& cd /tmp && wget https://github.com/mskcc/list2bed/archive/${LIST2BED_VERSION}.zip \
&& unzip ${LIST2BED_VERSION}.zip \
&& mv /tmp/list2bed-${LIST2BED_VERSION}/list2bed.py /usr/bin/ \
&& rm -rf /var/cache/apk/* /tmp/*

# disable per-user site-packages before run
ENV PYTHONNOUSERSITE set

ENTRYPOINT ["python", "/usr/bin/list2bed.py"]
44 changes: 44 additions & 0 deletions build/containers/list2bed/1.0.1/Singularity
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Bootstrap: docker
From: /pipeline-list2bed:1.0.1
Registry: http://localhost:5000

%setup

# copy settings-container.sh from the host to the container
cp /vagrant/build/scripts/settings-container.sh $SINGULARITY_ROOTFS/tmp

%post

# load the settings-container.sh which was copied in the %setup step
source /tmp/settings-container.sh

# create an empty directory for each bind point defined
for dir in $SINGULARITY_BIND_POINTS
do
mkdir -p $dir
done

# remove settings-container.sh
rm -rf /tmp/settings-container.sh

%runscript

# disable per-user site-packages before run
export PYTHONNOUSERSITE="set"
python /usr/bin/list2bed.py "$@"

%test

# get actual output of the tool
python /usr/bin/list2bed.py 2>&1 | head -1 > /tmp/actual.diff.txt

# expected output
cat > /tmp/expected.diff.txt << EOM
usage: list2bed.py [-h] -i INPUT_FILE -o OUTPUT_FILE [-ns]
EOM

# diff
diff /tmp/actual.diff.txt /tmp/expected.diff.txt

# delete tmp
rm -rf /tmp/*.diff.txt
89 changes: 89 additions & 0 deletions build/cwl-wrappers/cmo-list2bed/1.0.1/cmo-list2bed.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/usr/bin/env cwl-runner

$namespaces:
dct: http://purl.org/dc/terms/
foaf: http://xmlns.com/foaf/0.1/
doap: http://usefulinc.com/ns/doap#

$schemas:
- http://dublincore.org/2012/06/14/dcterms.rdf
- http://xmlns.com/foaf/spec/20140114.rdf
- http://usefulinc.com/ns/doap#

doap:name: cmo-list2bed.cwl
doap:release:
- class: doap:Version
doap:revision: 1.0.1

dct:creator:
- class: foaf:Organization
foaf:name: Memorial Sloan Kettering Cancer Center
foaf:member:
- class: foaf:Person
foaf:name: Jaeyoung Chun
foaf:mbox: mailto:[email protected]

dct:contributor:
- class: foaf:Organization
foaf:name: Memorial Sloan Kettering Cancer Center
foaf:member:
- class: foaf:Person
foaf:name: Jaeyoung Chun
foaf:mbox: mailto:[email protected]

# This tool description was generated automatically by argparse2cwl ver. 0.3.1
# To generate again: $ cmo_list2bed -o FILENAME --generate_cwl_tool
# Help: $ cmo_list2bed --help_arg2cwl

cwlVersion: cwl:v1.0

class: CommandLineTool
baseCommand: [cmo_list2bed]

requirements:
InlineJavascriptRequirement: {}
ResourceRequirement:
ramMin: 2
coresMin: 1


doc: |
rerun a FIZZLED Job

inputs:
input_file:
type:

- string
- File
- type: array
items: string
doc: picard interval list
inputBinding:
prefix: --input_file

output_file:
type: string

doc: output bed file
inputBinding:
prefix: --output_file

no_sort:
type: ['null', boolean]
default: true
doc: sort bed file output
inputBinding:
prefix: --no_sort


outputs:
output_file:
type: File
outputBinding:
glob: |
${
if (inputs.output_file)
return inputs.output_file;
return null;
}
30 changes: 30 additions & 0 deletions build/cwl-wrappers/cmo-list2bed/1.0.1/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$namespaces:
dct: http://purl.org/dc/terms/
foaf: http://xmlns.com/foaf/0.1/
doap: http://usefulinc.com/ns/doap#

$schemas:
- http://dublincore.org/2012/06/14/dcterms.rdf
- http://xmlns.com/foaf/spec/20140114.rdf
- http://usefulinc.com/ns/doap#

doap:name: cmo-list2bed.cwl
doap:release:
- class: doap:Version
doap:revision: '1.0.1'

dct:creator:
- class: foaf:Organization
foaf:name: Memorial Sloan Kettering Cancer Center
foaf:member:
- class: foaf:Person
foaf:name: Jaeyoung Chun
foaf:mbox: mailto:[email protected]

dct:contributor:
- class: foaf:Organization
foaf:name: Memorial Sloan Kettering Cancer Center
foaf:member:
- class: foaf:Person
foaf:name: Jaeyoung Chun
foaf:mbox: mailto:[email protected]
10 changes: 10 additions & 0 deletions build/cwl-wrappers/cmo-list2bed/1.0.1/outputs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
outputs:
output_file:
type: File
outputBinding:
glob: |
${
if (inputs.output_file)
return inputs.output_file;
return null;
}
56 changes: 56 additions & 0 deletions build/cwl-wrappers/cmo-list2bed/1.0.1/postprocess.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/python
"""postprocess"""

import argparse
import ruamel.yaml


def read(filename):
"""return file contents"""

with open(filename, 'r') as file_in:
return file_in.read()


def write(filename, cwl):
"""write to file"""

with open(filename, 'w') as file_out:
file_out.write(cwl)


def main():
"""main function"""

parser = argparse.ArgumentParser(description='postprocess')

parser.add_argument(
'-f',
action="store",
dest="filename_cwl",
help='Name of the cwl file',
required=True
)

params = parser.parse_args()

cwl = ruamel.yaml.load(read(params.filename_cwl),
ruamel.yaml.RoundTripLoader)

# we're doing this way to preserve the order
# can't figure out other ways.
input_file_type = """
- string
- File
- type: array
items: string
"""
cwl['inputs']['input_file']['type'] = ruamel.yaml.load(input_file_type, ruamel.yaml.RoundTripLoader)

write(params.filename_cwl, ruamel.yaml.dump(
cwl, Dumper=ruamel.yaml.RoundTripDumper))


if __name__ == "__main__":

main()
5 changes: 5 additions & 0 deletions build/cwl-wrappers/cmo-list2bed/1.0.1/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
requirements:
InlineJavascriptRequirement: {}
ResourceRequirement:
ramMin: 2
coresMin: 1
2 changes: 1 addition & 1 deletion build/cwl-wrappers/cmo_resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
},
"list2bed": {
"1.0.0": "sudo docker run -i list2bed:1.0.0",
"default": "sudo docker run -i list2bed:1.0.0"
"default": "sudo docker run -i list2bed:1.0.1"
},
"matlab": {
"default": "/opt/common/CentOS_6-dev/matlab/R2013a/v81/"
Expand Down
3 changes: 2 additions & 1 deletion build/cwl-wrappers/prism_resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@
},
"list2bed": {
"1.0.0": "sing.sh list2bed 1.0.0",
"default": "sing.sh list2bed 1.0.0"
"1.0.1": "sing.sh list2bed 1.0.1",
"default": "sing.sh list2bed 1.0.1"
},
"matlab": {
"R2014b": "/opt/common/CentOS_6-dev/matlab/R2014b/",
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"0.2.5a7"
],
"list2bed": [
"1.0.0"
"1.0.1"
]
},
"containerDependency": {
Expand Down
2 changes: 1 addition & 1 deletion docs/workspace/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ cmo-gatk.BaseRecalibrator/3.3-0/cmo-gatk.BaseRecalibrator.cwl
cmo-gatk.FindCoveredIntervals/3.3-0/cmo-gatk.FindCoveredIntervals.cwl
cmo-gatk.PrintReads/3.3-0/cmo-gatk.PrintReads.cwl
cmo-gatk.SomaticIndelDetector/2.3-9/cmo-gatk.SomaticIndelDetector.cwl
cmo-list2bed/1.0.0/cmo-list2bed.cwl
cmo-list2bed/1.0.1/cmo-list2bed.cwl
cmo-mutect/1.1.4/cmo-mutect.cwl
cmo-picard.AddOrReplaceReadGroups/1.129/cmo-picard.AddOrReplaceReadGroups.cwl
cmo-picard.AddOrReplaceReadGroups/1.96/cmo-picard.AddOrReplaceReadGroups.cwl
Expand Down
1 change: 1 addition & 0 deletions setup/cwl-wrappers/1.0.0/checksum.dat
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ e62ebe8851dd55f1cc85aac984bc2e98 ./cmo-bwa-mem/0.7.12/cmo-bwa-mem.cwl
c748bb7cec67c5438274166123d3d2fe ./cmo-gatk.PrintReads/3.3-0/cmo-gatk.PrintReads.cwl
4585769701d4b50515be35dd49785b2f ./cmo-gatk.SomaticIndelDetector/2.3-9/cmo-gatk.SomaticIndelDetector.cwl
e2b0fd33ed04dbe709a6017d6a72c5e7 ./cmo-list2bed/1.0.0/cmo-list2bed.cwl
9397490df4170fbb1a25ce3c508f9d95 ./cmo-list2bed/1.0.1/cmo-list2bed.cwl
126949ee37cbf7aefbad9bc19ae9426b ./cmo-mutect/1.1.4/cmo-mutect.cwl
86cfca0e3fbcd0cd3ec6cc16293777b2 ./cmo-picard.AddOrReplaceReadGroups/1.129/cmo-picard.AddOrReplaceReadGroups.cwl
ed873a7dc75dcc9c26788834fa1ab043 ./cmo-picard.AddOrReplaceReadGroups/1.96/cmo-picard.AddOrReplaceReadGroups.cwl
Expand Down
Loading

0 comments on commit a3d783f

Please sign in to comment.