From 0c8fed70aca0d8884b5063b4534fb7cd77943b0b Mon Sep 17 00:00:00 2001 From: Jazz Mack Smith Date: Wed, 6 Dec 2023 18:38:19 +0000 Subject: [PATCH] added column to feature metadata retaining RT in seconds --- Tests/test_coverage.sh | 4 ++-- nPYc/objects/_msDataset.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Tests/test_coverage.sh b/Tests/test_coverage.sh index d18d95ea..d3a5b3d6 100755 --- a/Tests/test_coverage.sh +++ b/Tests/test_coverage.sh @@ -4,7 +4,7 @@ coverage erase coverage run -m unittest discover -coverage report +coverage report --sort=Cover coverage html -coverage xml +#coverage xml open htmlcov/index.html \ No newline at end of file diff --git a/nPYc/objects/_msDataset.py b/nPYc/objects/_msDataset.py index 2b935ffc..3ab2bbda 100644 --- a/nPYc/objects/_msDataset.py +++ b/nPYc/objects/_msDataset.py @@ -867,7 +867,9 @@ def _loadXCMSDataset(self, path, noFeatureParams=14): # Tidy formatting featureMetadata.drop(list(featureMetadata.filter(regex='Unnamed')), axis=1, inplace=True) featureMetadata.rename(columns={"name": "Feature Name", "mz": "m/z", "rt": "Retention Time"}, inplace=True) - featureMetadata['Retention Time'] = featureMetadata['Retention Time'].astype(float) / 60.0 + # Jazz adding extra column to retain RT in seconds as well as minutes + featureMetadata['Retention Time (seconds)'] = featureMetadata['Retention Time'].astype(float) + featureMetadata['Retention Time'] = featureMetadata['Retention Time (seconds)'] / 60.0 featureMetadata['m/z'] = featureMetadata['m/z'].astype(float) self.featureMetadata = featureMetadata