diff --git a/src/nt_composition/__main__.py b/src/nt_composition/__main__.py index 72e99bbc3c22e8de467f9686b467009d397de89b..8948a419cae14906965339c7d97260551c1f709e 100644 --- a/src/nt_composition/__main__.py +++ b/src/nt_composition/__main__.py @@ -14,14 +14,14 @@ from .get_projects_interaction import get_interactions_number import lazyparser as lp -@lp.flag(same_gene=True) +@lp.flag(same_gene=True, inter_chr=True) @lp.parse(weight='weight > 0', ft_type=['nt', 'dnt', 'tnt', 'codon', 'aa', 'properties'], kind=["density", "distance"]) def launcher(weight: int = 1, global_weight: int = 0, ft_type: str = 'nt', same_gene: bool = False, compute_mean: bool = True, iteration: int = 10000, kind: str = 'density', - community_size: int = -1, + community_size: int = -1, inter_chr: bool = False, logging_level: str = "DISABLE"): """ Launch the creation of density file. @@ -44,21 +44,23 @@ def launcher(weight: int = 1, global_weight: int = 0, ft_type: str = 'nt', frequency of the same feature for other co-localized exons. 'distance' \ to check if the frequencies of co-localized exon are closer than \ randomly expected. (default : 'density').* - :param community_size: consider only exons within communities bigger + :param community_size: consider only exons within communities bigger \ than community size. if community_size = -1. This option is deactivated. + :param inter_chr: True to only get inter-chromosomal interactions \ + False else (default: False) :param logging_level: The level of data to display (default 'DISABLE') """ - get_interactions_number(weight, same_gene, logging_level) + get_interactions_number(weight, same_gene, inter_chr, logging_level) if community_size == -1: community_size = None if kind == "density": create_all_frequency_figures(ConfigNt.cpu, weight, global_weight, ft_type, same_gene, compute_mean, - community_size, + community_size, inter_chr, logging_level) else: create_all_distance_figures(ConfigNt.cpu, weight, global_weight, - ft_type, same_gene, iteration, + ft_type, same_gene, iteration, inter_chr, logging_level) diff --git a/src/nt_composition/config.py b/src/nt_composition/config.py index 8dc88e86ae8954ff51d879f6f0bbc039e10c7f61..a7a222d43a53683b4c2e29579ce1644fcc86cdb8 100644 --- a/src/nt_composition/config.py +++ b/src/nt_composition/config.py @@ -14,7 +14,7 @@ from ..find_interaction_cluster.config import ConfigGraph def get_weight_folder(weight: int, global_weight: int, ft_type: str, - community_size: Optional[int]): + community_size: Optional[int], inter_chr: bool): """ Get the weight folder. @@ -25,20 +25,23 @@ def get_weight_folder(weight: int, global_weight: int, ft_type: str, seen in `global_weight` project are taken into account :parma ft_type: The type fo featrue of interst :param community_size: The minimum size of communities we want to consider + :param inter_chr: True to only get inter-chromosomal interactions \ + False else :return: The folder that will contains the interaction with a weight \ greater or equal to `weigh` in ChIA-PET projects """ + inter_str = "_inter-chromosmal" if inter_chr else "" if community_size is None: c = '' else: c = f'_community_size_gte_{community_size}' if global_weight == 0: weight_folder = ConfigNt.density_folder / \ - f"{ft_type}_project_weight-{weight}{c}" + f"{ft_type}_project_weight-{weight}{c}{inter_str}" else: weight_folder = ConfigNt.density_folder / \ f"{ft_type}_weight-{weight}_" \ - f"global_weight-{global_weight}{c}" + f"global_weight-{global_weight}{c}{inter_str}" weight_folder.mkdir(parents=True, exist_ok=True) return weight_folder @@ -46,7 +49,8 @@ def get_weight_folder(weight: int, global_weight: int, ft_type: str, def get_density_file(weight: int, global_weight: int, project: str, ft_type: str, ft: str, fig: bool = False, kind: str = 'density', - community_size: Optional[int] = None): + community_size: Optional[int] = None, + inter_chr: bool = False): """ Get the filename that will contain the density data or figure. @@ -61,6 +65,8 @@ def get_density_file(weight: int, global_weight: int, project: str, :param fig: Say if the result file is a figure or not :param kind: The kind of the figure :param community_size: The minimum size of communities we want to consider + :param inter_chr: True to only get inter-chromosomal interactions \ + False else :return: The filename that will contain the density data or figure. """ if fig: @@ -68,14 +74,15 @@ def get_density_file(weight: int, global_weight: int, project: str, else: ext = "txt" res_folder = get_weight_folder(weight, global_weight, ft_type, - community_size) / project + community_size, inter_chr) / project res_folder.mkdir(exist_ok=True, parents=True) return res_folder / f"{project}_{ft_type}_{ft}_{kind}.{ext}" def get_density_recap(weight: int, global_weight: int, ft_type: str, ft: str, fig: bool = False, - community_size: Optional[int] = False): + community_size: Optional[int] = False, + inter_chr: bool = False): """ Get the density correlation recap file. @@ -88,6 +95,8 @@ def get_density_recap(weight: int, global_weight: int, :param ft: A feature :param fig: Say if the result file is a figure or not :param community_size: The minimum size of communities we want to consider + :param inter_chr: True to only get inter-chromosomal interactions \ + False else :return: """ if fig: @@ -95,22 +104,29 @@ def get_density_recap(weight: int, global_weight: int, else: ext = "txt" outfolder = get_weight_folder(weight, global_weight, ft_type, - community_size) + community_size, inter_chr) outfolder.mkdir(exist_ok=True, parents=True) return outfolder / f"{ft_type}_{ft}_density_recap.{ext}" -def get_interaction_file(weight: int): +def get_interaction_file(weight: int, same_gene: bool, inter_chr: bool): """ Return the interaction file : coresponding to the file containing \ iteraction with a weight greater or eaqual to `weight` :param weight: minimum weight of interaction to \ concider + :param same_gene: Say if we are considering interaction within the same \ + gene + :param inter_chr: True to only get inter-chromosomal interactions \ + False else :return: The interaction filename """ + same_str = "_same_gene_allowed" if same_gene else "" + inter_str = "inter-chromosmal_" if inter_chr else "" return ConfigNt.interaction / \ - f"interaction_number_weight>={weight}_by_project.txt" + f"{inter_str}interaction_number_weight>={weight}_by_project" \ + f"{same_str}.txt" def get_features(ft_type: str) -> List[str]: diff --git a/src/nt_composition/distance.py b/src/nt_composition/distance.py index 83aa3fcf67bd91f9919d18637affd3cbd8b148b5..5ec3ebdbc1b0695e8f98cfcd80c5a3ed9a9b5e40 100644 --- a/src/nt_composition/distance.py +++ b/src/nt_composition/distance.py @@ -254,7 +254,7 @@ def create_distance_figure(df: pd.DataFrame, project: str, figfile: Path, def create_figures(ft: str, ft_type: str, project: str, weight: int, global_weight: int, - same_gene: bool, iteration: int, + same_gene: bool, iteration: int, inter_chr: bool = False, logging_level: str = "DISABLE" ) -> None: """ @@ -271,24 +271,29 @@ def create_figures(ft: str, ft_type: str, seen in `global_weight` project are taken into account :param same_gene: Say if we consider as co-localised exon within the \ same gene + :param inter_chr: True to only get inter-chromosomal interactions \ + False else :param logging_level: The level of information to display :param iteration: The number of iteration """ logging_def(ConfigNt.interaction, __file__, logging_level) outfile = ConfigNt.get_density_file(weight, global_weight, project, ft_type, ft, fig=False, - kind="distance") + kind="distance", + inter_chr=inter_chr) if not outfile.is_file(): cnx = sqlite3.connect(ConfigNt.db_file) arr_interaction = get_project_colocalisation(cnx, project, weight, - global_weight, same_gene) + global_weight, same_gene, + inter_chr=inter_chr) dic_freq = get_frequency_dic(cnx, ft, ft_type) df = create_distance_table(arr_interaction, dic_freq, project, iteration, ft, ft_type) df.to_csv(outfile, sep="\t", index=False) figfile = ConfigNt.get_density_file(weight, global_weight, project, ft_type, ft, fig=True, - kind="distance") + kind="distance", + inter_chr=inter_chr) create_distance_figure(df, project, figfile, ft, iteration) @@ -296,7 +301,8 @@ def execute_density_figure_function(project: str, ft_type: str, ft: str, weight: int, global_weight: int, same_gene: bool, - iteration: int) -> None: + iteration: int, + inter_chr: bool = False) -> None: """ Execute create_density_figure and organized the results in a dictionary. @@ -312,16 +318,19 @@ def execute_density_figure_function(project: str, same gene :param iteration: The number of iteration of interest to create \ the control set. + :param inter_chr: True to only get inter-chromosomal interactions \ + False else """ logging.info(f'Working on {project}, {ft_type}, {ft} - {os.getpid()}') create_figures(ft, ft_type, project, weight, - global_weight, same_gene, iteration) + global_weight, same_gene, iteration, inter_chr) def create_all_distance_figures(ps: int, weight: int = 1, global_weight: int = 0, ft_type: str = "nt", same_gene: bool = True, iteration: int = 10000, + inter_chr: bool = False, logging_level: str = "DISABLE"): """ Make density figure for every selected projects. @@ -336,6 +345,8 @@ def create_all_distance_figures(ps: int, weight: int = 1, :param same_gene: Say if we consider as co-localised exon within the \ same gene :param iteration: Number of iteration for control exons + :param inter_chr: True to only get inter-chromosomal interactions \ + False else :param ps: The number of processes to create """ logging_def(ConfigNt.interaction, __file__, logging_level) @@ -349,7 +360,7 @@ def create_all_distance_figures(ps: int, weight: int = 1, processes = [] for project, ft, ft_type in param: args = [project, ft_type, ft, weight, global_weight, same_gene, - iteration] + iteration, inter_chr] processes.append(pool.apply_async(execute_density_figure_function, args)) for proc in processes: diff --git a/src/nt_composition/get_projects_interaction.py b/src/nt_composition/get_projects_interaction.py index f9dbc9dfedfad312bd320f1141fe9669af4535ba..002446d8c3137635b733e587b3d2fa6104d86092 100644 --- a/src/nt_composition/get_projects_interaction.py +++ b/src/nt_composition/get_projects_interaction.py @@ -22,7 +22,8 @@ import logging def get_interaction_by_project(cnx: sqlite3.Connection, weight: int, - same_gene: bool) -> pd.DataFrame: + same_gene: bool, + inter_chr: bool = False) -> pd.DataFrame: """ Get the number of interactions by projects. @@ -30,13 +31,18 @@ def get_interaction_by_project(cnx: sqlite3.Connection, weight: int, :param weight: A weight threshold :param same_gene: Say if we are considering interaction within the same \ gene + :param inter_chr: True to only get inter-chromosomal interactions \ + False else :return: The table containing the number of interaction by projects """ logging.debug('Getting interaction from database') + inter_str = " AND level = 'inter'" if inter_chr else "" + inter_str_t = " AND t1.level = 'inter'" if inter_chr else "" if same_gene: query = f"SELECT id_project, COUNT(*) " \ f"FROM cin_exon_interaction " \ f"WHERE weight >= {weight} " \ + f"{inter_str} " \ f"GROUP BY id_project" else: query = f"""SELECT id_project, COUNT(*) @@ -45,6 +51,7 @@ def get_interaction_by_project(cnx: sqlite3.Connection, weight: int, AND t1.exon1 = t2.id AND t1.exon2 = t3.id AND t2.id_gene != t3.id_gene + {inter_str_t} GROUP BY id_project""" df = pd.read_sql_query(query, cnx) df.columns = ['projects', 'interaction_count'] @@ -53,13 +60,18 @@ def get_interaction_by_project(cnx: sqlite3.Connection, weight: int, return df -def make_barplot(df: pd.DataFrame, weight: int): +def make_barplot(df: pd.DataFrame, weight: int, + same_gene: bool, inter_chr: bool): """ Make a barplot displaying the number of interactions for every project. :param weight: The minimum weight of interaction to concidere them :param df: The dataframe containing the number of interaction by \ projects + :param same_gene: Say if we are considering interaction within the same \ + gene + :param inter_chr: True to only get inter-chromosomal interactions \ + False else """ logging.debug("Creating barplot figure") ConfigNt.interaction.mkdir(parents=True, exist_ok=True) @@ -68,7 +80,7 @@ def make_barplot(df: pd.DataFrame, weight: int): plt.figure(figsize=(20, 12)) sns.barplot(x="projects", y="interaction_count", data=df) plt.xticks(rotation=90) - outfile = ConfigNt.get_interaction_file(weight) + outfile = ConfigNt.get_interaction_file(weight, same_gene, inter_chr) plt.savefig(outfile.parent / outfile.name.replace('txt', 'pdf'), bbox_inches='tight') plt.close() @@ -91,6 +103,7 @@ def select_projects(df: pd.DataFrame): def get_interactions_number(weight: int = 1, same_gene: bool = False, + inter_chr: bool = False, logging_level: str = "DISABLE"): """ Get the number of interaction by projects @@ -98,13 +111,15 @@ def get_interactions_number(weight: int = 1, same_gene: bool = False, :param weight: The minimum weight of correlation to consider them :param same_gene: Say if we are considering interaction within the same \ gene + :param inter_chr: True to only get inter-chromosomal interactions \ + False else """ logging_def(ConfigNt.interaction, __file__, logging_level) logging.info(f'Recovering interaction count with a weight of {weight}') cnx = sqlite3.connect(ConfigNt.db_file) - df = get_interaction_by_project(cnx, weight, same_gene) - make_barplot(df, weight) - df.to_csv(ConfigNt.get_interaction_file(weight), + df = get_interaction_by_project(cnx, weight, same_gene, inter_chr) + make_barplot(df, weight, same_gene, inter_chr) + df.to_csv(ConfigNt.get_interaction_file(weight, same_gene, inter_chr), sep="\t", index=False) sns.barplot() select_projects(df) diff --git a/src/nt_composition/make_nt_correlation.py b/src/nt_composition/make_nt_correlation.py index ef7ceb8b372371c9b417a52cdf35d3f115b045b0..2c94056cbc7644dbf17fe1ae6c1d66f8b700813b 100644 --- a/src/nt_composition/make_nt_correlation.py +++ b/src/nt_composition/make_nt_correlation.py @@ -47,11 +47,11 @@ def get_select_addition(global_weight: int, get_weight: bool, same_gene: bool): if get_weight: if global_weight == 0 and same_gene: return ', weight' - elif global_weight == 0 and not same_gene: + elif global_weight == 0: return ', t1.weight' elif global_weight >= 0 and same_gene: return ', ROUND(AVG(weight), 2)' - elif global_weight >= 0 and not same_gene: + elif global_weight >= 0: return ', ROUND(AVG(t1.weight), 2)' return '' @@ -60,7 +60,8 @@ def get_project_colocalisation(cnx: sqlite3.Connection, project: str, weight: int, global_weight: int, same_gene: bool, get_weight: bool = False, - exon_bc: Optional[np.array] = None) -> np.array: + exon_bc: Optional[np.array] = None, + inter_chr: bool = False) -> np.array: """ Get the interactions in project `project` @@ -75,13 +76,16 @@ def get_project_colocalisation(cnx: sqlite3.Connection, project: str, :param same_gene: Say if we consider as co-localised exon within the \ same gene :param exon_bc: exons in big communities + :param inter_chr: True to only get inter-chromosomal interactions \ + False else :return: The table containing the number of interaction by projects """ logging.debug(f'Recovering interaction ({os.getpid()})') select_add = get_select_addition(global_weight, get_weight, same_gene) + inter_str = " AND level = 'inter'" if inter_chr else "" + inter_str_t = " AND t1.level = 'inter'" if inter_chr else "" if exon_bc is None: - filter_exons = '' - filter_exons_t = filter_exons + filter_exons = filter_exons_t = '' else: tmp = tuple(exon_bc) filter_exons = f' AND exon1 IN {tmp} AND exon2 IN {tmp}' @@ -91,7 +95,9 @@ def get_project_colocalisation(cnx: sqlite3.Connection, project: str, query = f"SELECT exon1, exon2{select_add} " \ "FROM cin_exon_interaction " \ f"WHERE weight >= {weight} " \ - f"AND id_project = '{project}'" + filter_exons + f"AND id_project = '{project}'" \ + + filter_exons \ + + inter_str else: query = f"""SELECT t1.exon1, t1.exon2{select_add} FROM cin_exon_interaction t1, cin_exon t2, cin_exon t3 @@ -99,15 +105,18 @@ def get_project_colocalisation(cnx: sqlite3.Connection, project: str, AND id_project = '{project}' AND t1.exon1 = t2.id AND t1.exon2 = t3.id - AND t2.id_gene != t3.id_gene""" + filter_exons_t + AND t2.id_gene != t3.id_gene""" \ + + filter_exons_t \ + + inter_str_t else: good_projects = tuple(ConfigNt.good_projects) if same_gene: query = f"SELECT exon1, exon2{select_add} " \ f"FROM cin_exon_interaction " \ f"WHERE weight >= {weight} " \ - f"AND id_project IN {good_projects}" \ - f"{filter_exons}" \ + f"AND id_project IN {good_projects} " \ + f"{filter_exons} " \ + f"{inter_str} " \ f"GROUP BY exon1, exon2 " \ f"HAVING COUNT(*) >= {global_weight}" else: @@ -119,6 +128,7 @@ def get_project_colocalisation(cnx: sqlite3.Connection, project: str, AND t2.id_gene != t3.id_gene AND t1.id_project IN {good_projects} {filter_exons_t} + {inter_str_t} GROUP BY exon1, exon2 HAVING COUNT(*) >= {global_weight}""" @@ -258,7 +268,8 @@ def create_density_table(arr_interaction: np.array, dic_freq: Dict[str, float], def create_density_fig(df: pd.DataFrame, project: str, ft_type: str, ft: str, weight: int, global_weight: int, - community_size: Optional[int]) -> Tuple[float, float]: + community_size: Optional[int], + inter_chr: bool) -> Tuple[float, float]: """ Compute a density file showing if the feature frequency of \ an exons correlates with the frequency in other co-localised exons. @@ -274,6 +285,8 @@ def create_density_fig(df: pd.DataFrame, project: str, ft_type: str, ft: str, the global weight is equal to 0 then then density figure are calculated \ by project, else all projet are merge together and the interaction \ seen in `global_weight` project are taken into account + :param inter_chr: True to only get inter-chromosomal interactions \ + False else :return: The correlation and the p-value """ logging.debug('Creating the density figure') @@ -290,11 +303,15 @@ def create_density_fig(df: pd.DataFrame, project: str, ft_type: str, ft: str, plt.legend() plt.xlabel(f"Freq of {ft} in an exon") plt.ylabel(f"Freq of {ft} in co-localized exons") - plt.title(f'Freq of {ft} of exons and their co-localized partner in ' - f'{project}') + title = f'Freq of {ft} of exons and their co-localized partner in ' \ + f'{project}' + if inter_chr: + title += '\n(inter chromosomal interactions)' + plt.title(title) plt.savefig(ConfigNt.get_density_file(weight, global_weight, project, ft_type, ft, fig=True, - community_size=community_size)) + community_size=community_size, + inter_chr=inter_chr)) plt.close() return r, p @@ -303,6 +320,7 @@ def create_density_figure(nt: str, ft_type: str, project: str, weight: int, global_weight: int, same_gene: bool, compute_mean: bool, community_size: Optional[int], + inter_chr: bool = False, logging_level: str = "DISABLE" ) -> Tuple[float, float]: """ @@ -323,13 +341,16 @@ def create_density_figure(nt: str, ft_type: str, exons, false to only compute the frequency of one co-localized exons. :param community_size: The size of the community to consider in the \ analysis. + :param inter_chr: True to only get inter-chromosomal interactions \ + False else :param logging_level: The level of information to display :return: The correlation and the p-value """ logging_def(ConfigNt.interaction, __file__, logging_level) outfile = ConfigNt.get_density_file(weight, global_weight, project, ft_type, nt, fig=False, - community_size=community_size) + community_size=community_size, + inter_chr=inter_chr) if not outfile.is_file(): exons_bc = recover_exon_in_big_communities(community_size, project, weight, @@ -337,12 +358,13 @@ def create_density_figure(nt: str, ft_type: str, cnx = sqlite3.connect(ConfigNt.db_file) arr_interaction = get_project_colocalisation(cnx, project, weight, global_weight, same_gene, - False, exons_bc) + False, exons_bc, + inter_chr) dic_freq = get_frequency_dic(cnx, nt, ft_type) df = create_density_table(arr_interaction, dic_freq, compute_mean) df.to_csv(outfile, sep="\t", index=False) r, p = create_density_fig(df, project, ft_type, nt, weight, - global_weight, community_size) + global_weight, community_size, inter_chr) else: logging.debug(f'The file {outfile} exist, recovering data ' f'({os.getpid()})') @@ -353,7 +375,8 @@ def create_density_figure(nt: str, ft_type: str, def create_scatterplot(df_cor: pd.DataFrame, ft_type: str, ft: str, weight: int, global_weight: int, - community_size: Optional[int]): + community_size: Optional[int], + inter_chr: bool): """ Create a scatterplot showing the R-value according to the \ number of interaction. @@ -366,6 +389,8 @@ def create_scatterplot(df_cor: pd.DataFrame, ft_type: str, ft: str, the global weight is equal to 0 then then density figure are calculated \ by project, else all projet are merge together and the interaction \ seen in `global_weight` project are taken into account + :param inter_chr: True to only get inter-chromosomal interactions \ + False else """ sns.set() sns.set_context('talk') @@ -381,11 +406,15 @@ def create_scatterplot(df_cor: pd.DataFrame, ft_type: str, ft: str, df_cor.project.values[i], fontsize=8) plt.xlabel(f"Correlation for {ft} ({ft_type}) in project") plt.ylabel("Number of total interaction in projects") - plt.title(f'Project correlation for {ft} ({ft_type}) ' - f'according to the number of interaction in projects') + title = f'Project correlation for {ft} ({ft_type}) ' \ + f'according to the number of interaction in projects' + if inter_chr: + title += "\n(inter-chromosmal interactions)" + plt.title(title) plt.savefig(ConfigNt.get_density_recap(weight, global_weight, ft_type, ft, fig=True, - community_size=community_size)) + community_size=community_size, + inter_chr=inter_chr)) plt.close() @@ -394,7 +423,9 @@ def execute_density_figure_function(di: pd.DataFrame, project : str, global_weight: int, same_gene: bool, compute_mean: bool, - community_size: Optional[int]) -> Dict[str, Any]: + community_size: Optional[int], + inter_chr: bool = False + ) -> Dict[str, Any]: """ Execute create_density_figure and organized the results in a dictionary. @@ -413,12 +444,14 @@ def execute_density_figure_function(di: pd.DataFrame, project : str, exons, false to only compute the frequency of one co-localized exons. :param community_size: he size of the community to consider in the \ analysis. + :param inter_chr: True to only get inter-chromosomal interactions \ + False else :return: """ logging.info(f'Working on {project}, {ft_type}, {ft} - {os.getpid()}') r, p = create_density_figure(ft, ft_type, project, weight, global_weight, same_gene, compute_mean, - community_size) + community_size, inter_chr) if global_weight == 0: tmp = {"project": project, "ft_type": ft_type, "ft": ft, "cor": r, "pval": p, @@ -482,6 +515,7 @@ def create_all_frequency_figures(ps: int, weight: int = 1, global_weight: int = 0, ft_type: str = "nt", same_gene = True, compute_mean: bool = True, community_size: Optional[int] = None, + inter_chr: bool = False, logging_level: str = "DISABLE"): """ Make density figure for every selected projects. @@ -500,10 +534,13 @@ def create_all_frequency_figures(ps: int, weight: int = 1, :param community_size: The size of the community to consider in the \ analysis. :param ps: The number of processes to create + :param inter_chr: True to only get inter-chromosomal interactions \ + False else """ logging_def(ConfigNt.interaction, __file__, logging_level) if global_weight == 0: - di = pd.read_csv(ConfigNt.get_interaction_file(weight), sep="\t") + di = pd.read_csv(ConfigNt.get_interaction_file(weight, same_gene, + inter_chr), sep="\t") projects = ConfigNt.good_projects else: di = pd.DataFrame() @@ -514,22 +551,21 @@ def create_all_frequency_figures(ps: int, weight: int = 1, processes = [] for project, ft, ft_type in param: args = [di, project, ft_type, ft, weight, global_weight, same_gene, - compute_mean, community_size] + compute_mean, community_size, inter_chr] processes.append(pool.apply_async(execute_density_figure_function, args)) - results = [] - for proc in processes: - results.append(proc.get(timeout=None)) + results = [proc.get(timeout=None) for proc in processes] dic = combine_dic(results) df_corr = pd.DataFrame(dic) df_corr.to_csv(ConfigNt.get_density_recap(weight, global_weight, ft_type, 'ALL', fig=False, - community_size=community_size), + community_size=community_size, + inter_chr=inter_chr), sep="\t") if global_weight == 0: for ft in ft_list: create_scatterplot(df_corr, ft_type, ft, weight, global_weight, - community_size) + community_size, inter_chr) if __name__ == "__main__":