Commit 56acd6e8 authored by nfontrod's avatar nfontrod
Browse files

src/gc_content/gc_content.py: add an id column in the table returned by...

src/gc_content/gc_content.py: add an id column in the table returned  by build_gc_dataframe, change bar colors in make_gc_barplot function
parent f9586e0f
......@@ -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',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment