Skip to content

Commit

Permalink
Updated a variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerAK committed Sep 15, 2024
1 parent f8b556c commit 58ec156
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 106 deletions.
12 changes: 6 additions & 6 deletions protzilla/data_analysis/time_series_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
def time_quant_plot(
intensity_df: pd.DataFrame,
metadata_df: pd.DataFrame,
time_column_name: str,
time_column: str,
protein_group: str,
similarity: float = 1.0,
similarity_measure: str = "euclidean distance",
Expand All @@ -33,7 +33,7 @@ def time_quant_plot(
:param intensity_df: A dataframe in protzilla wide format, where each row
represents a sample and each column represents a feature.
:param metadata_df: A dataframe containing the metadata of the samples.
:param time_column_name: The name of the column in the metadata_df that contains the time information.
:param time_column: The name of the column in the metadata_df that contains the time information.
:param protein_group: Protein IDs as the columnheader of the dataframe
:param similarity_measure: method to compare the chosen proteingroup with all others. The two
methods are "cosine similarity" and "euclidean distance".
Expand All @@ -44,13 +44,13 @@ def time_quant_plot(

intensity_df = pd.merge(
left=intensity_df,
right=metadata_df[["Sample", time_column_name]],
right=metadata_df[["Sample", time_column]],
on="Sample",
copy=False,
)

wide_df = intensity_df.interpolate(method='linear', axis=0)
wide_df = long_to_wide_time(wide_df, time_column_name=time_column_name) if is_long_format(wide_df, time_column_name=time_column_name) else wide_df
wide_df = long_to_wide_time(wide_df, time_column=time_column) if is_long_format(wide_df, time_column=time_column) else wide_df


if protein_group not in wide_df.columns:
Expand Down Expand Up @@ -166,14 +166,14 @@ def time_quant_plot(
yaxis_gridcolor=colors["gridcolor"],
xaxis_linecolor=colors["linecolor"],
yaxis_linecolor=colors["linecolor"],
xaxis_title=time_column_name,
xaxis_title=time_column,
yaxis_title="Intensity",
legend_title="Legend",
xaxis=dict(
tickmode="array",
tickangle=0,
tickvals=wide_df.index,
ticktext=[wide_df[time_column_name].unique() for wide_df[time_column_name] in wide_df.index],
ticktext=[wide_df[time_column].unique() for wide_df[time_column] in wide_df.index],
),
autosize=True,
margin=dict(l=100, r=300, t=100, b=100),
Expand Down
Loading

0 comments on commit 58ec156

Please sign in to comment.