Skip to content

Commit

Permalink
Merge pull request #15 from 4dn-dcic/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
SooLee authored Dec 6, 2017
2 parents f144ca1 + ba9952a commit b6838d8
Show file tree
Hide file tree
Showing 16 changed files with 282 additions and 169 deletions.
39 changes: 39 additions & 0 deletions Benchmark/Benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def benchmark(app_name, input_json, raise_error=False):
return(hi_c_processing_partc(input_json))
elif app_name == 'pairs-patch':
return(pairs_patch(input_json))
elif app_name == 'repliseq-parta':
return(repliseq_parta(input_json))
else:
if raise_error:
raise AppNameUnavailableException
Expand Down Expand Up @@ -327,6 +329,43 @@ def hi_c_processing_partc(input_json):
return(r.as_dict())


def repliseq_parta(input_json):
assert 'input_size_in_bytes' in input_json
assert 'fastq' in input_json.get('input_size_in_bytes')
assert 'bwaIndex' in input_json.get('input_size_in_bytes')

# cpu
nthreads = 4 # default from cwl
if 'parameters' in input_json:
if 'nthreads' in input_json.get('parameters'):
nthreads = input_json.get('parameters').get('nthreads')

# space
input_sizes = input_json.get('input_size_in_bytes')
data_input_size = input_sizes.get('fastq')
total_input_size = data_input_size + input_sizes.get('bwaIndex')
output_bam_size = data_input_size * 2
output_clipped_fq_size = data_input_size
output_size = output_bam_size * 3 + output_clipped_fq_size
intermediate_index_size = input_sizes.get('bwaIndex') * 2
copied_input_size = data_input_size * 7 # copied and unzipped
total_intermediate_size \
= intermediate_index_size + output_size + copied_input_size
total_output_size = output_size
additional_size_in_gb = 10

total_file_size_in_bp \
= total_input_size + total_intermediate_size + total_output_size
total_size = total_file_size_in_bp / GB_IN_BYTES + additional_size_in_gb

# mem
mem = input_sizes.get('bwaIndex') * 4 / MB_IN_BYTES + (nthreads * 500)

r = BenchmarkResult(size=total_size, mem=mem, cpu=nthreads)

return(r.as_dict())


def get_aws_ec2_info_file():
this_dir, _ = os.path.split(__file__)
return(os.path.join(this_dir, "aws", "Amazon EC2 Instance Comparison.csv"))
Expand Down
Binary file modified Benchmark/__pycache__/Benchmark.cpython-35.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion Benchmark/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Version information."""

# The following line *must* be the last in the module, exactly as formatted:
__version__ = "0.2.0"
__version__ = "0.2.3"
10 changes: 5 additions & 5 deletions cwl_awsem/repliseq/align_se.cwl → cwl_awsem/repliseq/align.cwl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hints": [
{
"dockerPull": "duplexa/4dn-repliseq:v9",
"dockerPull": "duplexa/4dn-repliseq:v10",
"class": "DockerRequirement"
}
],
Expand Down Expand Up @@ -41,7 +41,7 @@
},
{
"type": [
"null",

"string"
],
"id": "#prefix",
Expand All @@ -53,7 +53,7 @@
},
{
"type": [
"null",

"string"
],
"id": "#outdir",
Expand All @@ -67,7 +67,7 @@
"outputs": [
{
"type": [
"null",

"File"
],
"id": "#out_bam",
Expand All @@ -77,7 +77,7 @@
}
],
"baseCommand": [
"run-align-se.sh"
"run-align.sh"
],
"requirements": [
{
Expand Down
98 changes: 0 additions & 98 deletions cwl_awsem/repliseq/align_pe.cwl

This file was deleted.

10 changes: 5 additions & 5 deletions cwl_awsem/repliseq/clip.cwl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hints": [
{
"dockerPull": "duplexa/4dn-repliseq:v9",
"dockerPull": "duplexa/4dn-repliseq:v10",
"class": "DockerRequirement"
}
],
Expand All @@ -20,7 +20,7 @@
},
{
"type": [
"null",

"string"
],
"id": "#outprefix",
Expand All @@ -32,7 +32,7 @@
},
{
"type": [
"null",

"string"
],
"id": "#outdir",
Expand All @@ -46,7 +46,7 @@
"outputs": [
{
"type": [
"null",

"File"
],
"id": "#out_clipped_fastq",
Expand All @@ -56,7 +56,7 @@
},
{
"type": [
"null",

"File"
],
"id": "#out_log",
Expand Down
21 changes: 5 additions & 16 deletions cwl_awsem/repliseq/count.cwl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hints": [
{
"dockerPull": "duplexa/4dn-repliseq:v9",
"dockerPull": "duplexa/4dn-repliseq:v10",
"class": "DockerRequirement"
}
],
Expand All @@ -20,7 +20,7 @@
},
{
"type": [
"null",

"File"
],
"inputBinding": {
Expand All @@ -42,18 +42,7 @@
},
{
"type": [
"int"
],
"id": "#minsize",
"inputBinding": {
"position": 6,
"separate": true
},
"default": 10000000
},
{
"type": [
"null",

"string"
],
"id": "#outprefix",
Expand All @@ -65,7 +54,7 @@
},
{
"type": [
"null",

"string"
],
"id": "#outdir",
Expand All @@ -79,7 +68,7 @@
"outputs": [
{
"type": [
"null",

"File"
],
"id": "#out_count_bg",
Expand Down
10 changes: 5 additions & 5 deletions cwl_awsem/repliseq/dedup.cwl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hints": [
{
"dockerPull": "duplexa/4dn-repliseq:v9",
"dockerPull": "duplexa/4dn-repliseq:v10",
"class": "DockerRequirement"
}
],
Expand All @@ -20,7 +20,7 @@
},
{
"type": [
"null",

"string"
],
"id": "#outprefix",
Expand All @@ -32,7 +32,7 @@
},
{
"type": [
"null",

"string"
],
"id": "#outdir",
Expand All @@ -46,7 +46,7 @@
"outputs": [
{
"type": [
"null",

"File"
],
"id": "#out_deduped_bam",
Expand All @@ -56,7 +56,7 @@
},
{
"type": [
"null",

"File"
],
"id": "#out_log",
Expand Down
8 changes: 4 additions & 4 deletions cwl_awsem/repliseq/filter.cwl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hints": [
{
"dockerPull": "duplexa/4dn-repliseq:v9",
"dockerPull": "duplexa/4dn-repliseq:v10",
"class": "DockerRequirement"
}
],
Expand Down Expand Up @@ -30,7 +30,7 @@
},
{
"type": [
"null",

"string"
],
"id": "#outprefix",
Expand All @@ -42,7 +42,7 @@
},
{
"type": [
"null",

"string"
],
"id": "#outdir",
Expand All @@ -56,7 +56,7 @@
"outputs": [
{
"type": [
"null",

"File"
],
"id": "#out_filtered_bg",
Expand Down
Loading

0 comments on commit b6838d8

Please sign in to comment.