msreport 0.0.25__tar.gz → 0.0.26__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. {msreport-0.0.25 → msreport-0.0.26}/PKG-INFO +1 -1
  2. {msreport-0.0.25 → msreport-0.0.26}/msreport/__init__.py +1 -1
  3. {msreport-0.0.25 → msreport-0.0.26}/msreport/helper/table.py +14 -4
  4. {msreport-0.0.25 → msreport-0.0.26}/msreport.egg-info/PKG-INFO +1 -1
  5. {msreport-0.0.25 → msreport-0.0.26}/tests/test_helper.py +29 -14
  6. {msreport-0.0.25 → msreport-0.0.26}/LICENSE.txt +0 -0
  7. {msreport-0.0.25 → msreport-0.0.26}/README.md +0 -0
  8. {msreport-0.0.25 → msreport-0.0.26}/msreport/aggregate/__init__.py +0 -0
  9. {msreport-0.0.25 → msreport-0.0.26}/msreport/aggregate/condense.py +0 -0
  10. {msreport-0.0.25 → msreport-0.0.26}/msreport/aggregate/pivot.py +0 -0
  11. {msreport-0.0.25 → msreport-0.0.26}/msreport/aggregate/summarize.py +0 -0
  12. {msreport-0.0.25 → msreport-0.0.26}/msreport/analyze.py +0 -0
  13. {msreport-0.0.25 → msreport-0.0.26}/msreport/errors.py +0 -0
  14. {msreport-0.0.25 → msreport-0.0.26}/msreport/export.py +0 -0
  15. {msreport-0.0.25 → msreport-0.0.26}/msreport/fasta.py +0 -0
  16. {msreport-0.0.25 → msreport-0.0.26}/msreport/helper/__init__.py +0 -0
  17. {msreport-0.0.25 → msreport-0.0.26}/msreport/helper/calc.py +0 -0
  18. {msreport-0.0.25 → msreport-0.0.26}/msreport/helper/maxlfq.py +0 -0
  19. {msreport-0.0.25 → msreport-0.0.26}/msreport/helper/temp.py +0 -0
  20. {msreport-0.0.25 → msreport-0.0.26}/msreport/impute.py +0 -0
  21. {msreport-0.0.25 → msreport-0.0.26}/msreport/isobar.py +0 -0
  22. {msreport-0.0.25 → msreport-0.0.26}/msreport/normalize.py +0 -0
  23. {msreport-0.0.25 → msreport-0.0.26}/msreport/peptidoform.py +0 -0
  24. {msreport-0.0.25 → msreport-0.0.26}/msreport/plot.py +0 -0
  25. {msreport-0.0.25 → msreport-0.0.26}/msreport/qtable.py +0 -0
  26. {msreport-0.0.25 → msreport-0.0.26}/msreport/reader.py +0 -0
  27. {msreport-0.0.25 → msreport-0.0.26}/msreport/rinterface/__init__.py +0 -0
  28. {msreport-0.0.25 → msreport-0.0.26}/msreport/rinterface/limma.py +0 -0
  29. {msreport-0.0.25 → msreport-0.0.26}/msreport/rinterface/rinstaller.py +0 -0
  30. {msreport-0.0.25 → msreport-0.0.26}/msreport/rinterface/rscripts/limma.R +0 -0
  31. {msreport-0.0.25 → msreport-0.0.26}/msreport.egg-info/SOURCES.txt +0 -0
  32. {msreport-0.0.25 → msreport-0.0.26}/msreport.egg-info/dependency_links.txt +0 -0
  33. {msreport-0.0.25 → msreport-0.0.26}/msreport.egg-info/requires.txt +0 -0
  34. {msreport-0.0.25 → msreport-0.0.26}/msreport.egg-info/top_level.txt +0 -0
  35. {msreport-0.0.25 → msreport-0.0.26}/pyproject.toml +0 -0
  36. {msreport-0.0.25 → msreport-0.0.26}/setup.cfg +0 -0
  37. {msreport-0.0.25 → msreport-0.0.26}/setup.py +0 -0
  38. {msreport-0.0.25 → msreport-0.0.26}/tests/test_analyze.py +0 -0
  39. {msreport-0.0.25 → msreport-0.0.26}/tests/test_export.py +0 -0
  40. {msreport-0.0.25 → msreport-0.0.26}/tests/test_impute.py +0 -0
  41. {msreport-0.0.25 → msreport-0.0.26}/tests/test_isobar.py +0 -0
  42. {msreport-0.0.25 → msreport-0.0.26}/tests/test_maxlfq.py +0 -0
  43. {msreport-0.0.25 → msreport-0.0.26}/tests/test_peptidoform.py +0 -0
  44. {msreport-0.0.25 → msreport-0.0.26}/tests/test_qtable.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: msreport
3
- Version: 0.0.25
3
+ Version: 0.0.26
4
4
  Summary: Post processing and analysis of quantitative proteomics data
5
5
  Author-email: "David M. Hollenstein" <hollenstein.david@gmail.com>
6
6
  License: Apache-2.0
@@ -10,4 +10,4 @@ import msreport.normalize
10
10
  import msreport.plot
11
11
  import msreport.reader
12
12
 
13
- __version__ = "0.0.25"
13
+ __version__ = "0.0.26"
@@ -176,12 +176,22 @@ def find_sample_columns(
176
176
  columns.
177
177
 
178
178
  Returns:
179
- A list of sample column names.
179
+ A list of column names containing the substring and any entry of 'samples'.
180
+ Columns are returned in the order of entries in 'samples'.
180
181
  """
182
+ WHITESPACE_CHARS = " ."
183
+
181
184
  matched_columns = []
182
- for column in find_columns(table, substring):
183
- if any([sample in column for sample in samples]):
184
- matched_columns.append(column)
185
+ substring_columns = find_columns(table, substring)
186
+ for sample in samples:
187
+ sample_columns = [c for c in substring_columns if sample in c]
188
+ for col in sample_columns:
189
+ column_remainder = (
190
+ col.replace(substring, "").replace(sample, "").strip(WHITESPACE_CHARS)
191
+ )
192
+ if column_remainder == "":
193
+ matched_columns.append(col)
194
+ break
185
195
  return matched_columns
186
196
 
187
197
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: msreport
3
- Version: 0.0.25
3
+ Version: 0.0.26
4
4
  Summary: Post processing and analysis of quantitative proteomics data
5
5
  Author-email: "David M. Hollenstein" <hollenstein.david@gmail.com>
6
6
  License: Apache-2.0
@@ -19,20 +19,35 @@ class TestFindColumns:
19
19
  assert columns == ["Test A", "Test B"]
20
20
 
21
21
 
22
- def test_find_sample_columns():
23
- df = pd.DataFrame(
24
- columns=[
25
- "Test",
26
- "Test Not_a_sample",
27
- "Test Sample_A",
28
- "Test Sample_B",
29
- "Something else",
30
- ]
31
- )
32
- samples = ["Sample_A", "Sample_B"]
33
- tag = "Test"
34
- columns = msreport.helper.find_sample_columns(df, tag, samples)
35
- assert columns == ["Test Sample_A", "Test Sample_B"]
22
+ class TestFindSampleColumns:
23
+ def test_find_sample_columns(self):
24
+ df = pd.DataFrame(
25
+ columns=[
26
+ "Tag",
27
+ "Tag Not_a_sample",
28
+ "Tag Sample_A",
29
+ "Tag Sample_B",
30
+ "Something else",
31
+ ]
32
+ )
33
+ samples = ["Sample_A", "Sample_B"]
34
+ tag = "Tag"
35
+ columns = msreport.helper.find_sample_columns(df, tag, samples)
36
+ assert columns == ["Tag Sample_A", "Tag Sample_B"]
37
+
38
+ def test_columns_are_returned_in_order_of_samples(self):
39
+ df = pd.DataFrame(columns=["Tag Sample_B", "Tag Sample_A"])
40
+ samples = ["Sample_A", "Sample_B"]
41
+ tag = "Tag"
42
+ columns = msreport.helper.find_sample_columns(df, tag, samples)
43
+ assert columns == ["Tag Sample_A", "Tag Sample_B"]
44
+
45
+ def test_correct_mapping_with_samples_that_are_substrings(self):
46
+ df = pd.DataFrame(columns=["Tag SampleB_1", "Tag B_1"])
47
+ samples = ["B_1"]
48
+ tag = "Tag"
49
+ columns = msreport.helper.find_sample_columns(df, tag, samples)
50
+ assert columns == ["Tag B_1"]
36
51
 
37
52
 
38
53
  class TestKeepRowsByPartialMatch:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes