Skip to content
Snippets Groups Projects
Commit 5f9c7b75 authored by nfontrod's avatar nfontrod
Browse files

src/find_interaction_cluster/clip_figures/clip_analyser.py: fix bedtools intersect function

parent 17441b57
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ def bedtools_intersect(gene_bed: Path, clip_bed: Path,
"""
res = sp.check_output(f"bedtools intersect -a {gene_bed} "
f"-b {clip_bed} -c", shell=True)
f"-b {clip_bed} -c -s", shell=True)
res = StringIO(str(res, "utf-8"))
id_col = f"id_{feature}"
columns = ["chr", "start", "end", id_col, "name", "strand", "clip_peak"]
......@@ -182,7 +182,7 @@ def create_table(feature: str, clip_file: Path,
:param com_file: A file containing communities
:return: The final dataframe that can be used to create clip figures
>>> cf = find_or_create_community("", 3, 3, True, 1.5, "gene")
>>> cf = find_or_create_community("", 3, 3, True, 1.5, "ALL", "gene")
>>> create_table("gene", ConfigClip.test_clip_bed,
... ConfigClip.test_gene_bed, cf)
id_gene clip_peak peak_density community community_size
......@@ -407,6 +407,7 @@ def clip_folder_analysis(clip_folder: Path, project: str, weight: int,
processes.append(pool.apply_async(create_figure, args))
[p.get(timeout=None) for p in processes]
if __name__ == "__main__":
import doctest
doctest.testmod()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment