diff --git a/.gitignore b/.gitignore index 9f8b06e..f1749e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ quantmsio.egg-info dist build -.idea \ No newline at end of file +.idea +data \ No newline at end of file diff --git a/README.md b/README.md index 93cf740..fb72315 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # quantms.io [![Python application](https://github.com/bigbio/quantms.io/actions/workflows/python-app.yml/badge.svg?branch=dev)](https://github.com/bigbio/quantms.io/actions/workflows/python-app.yml) +[![Upload Python Package](https://github.com/bigbio/quantms.io/actions/workflows/python-publish.yml/badge.svg)](https://github.com/bigbio/quantms.io/actions/workflows/python-publish.yml) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/e71a662e8d4f483094576c1d8f8888c3)](https://app.codacy.com/gh/bigbio/quantms.io/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) +[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/e71a662e8d4f483094576c1d8f8888c3)](https://app.codacy.com/gh/bigbio/quantms.io/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_Coverage) +[![Documentation Status](https://readthedocs.org/projects/quantmsio/badge/?version=latest)](https://quantmsio.readthedocs.io/en/latest/?badge=latest) +[![PyPI version](https://badge.fury.io/py/quantmsio.svg)](https://badge.fury.io/py/quantmsio) [quantms](https://docs.quantms.org) is a nf-core pipeline for the analysis of quantitative proteomics data. The pipeline is based on the [OpenMS](https://www.openms.de/) framework and [DIA-NN](https://github.com/vdemichev/DiaNN); and it is designed to analyze large scale experiments. the main outputs of quantms tools are the following: diff --git a/quantmsio/core/feature_in_memory.py b/quantmsio/core/feature_in_memory.py index c988b3f..a56c271 100644 --- a/quantmsio/core/feature_in_memory.py +++ b/quantmsio/core/feature_in_memory.py @@ -786,6 +786,7 @@ def _merge_sdrf_to_msstats_in(self, sdrf_path, msstats_in): factor, "comment[fraction identifier]", "comment[label]", + "comment[technical replicate]", ] ] sdrf["comment[data file]"] = sdrf["comment[data file]"].swifter.apply(lambda x: x.split(".")[0]) @@ -797,7 +798,7 @@ def _merge_sdrf_to_msstats_in(self, sdrf_path, msstats_in): right_on=["comment[data file]", "comment[label]"], how="left", ) - res.drop(["comment[data file]", "comment[label]"], axis=1, inplace=True) + res.drop(["comment[data file]", "comment[label]", "comment[technical replicate]"], axis=1, inplace=True) res.rename(columns=self._map_tmt, inplace=True) res.rename(columns={factor: "condition"}, inplace=True) return res @@ -809,7 +810,19 @@ def _merge_sdrf_to_msstats_in(self, sdrf_path, msstats_in): right_on=["comment[data file]"], how="left", ) - res.drop(["comment[data file]", "comment[label]"], axis=1, inplace=True) + samples = sdrf["source name"].unique() + mixed_map = dict(zip(samples, range(1, len(samples) + 1))) + res.loc[:, "Run"] = res[ + ["source name", "comment[technical replicate]", "comment[fraction identifier]"] + ].swifter.apply( + lambda row: str(mixed_map[row["source name"]]) + + "-" + + str(row["comment[technical replicate]"]) + + "-" + + str(row["comment[fraction identifier]"]), + axis=1, + ) + res.drop(["comment[data file]", "comment[label]", "comment[technical replicate]"], axis=1, inplace=True) res.rename(columns=self._map_lfq, inplace=True) res.rename(columns={factor: "condition"}, inplace=True) return res