-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
360 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
23 | ||
24 |
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 @@ | ||
* |
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,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"] |
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,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 |
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,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; | ||
} |
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,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] |
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,10 @@ | ||
outputs: | ||
output_file: | ||
type: File | ||
outputBinding: | ||
glob: | | ||
${ | ||
if (inputs.output_file) | ||
return inputs.output_file; | ||
return null; | ||
} |
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,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() |
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,5 @@ | ||
requirements: | ||
InlineJavascriptRequirement: {} | ||
ResourceRequirement: | ||
ramMin: 2 | ||
coresMin: 1 |
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 |
---|---|---|
|
@@ -33,7 +33,7 @@ | |
"0.2.5a7" | ||
], | ||
"list2bed": [ | ||
"1.0.0" | ||
"1.0.1" | ||
] | ||
}, | ||
"containerDependency": { | ||
|
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
Oops, something went wrong.