Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ import pandas as pd ...@@ -12,6 +12,7 @@ import pandas as pd
from doctest import testmod from doctest import testmod
from .filter_gene import filter_bed from .filter_gene import filter_bed
import warnings 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, 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, ...@@ -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 \ :param near_ctcf: True to recover exons near CTCF False to recover \
those far from CTCF those far from CTCF
""" """
if threshold < 0: threshold = max(threshold, 0)
threshold = 0
if threshold == 0: if threshold == 0:
location = "both" location = "both"
if not include0 and threshold == 0: if not include0 and threshold == 0:
...@@ -177,6 +177,13 @@ def create_bed_ctcf_exon(reg: str, threshold: int, ...@@ -177,6 +177,13 @@ def create_bed_ctcf_exon(reg: str, threshold: int,
f"{reg}_{i0}_gene.bed", f"{reg}_{i0}_gene.bed",
sep="\t", sep="\t",
index=False) 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__": if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment