'rep2pr1_peaks': rep2pr1_peaks_subjob.get_output_ref("peaks"), 'rep2pr1_xcor_plot': rep2pr1_peaks_subjob.get_output_ref("xcor_plot"), 'rep2pr1_xcor_scores': rep2pr1_peaks_subjob.get_output_ref("xcor_scores"), 'rep2pr2_peaks': rep2pr2_peaks_subjob.get_output_ref("peaks"), 'rep2pr2_xcor_plot': rep2pr2_peaks_subjob.get_output_ref("xcor_plot"), 'rep2pr2_xcor_scores': rep2pr2_peaks_subjob.get_output_ref("xcor_scores"), 'pooledpr1_peaks': pooledpr1_peaks_subjob.get_output_ref("peaks"), 'pooledpr1_xcor_plot': pooledpr1_peaks_subjob.get_output_ref("xcor_plot"), 'pooledpr1_xcor_scores': pooledpr1_peaks_subjob.get_output_ref("xcor_scores"), 'pooledpr2_peaks': pooledpr2_peaks_subjob.get_output_ref("peaks"), 'pooledpr2_xcor_plot': pooledpr2_peaks_subjob.get_output_ref("xcor_plot"), 'pooledpr2_xcor_scores': pooledpr2_peaks_subjob.get_output_ref("xcor_scores"), }) return output dxpy.run()
output_prefix = kwargs["output_prefix"] variant_suffixes = kwargs["variant_suffixes"] app_output_fn = {} for subjob_output in subjob_outputs: for type, id in subjob_output.iteritems(): file_id = id["$dnanexus_link"] filename = output_prefix + "_" + variant_suffixes[type] print "Downloading " + str(file_id) + " into " + filename dxpy.download_dxfile(dxid=file_id, filename=filename, append=True) app_output_fn[type] = filename postprocess_outputs = {} need_to_renumber = ["deletions", "short_inserts", "tandem_duplications", "inversions", "large_inserts"] for type, fn in app_output_fn.iteritems(): out_fn = fn if type in need_to_renumber: out_fn = RenumberMergedOutput(fn, fn+"_renumbered") print "\nUploading {file} as {fn}".format(file=out_fn, fn=fn) postprocess_outputs[type] = dxpy.dxlink(dxpy.upload_local_file(out_fn, name=fn)) if kwargs["export_vcf"]: DownloadRefFasta(kwargs["reference_fasta"]) postprocess_outputs["vcf"] = ExportVCF(kwargs=kwargs, output_path=output_prefix, ref_fn="reference_fasta") return postprocess_outputs print dxpy.run()
p.wait() print p.stdout.read() print p.stderr.read() except: print p.stdout.read() print p.stderr.read() # Fill in your application code here. # The following line(s) use the Python bindings to upload your file outputs # after you have created them on the local file system. It assumes that you # have used the output field name for the filename for each output, but you # can change that behavior to suit your needs. recalibration_file = dxpy.upload_local_file("%s.recal" % base_name); tranches_file = dxpy.upload_local_file("%s.tranches" % base_name); r_plot = dxpy.upload_local_file("%s.plots.R" % base_name); # The following line fills in some basic dummy output and assumes # that you have created variables to represent your output with # the same name as your output fields. output = {} output["tranches_file"] = dxpy.dxlink(tranches_file) output["recalibration_file"] = dxpy.dxlink(recalibration_file) output["r_plot"] = dxpy.dxlink(r_plot) return output dxpy.run()
file_id = id["$dnanexus_link"] filename = output_prefix + "_" + variant_suffixes[type] print "Downloading " + str(file_id) + " into " + filename dxpy.download_dxfile(dxid=file_id, filename=filename, append=True) app_output_fn[type] = filename postprocess_outputs = {} need_to_renumber = [ "deletions", "short_inserts", "tandem_duplications", "inversions", "large_inserts" ] for type, fn in app_output_fn.iteritems(): out_fn = fn if type in need_to_renumber: out_fn = RenumberMergedOutput(fn, fn + "_renumbered") print "\nUploading {file} as {fn}".format(file=out_fn, fn=fn) postprocess_outputs[type] = dxpy.dxlink( dxpy.upload_local_file(out_fn, name=fn)) if kwargs["export_vcf"]: DownloadRefFasta(kwargs["reference_fasta"]) postprocess_outputs["vcf"] = ExportVCF(kwargs=kwargs, output_path=output_prefix, ref_fn="reference_fasta") return postprocess_outputs print dxpy.run()