Skip to content
Snippets Groups Projects
Commit 0396538f authored by nfontrod's avatar nfontrod
Browse files

src/find_interaction_cluster/sf_and_communities.py: fix get_stat4communities...

src/find_interaction_cluster/sf_and_communities.py: fix get_stat4communities to keep the same community names
parent 55ea1762
No related branches found
No related tags found
No related merge requests found
......@@ -151,7 +151,7 @@ def get_stat4communities(sf_name: str, reg: str,
result = ConfigGraph.get_community_file(project, weight, global_weight,
same_gene,
"_communities.txt")
communities = get_communities(result, 49)
communities = get_communities(result, 0)
regulated_dic, number = get_every_events_4_a_sl(cnx, sf_name, reg)
reg_exons = regulated_dic[sf_name + "_" + reg]
d = {"community": [], "reg_in_community": [], "community_size": [],
......@@ -161,7 +161,7 @@ def get_stat4communities(sf_name: str, reg: str,
if len(community) > 49:
reg_community, tot_commmunity, prop = \
get_exon_regulated_in_communities(community, reg_exons)
d["community"].append(f"C{k}")
d["community"].append(f"C{k + 1}")
d['reg_in_community'].append(reg_community)
d['community_size'].append(tot_commmunity)
d['%reg in community'].append(prop)
......@@ -169,9 +169,9 @@ def get_stat4communities(sf_name: str, reg: str,
n2, t2))
d['padj'] = [np.nan, np.nan] + list(multipletests(d['pval'][2:],
method='fdr_bh')[1])
d['sf'] = [sf_name] * (len(communities) + 2)
d['reg'] = [reg] * (len(communities) + 2)
d['project'] = [project] * (len(communities) + 2)
d['sf'] = [sf_name] * len(d["community"])
d['reg'] = [reg] * len(d["community"])
d['project'] = [project] * len(d["community"])
return pd.DataFrame(d)
......
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