Skip to content

Commit

Permalink
Merge pull request #66 from ENCODE-DCC/PIP-120-different-spp-instances
Browse files Browse the repository at this point in the history
Allow to specify an instance type for spp
  • Loading branch information
strattan authored Feb 16, 2018
2 parents 540bebd + be240b5 commit cc6c90f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
5 changes: 3 additions & 2 deletions dnanexus/call_chip_from_tas.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def t_or_f(arg):
# parser.add_argument('--idrversion', help="IDR version (relevant only if --idr is specified", default="2")
parser.add_argument('--dryrun', help="Formulate the run command, but don't actually run", default=False, action='store_true')
parser.add_argument('--spp_version', help="spp version", default="1.14")
parser.add_argument('--spp_instance', help="Override the spp applet instance type", default=None)
parser.add_argument('--control', help="Use specified control tagAlign rather than infer one.", default=None)
parser.add_argument('--accession', help="Accession the results to the ENCODE Portal", default=False, action='store_true')
parser.add_argument('--fqcheck', help="If --accession, check that analysis is based on latest fastqs on ENCODEd", type=t_or_f, default=None)
Expand Down Expand Up @@ -705,10 +706,10 @@ def main():
'--rep2 %s' % (tas['rep2_ta'].get('file_id')),
'--ctl2 %s' % (tas['rep2_ta'].get('control_id')),
])

if args.spp_instance:
command_strings.append('--spp_instance %s' % str(args.spp_instance))
if args.fragment_length:
command_strings.append('--fragment_length %s' % str(args.fragment_length))

if blacklist:
command_strings.append('--blacklist "%s"' % (blacklist))
if args.debug:
Expand Down
7 changes: 6 additions & 1 deletion dnanexus/chip_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ def t_or_f(arg):
'--spp_version',
help="Version string for spp",
default="1.14")
parser.add_argument(
'--spp_instance',
help="Override the spp applet instance type",
default=None)
parser.add_argument(
'--pipeline_version',
help="Version string for ENCODE pipeline",
Expand Down Expand Up @@ -778,7 +782,8 @@ def main():
'rep2_paired_end': rep2_paired_end,
'as_file': dxpy.dxlink(resolve_file(args.narrowpeak_as)),
'idr_peaks': True,
'spp_version': args.spp_version
'spp_version': args.spp_version,
'spp_instance': args.spp_instance
}
if chrom_sizes:
peaks_stage_input_mapping.update({'chrom_sizes': chrom_sizes})
Expand Down
8 changes: 7 additions & 1 deletion dnanexus/encode_spp/dxapp.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,15 @@
},
{
"name": "fragment_length",
"label": "use this fragment length instead of the one calculated from xcor",
"label": "Use this fragment length instead of the one calculated from xcor",
"class": "int",
"optional": true
},
{
"name": "spp_instance",
"label": "If provided this will over-ride the default instance type for all spp peak-calling jobs",
"class": "string",
"optional": true
}
],
"outputSpec": [
Expand Down
16 changes: 12 additions & 4 deletions dnanexus/encode_spp/src/encode_spp.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

def spp(experiment, control, xcor_scores, chrom_sizes, spp_version,
bigbed=False, as_file=None, name="spp", prefix=None,
fragment_length=None):
fragment_length=None, spp_instance=None):
spp_applet = \
dxpy.find_one_data_object(
classname='applet',
Expand All @@ -45,7 +45,14 @@ def spp(experiment, control, xcor_scores, chrom_sizes, spp_version,
spp_input.update({"as_file": as_file})
if prefix:
spp_input.update({"prefix": prefix})
return spp_applet.run(spp_input, name=name)
spp_args = {
'name': name,
}
if spp_instance:
spp_args.update({
'instance_type': spp_instance
})
return spp_applet.run(spp_input, **spp_args)


def xcor_only(tags, paired_end, spp_version, name='xcor_only'):
Expand All @@ -68,7 +75,7 @@ def xcor_only(tags, paired_end, spp_version, name='xcor_only'):
def main(rep1_ta, ctl1_ta, rep1_xcor, rep1_paired_end,
npeaks, nodups, chrom_sizes, spp_version,
rep2_ta=None, ctl2_ta=None, rep2_xcor=None, rep2_paired_end=None,
as_file=None, idr_peaks=False, fragment_length=None):
as_file=None, idr_peaks=False, fragment_length=None, spp_instance=None):

rep1_ta_file = dxpy.DXFile(rep1_ta)
dxpy.download_dxfile(rep1_ta_file.get_id(), rep1_ta_file.name)
Expand Down Expand Up @@ -190,7 +197,8 @@ def main(rep1_ta, ctl1_ta, rep1_xcor, rep1_paired_end,
common_args = {
'chrom_sizes': chrom_sizes,
'spp_version': spp_version,
'as_file': as_file
'as_file': as_file,
'spp_instance': spp_instance
}
if fragment_length is not None:
common_args.update({'fragment_length': fragment_length})
Expand Down

0 comments on commit cc6c90f

Please sign in to comment.