Commit e40ca2ed authored by nfontrod's avatar nfontrod
Browse files

src/bed_handler/select_regulated_near_ctcf_exons.py: creation of bed file with...

src/bed_handler/select_regulated_near_ctcf_exons.py: creation of bed file with duplicate genes in create_bed_ctcf_exon
parent 53d79600
......@@ -12,6 +12,7 @@ import pandas as pd
from doctest import testmod
from .filter_gene import filter_bed
import warnings
from .get_other_exon_in_same_gene import create_gene_bed4norm
def filter_ctcf_distance_table(df: pd.DataFrame, reg: str, threshold: int,
......@@ -137,8 +138,7 @@ def create_bed_ctcf_exon(reg: str, threshold: int,
:param near_ctcf: True to recover exons near CTCF False to recover \
those far from CTCF
"""
if threshold < 0:
threshold = 0
threshold = max(threshold, 0)
if threshold == 0:
location = "both"
if not include0 and threshold == 0:
......@@ -177,6 +177,13 @@ def create_bed_ctcf_exon(reg: str, threshold: int,
f"{reg}_{i0}_gene.bed",
sep="\t",
index=False)
df_gene = create_gene_bed4norm(BedConfig.gene_bed, df_exon)
df_gene.to_csv(BedConfig.bed.output /
f"{name_near}CTCF_{threshold}_{location}_ddx_"
f"{reg}_{i0}_gene-dup.bed",
sep="\t",
index=False)
if __name__ == "__main__":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment