diff mqppep_mrgfltr.py @ 23:7560a4e80a1e draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 0c7ca054e77e042c8a584c9903073da064df7d8b
author eschen42
date Thu, 30 Jun 2022 16:15:57 +0000
parents ba5f14c2a4af
children 29775869faba
line wrap: on
line diff
--- a/mqppep_mrgfltr.py	Wed Apr 13 19:48:01 2022 +0000
+++ b/mqppep_mrgfltr.py	Thu Jun 30 16:15:57 2022 +0000
@@ -608,6 +608,33 @@
             file=sys.stderr,
         )  # timer
 
+        # ########################################################################
+        # # trim upstream_data to include only the upstream map columns
+        # old_cols = upstream_data.columns.tolist()
+        # i = 0
+        # first_intensity = -1
+        # last_intensity = -1
+        # intensity_re = re.compile("Intensity.*")
+        # for col_name in old_cols:
+        #     m = intensity_re.match(col_name)
+        #     if m:
+        #         last_intensity = i
+        #         if first_intensity == -1:
+        #             first_intensity = i
+        #     i += 1
+        # # print('last intensity = %d' % last_intensity)
+        # col_PKCalpha = last_intensity + 2
+        #
+        # data_in_cols = [old_cols[0]] + old_cols[
+        #     first_intensity: last_intensity + 1
+        # ]
+        #
+        # if upstream_data.empty:
+        #     print("upstream_data is empty")
+        #     exit(0)
+        #
+        # data_in = upstream_data.copy(deep=True)[data_in_cols]
+        ########################################################################
         # trim upstream_data to include only the upstream map columns
         old_cols = upstream_data.columns.tolist()
         i = 0
@@ -625,6 +652,9 @@
         col_PKCalpha = last_intensity + 2
 
         data_in_cols = [old_cols[0]] + old_cols[
+            first_intensity - 1: last_intensity
+        ]
+        data_col_names = [old_cols[0]] + old_cols[
             first_intensity: last_intensity + 1
         ]
 
@@ -633,6 +663,10 @@
             exit(0)
 
         data_in = upstream_data.copy(deep=True)[data_in_cols]
+        data_in.columns = data_col_names
+        print("data_in")
+        print(data_in)
+        ########################################################################
 
         # Convert floating-point integers to int64 integers
         #   ref: https://stackoverflow.com/a/68497603/15509512
@@ -1181,8 +1215,12 @@
             file=sys.stderr,
         )  # timer
 
+        print("old_cols[:col_PKCalpha]")
+        print(old_cols[:col_PKCalpha])
         cols = [old_cols[0]] + old_cols[col_PKCalpha - 1:]
         upstream_data = upstream_data[cols]
+        print("upstream_data.columns")
+        print(upstream_data.columns)
 
         end_time = time.process_time()  # timer
         print(