diff --git a/src/gc_content/gc_content.py b/src/gc_content/gc_content.py index 35e025cf202b380efb48190e3dc3bdf74ae23879..5917249d3cfa160d25d27f676db3dbff6b7c02ff 100644 --- a/src/gc_content/gc_content.py +++ b/src/gc_content/gc_content.py @@ -117,7 +117,7 @@ def build_gc_dataframe(bed_content: List[List], dic_seq: Fasta, :param ft_name: A name corresponding to the feature of interest :return: a table containing the gc content of the intervals """ - dic = {"gc_content": [], "region": [], "location": []} + dic = {"gc_content": [], "region": [], "location": [], "id": []} for bed_line in bed_content: res = get_many_gc_content(bed_line, dic_seq, environment) @@ -125,6 +125,7 @@ def build_gc_dataframe(bed_content: List[List], dic_seq: Fasta, dic["gc_content"].append(res[k]) dic["location"].append(k.replace("interval", ft_name)) dic["region"].append(bed_line[6]) + dic["id"].append(bed_line[3]) return pd.DataFrame(dic) @@ -150,7 +151,9 @@ def make_gc_barplot(df: pd.DataFrame, outfile: Path, environment: int, p_vals = make_stat(df) if environment != 0: g = sns.catplot(x="location", y="gc_content", hue="region", data=df, - aspect=1.77, height=12, kind="violin") + aspect=1.77, height=12, kind="violin", + palette={"readthrough_ctcf": "orange", + "readthrough": "#13791C", "no_readthrough": "#B6B6B6"}) add_stat_annotation(g.ax, data=df, x="location", y="gc_content", hue="region", loc='inside',