diff --git a/chipathlon/conf.py b/chipathlon/conf.py index ff35fd07562a0f9bdb6dc38cbf04c23acc9f64f6..08a83784a0d5082d7d01a9831f34b5b85220ab4c 100644 --- a/chipathlon/conf.py +++ b/chipathlon/conf.py @@ -47,7 +47,8 @@ file_extensions = { "quality": ["quality"], "qc": ["qc"], "pdf": ["pdf"], - "ccscore": ["ccscore"] + "ccscore": ["ccscore"], + "xls": ["xls"] } # list of resources that can be specified per job (step) in diff --git a/chipathlon/jobs/modules/peak_call.yaml b/chipathlon/jobs/modules/peak_call.yaml index c3f61dbbb2442a1b72066ecaa45b93d77dab819a..2f458049a9b505268b8ddeec6dc35094afc9ecc2 100644 --- a/chipathlon/jobs/modules/peak_call.yaml +++ b/chipathlon/jobs/modules/peak_call.yaml @@ -49,7 +49,11 @@ peak_call: type: argument additional_inputs: null outputs: - - results.narrowPeak: + - peaks.narrowPeak: + type: file + - peaks.xls: + type: file + - summits.bed: type: file - sort_awk_sort_peaks: inputs: diff --git a/chipathlon/jobs/params/macs2_callpeak.yaml b/chipathlon/jobs/params/macs2_callpeak.yaml index 8c60ac934445ef79b3068670699a1432b2a8b57b..f0c48d585b550dd2bc934f668b19a1c06ee06124 100644 --- a/chipathlon/jobs/params/macs2_callpeak.yaml +++ b/chipathlon/jobs/params/macs2_callpeak.yaml @@ -10,6 +10,10 @@ macs2_callpeak: outputs: - bed: type: file + - xls: + type: file + - bed: + type: file command: macs2 arguments: - callpeak: diff --git a/chipathlon/jobs/scripts/db_save_bed.py b/chipathlon/jobs/scripts/db_save_result.py similarity index 69% rename from chipathlon/jobs/scripts/db_save_bed.py rename to chipathlon/jobs/scripts/db_save_result.py index 35c82d5b51f014ee8fee756f309bde64d85e0811..ca983f2bcb8f00b590e33a25acba5a42c729db42 100644 --- a/chipathlon/jobs/scripts/db_save_bed.py +++ b/chipathlon/jobs/scripts/db_save_result.py @@ -5,8 +5,15 @@ parser = argparse.ArgumentParser(description="Insert a bed file into the databas parser.add_argument("-p", "--password", dest="password", required=True, help="Database user password.") parser.add_argument("-u", "--username", dest="username", required=True, help="Database user.") parser.add_argument("-h", "--host", dest="host", required=True, help="Database host.") -parser.add_argument("-f", "--file", dest="file", required=True, help="Path to bed file.") +parser.add_argument("-f", "--file", dest="file", required=True, help="Path to result file.") parser.add_argument("-c", "--controls", dest="control_ids", required=True, nargs="+", help="List of control ids.") parser.add_argument("-e", "--experiments", dest="experiment_ids", required=True, nargs="+", help="List of experiment/signal ids.") parser.add_argument("-a", "--additional", dest="additional") +parser.add_argument("-t", "--type", dest="type", required=True, help="Type of result file to save [bed, peak]") args = parser.parse_args() + +mdb = chipathlon.db.MongoDB(args.host, args.username, args.password) +if args.type() == "bed": + mdb.save_bed(args.f, args.c, args.e, {}) +elif args.type() == "peak": + mdb.save_peak(args.f, args.c, args.e, {})