Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#276: apply pre-commit end-of-file-fixer, trailing-whitespace, check… #282

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ current_version = 0.6.6
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
serialize =
serialize =
{major}.{minor}.{patch}-{release}{build}
{major}.{minor}.{patch}

Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ updates:
interval: "weekly"
target-branch: "developer"
labels:
- "pip dependencies"
- "pip dependencies"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ alphastats.egg-info
_build
build
dist
.coverage
.coverage
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ sphinx:
# Explicitly set the version of Python and its requirements
python:
install:
- requirements: docs/requirements_docs.txt
- requirements: docs/requirements_docs.txt
6 changes: 2 additions & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ message: "If you use this software, please cite both the article from preferred-
authors:
- family-names: Krismer
given-names: Elena
orcid:
orcid:
title: "AlphaPeptStats: an open-source Python package for automated and scalable statistical analysis of mass spectrometry-based proteomics "
version: 0.6.5
doi: "10.1093/bioinformatics/btad461"
Expand All @@ -17,13 +17,11 @@ preferred-citation:
- family-names: Bludau
given-names: Isabell
- family-names: Strauss
given-names: Maximilian T.
given-names: Maximilian T.
- family-names: Mann
given-names: Matthias
title: "AlphaPeptStats: an open-source Python package for automated and scalable statistical analysis of mass spectrometry-based proteomics"
type: article
year: 2023
doi: "10.1093/bioinformatics/btad461"
journal: "Bioinformatics"


2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

WORKDIR "/app/alphastats/gui"

ENTRYPOINT ["streamlit", "run", "AlphaPeptStats.py", "--server.port=8501", "--server.address=0.0.0.0"]
ENTRYPOINT ["streamlit", "run", "AlphaPeptStats.py", "--server.port=8501", "--server.address=0.0.0.0"]
21 changes: 3 additions & 18 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# 0.6.3
* ENH download metadata template in the GUI
* ENH multicova analysis
* ENH filter data completeness `dataset.preprocess(data_completeness=0.7)`
* ENH filter data completeness `dataset.preprocess(data_completeness=0.7)`
* ADD `GenericLoader` for not supported data formats

# 0.6.2
Expand Down Expand Up @@ -42,7 +42,7 @@

# 0.5.0
* ADD plot Sample Distribution Histogram
* ADD paired-ttest option
* ADD paired-ttest option
* ENH add option to remove samples in GUI
* ADD pyComBat Batch correction Behdenna A, Haziza J, Azencot CA and Nordor A. (2020) pyComBat, a Python tool for batch effects correction in high-throughput molecular data using empirical Bayes methods. bioRxiv doi: 10.1101/2020.03.17.995431
* remove iteration utilities, remove C++ dependency
Expand All @@ -67,7 +67,7 @@
* ADD functionionality `dataset.reset_preprocessing()` to reset all preprocessing steps

# 0.4.0
* SAM implementation from Isabel (MultiCova)
* SAM implementation from Isabel (MultiCova)
* Volcano Plot with permutation based FDR line
* Bug fix when reseting matrix and saving info

Expand Down Expand Up @@ -129,18 +129,3 @@
* remove dependency for Microsoft Visual Studio C++ (dash_bio) (Windows PCs)
* clustermap with seaborn, adding bar labels is possible
* save plotting data, preprocessing, method in figure object (accessible using figure.plotting_data, figure.method, figure.preprocessing)















14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,28 @@ An open-source Python package for downstream mass spectrometry downstream data a
## Citation
Publication: [AlphaPeptStats: an open-source Python package for automated and scalable statistical analysis of mass spectrometry-based proteomics](https://doi.org/10.1093/bioinformatics/btad461)
> **Citation:** <br>
> Krismer, E., Bludau, I., Strauss M. & Mann M. (2023). AlphaPeptStats: an open-source Python package for automated and scalable statistical analysis of mass spectrometry-based proteomics. Bioinformatics
> Krismer, E., Bludau, I., Strauss M. & Mann M. (2023). AlphaPeptStats: an open-source Python package for automated and scalable statistical analysis of mass spectrometry-based proteomics. Bioinformatics
> https://doi.org/10.1093/bioinformatics/btad461

---
## Installation

AlphaPeptStats can be used as
* python library (pip-installation), or
* Graphical User Interface (either pip-installation or one-click installer).
AlphaPeptStats can be used as
* python library (pip-installation), or
* Graphical User Interface (either pip-installation or one-click installer).

Further we provide a Dockerimage for the GUI.

### Pip Installation

AlphaStats can be installed in an existing Python 3.8/3.9/3.10 environment with a single `bash` command.
AlphaStats can be installed in an existing Python 3.8/3.9/3.10 environment with a single `bash` command.

```bash
pip install alphastats
```

In case you want to use the Graphical User Interface, use following command in the command line:

```bash
alphastats gui
```
Expand Down
6 changes: 3 additions & 3 deletions alphastats/DataSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ def __init__(self, loader, metadata_path=None, sample_column=None):
self.create_matrix()
self._check_matrix_values()
self.metadata = None

if metadata_path is not None:
self.sample = sample_column
self.load_metadata(file_path=metadata_path)
self._remove_misc_samples_in_metadata()

else:
self._create_metadata()

if self.loader == "Generic":
intensity_column = loader._extract_sample_names(metadata=self.metadata, sample_column=self.sample)
self.intensity_column = intensity_column
Expand Down Expand Up @@ -163,7 +163,7 @@ def create_matrix(self):
# remove Intensity so only sample names remain
substring_to_remove = regex_find_intensity_columns.replace(".*", "")
df.columns = df.columns.str.replace(substring_to_remove, "")

else:
df = df[self.intensity_column]
# transpose dataframe
Expand Down
6 changes: 3 additions & 3 deletions alphastats/DataSet_Plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def plot_umap(self, group: str = None, circle: bool = False):
)
return dimensionality_reduction.plot


@ignore_warning(RuntimeWarning)
def plot_volcano(
self,
Expand All @@ -134,7 +134,7 @@ def plot_volcano(
min_fc:float=1.0,
alpha:float=0.05,
draw_line:bool=True,
perm:int=100,
perm:int=100,
fdr:float=0.05,
compare_preprocessing_modes:bool=False,
color_list:list=[]
Expand Down Expand Up @@ -178,7 +178,7 @@ def plot_volcano(
min_fc=min_fc,
alpha=alpha,
draw_line=draw_line,
perm=perm,
perm=perm,
fdr=fdr,
color_list=color_list
)
Expand Down
20 changes: 9 additions & 11 deletions alphastats/DataSet_Statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _calculate_foldchange(self, mat_transpose:pd.DataFrame, group1_samples:list,
mat_transpose[group1_samples].T.mean().values
- mat_transpose[group2_samples].T.mean().values
)

else:
fc = (
mat_transpose[group1_samples].T.mean().values
Expand All @@ -32,7 +32,7 @@ def _calculate_foldchange(self, mat_transpose:pd.DataFrame, group1_samples:list,
fc = np.log2(fc)

return pd.DataFrame({"log2fc": fc, self.index_column: mat_transpose.index})

def _add_metadata_column(self, group1_list: list, group2_list: list):

# create new column in metadata with defined groups
Expand All @@ -55,7 +55,7 @@ def _add_metadata_column(self, group1_list: list, group2_list: list):
self.metadata = metadata

return column, "group1", "group2"

@ignore_warning(RuntimeWarning)
def diff_expression_analysis(
self,
Expand Down Expand Up @@ -89,11 +89,11 @@ def diff_expression_analysis(
* ``'ll'``: the log-likelihood of the estimation
"""
df = DifferentialExpressionAnalysis(
dataset=self,
group1=group1,
group2=group2,
dataset=self,
group1=group1,
group2=group2,
column=column, method=method,
perm=perm,
perm=perm,
fdr=fdr
).perform()
return df
Expand Down Expand Up @@ -160,7 +160,7 @@ def anova(self, column:str, protein_ids="all", tukey: bool=True) -> pd.DataFrame
* ``'A vs. B Tukey test'``: Tukey-HSD corrected p-values (each combination represents a column)
"""
return Anova(dataset=self, column=column, protein_ids=protein_ids, tukey=tukey).perform()


@lru_cache(maxsize=20)
def ancova(self, protein_id:str, covar: Union[str, list], between:str) -> pd.DataFrame:
Expand Down Expand Up @@ -211,7 +211,7 @@ def multicova_analysis(
Returns:
pd.DataFrame: Multicova Analysis results
"""

res, plot_list= MultiCovaAnalysis(
dataset=self,
covariates=covariates,
Expand All @@ -222,5 +222,3 @@ def multicova_analysis(
plot=True
).calculate()
return res, plot_list


Loading
Loading