From 7028126ee0f11f5c54bc4f03413aa350a80bfa9a Mon Sep 17 00:00:00 2001 From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr> Date: Wed, 17 Feb 2021 09:45:18 +0100 Subject: [PATCH] src/download_encode_eclip/merge_eclip.py: modification of merge_files function to remove the heading chr in the first bed column --- src/download_encode_eclip/merge_eclip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/download_encode_eclip/merge_eclip.py b/src/download_encode_eclip/merge_eclip.py index 0e149311..db0df8d8 100644 --- a/src/download_encode_eclip/merge_eclip.py +++ b/src/download_encode_eclip/merge_eclip.py @@ -143,8 +143,8 @@ def merge_files(dfiles: Dict[str, List[Path]], target: str) -> None: list_file = " ".join(map(str, dfiles[k])) cmd = f"zcat {list_file} | sort -k1,1 -k2,2n > {tmp_out}" cmd2 = f"bedtools merge -i {tmp_out} -s -c 4,5,6 " \ - f"-o collapse,mean,distinct | cut -f1-3,5-7 | gzip -c " \ - f"> {res_out}" + f"-o collapse,mean,distinct | cut -f1-3,5-7 | sed 's/^chr//g' " \ + f"| gzip -c > {res_out}" sp.check_output(cmd, shell=True) sp.check_output(cmd2, shell=True) tmp_out.unlink() -- GitLab