Repository 'cell_intensity_processing'
hg clone https://toolshed.g2.bx.psu.edu/repos/goeckslab/cell_intensity_processing

Changeset 3:4f5abe01531c (2024-05-10)
Previous changeset 2:7f93f472a242 (2024-02-28) Next changeset 4:5d541df02496 (2024-05-10)
Commit message:
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/mti-utils commit 4d6008b58593174b87c9d9cf50c79ddfafda7637
modified:
macros.xml
process_intensities.xml
b
diff -r 7f93f472a242 -r 4f5abe01531c macros.xml
--- a/macros.xml Wed Feb 28 20:52:16 2024 +0000
+++ b/macros.xml Fri May 10 17:52:26 2024 +0000
b
@@ -14,8 +14,8 @@
         <citation type="doi">10.1101/2022.08.18.504436</citation>
         </citations>
     </xml>
-
+    
     <token name="@TOOL_VERSION@">0.0.1</token>
-    <token name="@VERSION_SUFFIX@">3</token>
+    <token name="@VERSION_SUFFIX@">4</token>
     <token name="@PROFILE@">19.01</token>
 </macros>
b
diff -r 7f93f472a242 -r 4f5abe01531c process_intensities.xml
--- a/process_intensities.xml Wed Feb 28 20:52:16 2024 +0000
+++ b/process_intensities.xml Fri May 10 17:52:26 2024 +0000
[
@@ -26,6 +26,23 @@
 
 markers_to_normalize = marker_df['marker_name'].to_list()
 
+#if $AF_method.select_method == 'SBR':
+AF_markers = [x for x in list(marker_df['${AF_method.AF_col}'].unique()) if x != 'None']
+print(f'Detected {quant[AF_markers].eq(0.0).any(axis=1).sum()} cells with AF values of zero in the dataset')
+
+#if $AF_filter == 'filter':
+pre_filter_count = len(quant)
+quant = quant.loc[quant[AF_markers].ne(0.0).any(axis=1),:]
+print(f'Filtered out {pre_filter_count - len(quant)} cells that had AF values of 0.0')
+
+#elif $AF_filter == 'clip':
+print('Clipping all AF values equal to 0.0 to the minimum non-zero AF value')
+for af in AF_markers:
+    quant[af] = quant[af].clip(lower = quant[af][quant[af].ne(0.0)].min())
+
+#end if
+#end if
+
 for marker in markers_to_normalize:
 
 #if $exp.exposure == 'correct_exposure':
@@ -74,6 +91,10 @@
             </when>
             <when value="SBR">
                 <param name="AF_col" type="text" value="AF_channel" label="Name of column in markers file containing respective AF channel for each marker" />
+                <param name="AF_filter" type="select" label="Select whether to clip or filter out AF values equal to 0">
+                    <option value="clip">Clip autofluorescence values of 0.0 to the minimum non-zero autofluorescence value</option>
+                    <option value="filter">Filter out cells with autofluorescence values equal to 0.0</option>
+                </param>
             </when>
         </conditional>
     </inputs>
@@ -89,6 +110,7 @@
             </conditional>
             <conditional name="AF_method">
                 <param name="select_method" value="SBR" />
+                    <param name="AF_filter" value="clip" />
             </conditional>
             <output name="processed_quant" ftype="csv">
                 <assert_contents>