Skip to content

Commit

Permalink
Merge pull request #375 from MannLabs/rename_modules
Browse files Browse the repository at this point in the history
Rename modules
  • Loading branch information
mschwoer authored Nov 19, 2024
2 parents 670ec10 + 868a2ac commit 13b67bf
Show file tree
Hide file tree
Showing 62 changed files with 1,333 additions and 146 deletions.
10 changes: 5 additions & 5 deletions alphastats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
import alphastats.gui # noqa: F401

from .cli import * # noqa: F403
from .loader.AlphaPeptLoader import * # noqa: F403
from .loader.DIANNLoader import * # noqa: F403
from .loader.FragPipeLoader import * # noqa: F403
from .loader.MaxQuantLoader import * # noqa: F403
from .loader.SpectronautLoader import * # noqa: F403
from .loader.alphapept_loader import * # noqa: F403
from .loader.diann_loader import * # noqa: F403
from .loader.fragpipe_loader import * # noqa: F403
from .loader.maxquant_loader import * # noqa: F403
from .loader.spectronaut_loader import * # noqa: F403
Empty file added alphastats/dataset/__init__.py
Empty file.
30 changes: 17 additions & 13 deletions alphastats/DataSet.py → alphastats/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@
import plotly
import scipy

from alphastats.dataset_factory import DataSetFactory
from alphastats.dataset_harmonizer import DataHarmonizer
from alphastats.DataSet_Plot import Plot
from alphastats.DataSet_Preprocess import Preprocess
from alphastats.DataSet_Statistics import Statistics
from alphastats.keys import Cols
from alphastats.loader.BaseLoader import BaseLoader
from alphastats.plots.ClusterMap import ClusterMap
from alphastats.plots.DimensionalityReduction import DimensionalityReduction
from alphastats.plots.IntensityPlot import IntensityPlot
from alphastats.plots.SampleHistogram import SampleHistogram
from alphastats.plots.VolcanoPlot import VolcanoPlot
from alphastats.dataset.factory import DataSetFactory
from alphastats.dataset.harmonizer import DataHarmonizer
from alphastats.dataset.keys import Cols
from alphastats.dataset.plotting import Plot
from alphastats.dataset.preprocessing import Preprocess
from alphastats.dataset.statistics import Statistics
from alphastats.dataset.utils import (
LoaderError,
check_for_missing_values,
ignore_warning,
)
from alphastats.loader.base_loader import BaseLoader
from alphastats.plots.clustermap import ClusterMap
from alphastats.plots.dimensionality_reduction import DimensionalityReduction
from alphastats.plots.intensity_plot import IntensityPlot
from alphastats.plots.sample_histogram import SampleHistogram
from alphastats.plots.volcano_plot import VolcanoPlot
from alphastats.statistics.tukey_test import tukey_test
from alphastats.utils import LoaderError, check_for_missing_values, ignore_warning

plotly.io.templates["alphastats_colors"] = plotly.graph_objects.layout.Template(
layout=plotly.graph_objects.Layout(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import numpy as np
import pandas as pd

from alphastats.dataset_harmonizer import DataHarmonizer
from alphastats.keys import Cols
from alphastats.dataset.harmonizer import DataHarmonizer
from alphastats.dataset.keys import Cols


class DataSetFactory:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import pandas as pd

from alphastats.keys import Cols
from alphastats.loader.BaseLoader import BaseLoader
from alphastats.dataset.keys import Cols
from alphastats.loader.base_loader import BaseLoader


class DataHarmonizer:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import plotly.express as px
import requests

from alphastats import AlphaPeptLoader
from alphastats.utils import check_if_df_empty, check_internetconnection
from alphastats.dataset.utils import check_if_df_empty, check_internetconnection
from alphastats.loader.alphapept_loader import AlphaPeptLoader


class enrichment_df(pd.DataFrame):
Expand Down
6 changes: 3 additions & 3 deletions alphastats/DataSet_Plot.py → alphastats/dataset/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import scipy
import seaborn as sns

from alphastats.keys import Cols
from alphastats.plots.PlotUtils import PlotUtils
from alphastats.utils import check_for_missing_values
from alphastats.dataset.keys import Cols
from alphastats.dataset.utils import check_for_missing_values
from alphastats.plots.plot_utils import PlotUtils


class plotly_object(plotly.graph_objs._figure.Figure):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import streamlit as st
from sklearn.experimental import enable_iterative_imputer # noqa

from alphastats.keys import Cols, ConstantsClass
from alphastats.utils import ignore_warning
from alphastats.dataset.keys import Cols, ConstantsClass
from alphastats.dataset.utils import ignore_warning


class PreprocessingStateKeys(metaclass=ConstantsClass):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import pandas as pd
import pingouin

from alphastats.keys import Cols
from alphastats.statistics.Anova import Anova
from alphastats.statistics.DifferentialExpressionAnalysis import (
from alphastats.dataset.keys import Cols
from alphastats.dataset.utils import ignore_warning
from alphastats.statistics.anova import Anova
from alphastats.statistics.differential_expression_analysis import (
DifferentialExpressionAnalysis,
)
from alphastats.statistics.MultiCovaAnalysis import MultiCovaAnalysis
from alphastats.utils import ignore_warning
from alphastats.statistics.multicova_analysis import MultiCovaAnalysis


class Statistics:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion alphastats/gui/pages/02_Import Data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import streamlit as st

from alphastats.DataSet import DataSet
from alphastats.dataset.dataset import DataSet
from alphastats.gui.utils.import_helper import (
load_example_data,
load_proteomics_data,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import streamlit as st

from alphastats.DataSet_Preprocess import PreprocessingStateKeys
from alphastats.dataset.preprocessing import PreprocessingStateKeys
from alphastats.gui.utils.preprocessing_helper import (
configure_preprocessing,
display_preprocessing_info,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions alphastats/gui/utils/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import pandas as pd
import streamlit as st

from alphastats.DataSet import DataSet
from alphastats.keys import Cols, ConstantsClass
from alphastats.plots.PlotUtils import PlotlyObject
from alphastats.plots.VolcanoPlot import VolcanoPlot
from alphastats.dataset.dataset import DataSet
from alphastats.dataset.keys import Cols, ConstantsClass
from alphastats.plots.plot_utils import PlotlyObject
from alphastats.plots.volcano_plot import VolcanoPlot


class PlottingOptions(metaclass=ConstantsClass):
Expand Down
2 changes: 1 addition & 1 deletion alphastats/gui/utils/analysis_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
StateKeys,
show_button_download_df,
)
from alphastats.plots.PlotUtils import PlotlyObject
from alphastats.plots.plot_utils import PlotlyObject


@st.fragment
Expand Down
5 changes: 3 additions & 2 deletions alphastats/gui/utils/import_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
import streamlit as st
from streamlit.runtime.uploaded_file_manager import UploadedFile

from alphastats.DataSet import DataSet
from alphastats.dataset.dataset import DataSet
from alphastats.gui.utils.options import SOFTWARE_OPTIONS
from alphastats.loader.MaxQuantLoader import BaseLoader, MaxQuantLoader
from alphastats.loader.base_loader import BaseLoader
from alphastats.loader.maxquant_loader import MaxQuantLoader


def load_proteomics_data(uploaded_file, intensity_column, index_column, software):
Expand Down
14 changes: 7 additions & 7 deletions alphastats/gui/utils/options.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from alphastats import SpectronautLoader
from alphastats.loader.AlphaPeptLoader import AlphaPeptLoader
from alphastats.loader.DIANNLoader import DIANNLoader
from alphastats.loader.FragPipeLoader import FragPipeLoader
from alphastats.loader.GenericLoader import GenericLoader
from alphastats.loader.MaxQuantLoader import MaxQuantLoader
from alphastats.loader.mzTabLoader import mzTabLoader
from alphastats.loader.alphapept_loader import AlphaPeptLoader
from alphastats.loader.diann_loader import DIANNLoader
from alphastats.loader.fragpipe_loader import FragPipeLoader
from alphastats.loader.generic_loader import GenericLoader
from alphastats.loader.maxquant_loader import MaxQuantLoader
from alphastats.loader.mztab_loader import mzTabLoader
from alphastats.loader.spectronaut_loader import SpectronautLoader

SOFTWARE_OPTIONS = {
"MaxQuant": {
Expand Down
2 changes: 1 addition & 1 deletion alphastats/gui/utils/overview_helper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pandas as pd
import streamlit as st

from alphastats.DataSet import DataSet
from alphastats.dataset.dataset import DataSet
from alphastats.gui.utils.ui_helper import StateKeys, show_button_download_df


Expand Down
4 changes: 2 additions & 2 deletions alphastats/gui/utils/preprocessing_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import streamlit as st
from st_cytoscape import cytoscape

from alphastats.DataSet import DataSet
from alphastats.keys import Cols
from alphastats.dataset.dataset import DataSet
from alphastats.dataset.keys import Cols

CYTOSCAPE_STYLESHEET = [
{
Expand Down
2 changes: 1 addition & 1 deletion alphastats/gui/utils/ui_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import streamlit as st

from alphastats import __version__
from alphastats.dataset.keys import ConstantsClass
from alphastats.gui.utils.preprocessing_helper import PREPROCESSING_STEPS
from alphastats.keys import ConstantsClass

# TODO add logo above the options when issue is closed
# https://github.com/streamlit/streamlit/issues/4984
Expand Down
2 changes: 1 addition & 1 deletion alphastats/llm/llm_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pandas as pd

from alphastats.DataSet import DataSet
from alphastats.dataset.dataset import DataSet
from alphastats.llm.enrichment_analysis import get_enrichment_data
from alphastats.llm.uniprot_utils import get_gene_function

Expand Down
2 changes: 1 addition & 1 deletion alphastats/llm/llm_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from openai import OpenAI
from openai.types.chat import ChatCompletion, ChatCompletionMessageToolCall

from alphastats.DataSet import DataSet
from alphastats.dataset.dataset import DataSet
from alphastats.llm.llm_functions import (
GENERAL_FUNCTION_MAPPING,
get_assistant_functions,
Expand Down
2 changes: 1 addition & 1 deletion alphastats/llm/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from openai.types.chat import ChatCompletionMessageToolCall

from alphastats.DataSet import DataSet
from alphastats.dataset.dataset import DataSet
from alphastats.llm.llm_utils import get_subgroups_for_each_group


Expand Down
22 changes: 0 additions & 22 deletions alphastats/load_data.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import pandas as pd

from alphastats.loader.BaseLoader import BaseLoader
from alphastats.loader.base_loader import BaseLoader


class AlphaPeptLoader(BaseLoader):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np
import pandas as pd

from alphastats.utils import find_duplicates_in_list
from alphastats.dataset.utils import find_duplicates_in_list

if sys.version_info >= (3, 9):
import importlib.resources as importlib_resources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from alphastats.loader.BaseLoader import BaseLoader
from alphastats.loader.base_loader import BaseLoader


class DIANNLoader(BaseLoader):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pandas as pd

from alphastats.loader.BaseLoader import BaseLoader
from alphastats.loader.base_loader import BaseLoader


# Philosopher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pandas as pd

from alphastats.loader.BaseLoader import BaseLoader
from alphastats.loader.base_loader import BaseLoader


class GenericLoader(BaseLoader):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import pandas as pd

from alphastats.loader.BaseLoader import BaseLoader
from alphastats.loader.base_loader import BaseLoader


class MaxQuantLoader(BaseLoader):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pyteomics import mztab

from alphastats.loader.BaseLoader import BaseLoader
from alphastats.loader.base_loader import BaseLoader


class mzTabLoader(BaseLoader):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np
import pandas as pd

from alphastats.loader.BaseLoader import BaseLoader
from alphastats.loader.base_loader import BaseLoader

SPECTRONAUT_COLUMN_DELIM = "."

Expand Down
2 changes: 1 addition & 1 deletion alphastats/multicova/multicova.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from sklearn.preprocessing import StandardScaler
from statsmodels.stats.multitest import multipletests

from alphastats.keys import Cols
from alphastats.dataset.keys import Cols

# code taken from Isabel Bludau - multicova

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import pandas as pd
import seaborn as sns

from alphastats.DataSet_Statistics import Statistics
from alphastats.keys import Cols
from alphastats.plots.PlotUtils import PlotUtils
from alphastats.dataset.keys import Cols
from alphastats.dataset.statistics import Statistics
from alphastats.plots.plot_utils import PlotUtils


class ClusterMap(PlotUtils):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import plotly.graph_objects as go
import sklearn

from alphastats.DataSet_Preprocess import Preprocess
from alphastats.keys import Cols
from alphastats.plots.PlotUtils import PlotlyObject, PlotUtils
from alphastats.dataset.keys import Cols
from alphastats.dataset.preprocessing import Preprocess
from alphastats.plots.plot_utils import PlotlyObject, PlotUtils

# make own alphastats theme
plotly.io.templates["alphastats_colors"] = plotly.graph_objects.layout.Template(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import plotly.graph_objects as go
import scipy

from alphastats.keys import Cols
from alphastats.plots.PlotUtils import PlotlyObject, PlotUtils
from alphastats.dataset.keys import Cols
from alphastats.plots.plot_utils import PlotlyObject, PlotUtils

plotly.io.templates["alphastats_colors"] = plotly.graph_objects.layout.Template(
layout=plotly.graph_objects.Layout(
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 13b67bf

Please sign in to comment.