Skip to content
Snippets Groups Projects
Commit 79bc5594 authored by nfontrod's avatar nfontrod
Browse files

src/nt_composition/make_nt_correlation.py: add a distance parameter into...

src/nt_composition/make_nt_correlation.py: add a distance parameter into get_project_colocalisation function to recover only interaction far from at least 10kb
parent a0eb0659
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,7 @@ def get_project_colocalisation(cnx: sqlite3.Connection, project: str, ...@@ -61,7 +61,7 @@ def get_project_colocalisation(cnx: sqlite3.Connection, project: str,
global_weight: int, same_gene: bool, global_weight: int, same_gene: bool,
get_weight: bool = False, get_weight: bool = False,
exon_bc: Optional[np.array] = None, exon_bc: Optional[np.array] = None,
inter_chr: bool = False, inter_chr: bool = False, distance: int = 10000,
level: str = "exon") -> np.array: level: str = "exon") -> np.array:
""" """
Get the interactions in project `project` for gene and exons Get the interactions in project `project` for gene and exons
...@@ -84,8 +84,11 @@ def get_project_colocalisation(cnx: sqlite3.Connection, project: str, ...@@ -84,8 +84,11 @@ def get_project_colocalisation(cnx: sqlite3.Connection, project: str,
""" """
logging.debug(f'Recovering interaction ({os.getpid()})') logging.debug(f'Recovering interaction ({os.getpid()})')
select_add = get_select_addition(global_weight, get_weight, same_gene) select_add = get_select_addition(global_weight, get_weight, same_gene)
inter_str = " AND level = 'inter'" if inter_chr else "" inter_str = " AND level = 'inter'" \
inter_str_t = " AND t1.level = 'inter'" if inter_chr else "" if inter_chr else f"AND (level = 'inter' OR distance >= {distance})"
inter_str_t = " AND t1.level = 'inter'" \
if inter_chr \
else f"AND (t1.level = 'inter' OR t1.distance >= {distance})"
if level == "gene" and not same_gene: if level == "gene" and not same_gene:
logging.warning(f"When level is equal to gene then same_gene must " logging.warning(f"When level is equal to gene then same_gene must "
f"be true. Setting it to True.") f"be true. Setting it to True.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment