You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://doi.org/10.5281/zenodo.4587193)<!-- 4B81BE is the colour for Zenodo -->
3
+
[](https://doi.org/10.1038/s41596-021-00603-4)<!-- 644B96 is the colour for Nature Protocols -->
4
+
5
+
<!-- Development branch to add some new functionality related to Dimensionality reduction
6
+
(and perhaps clustering), adding ARM support (for Apple silicon), and improving
7
+
code annotation for our functions.
8
+
Take also as an opportunity to redefine the conda environment file. -->
Copy file name to clipboardExpand all lines: code/aux/aux1_data_preprocess.py
+32-2
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,17 @@
9
9
#Idea is to rename all columns and then filter non-relevant ones (less optimal,
10
10
# easier and more compatible with writing new reduced file in the last step)
11
11
12
-
#Filtering
12
+
#Filtering: The function allows you to filter out columns based on a specific pattern, which can be useful for removing columns that are not relevant to your analysis.
13
13
deffilter_columns(renamed_columns):
14
+
"""
15
+
Filters out unnecessary columns from the list of renamed columns.
16
+
17
+
Args:
18
+
renamed_columns (list): List of renamed columns.
19
+
20
+
Returns:
21
+
tuple: A tuple containing two lists - columns to keep and filtered columns.
22
+
"""
14
23
reg_filter=re.compile("^\d+[A-Za-z]+$") #Removes columns with just isotope
15
24
filtered_columns= [] #Stores the columns that where deemed unnecessary
16
25
columns_to_keep= [] #Columns that the reduced file should have
#Add also the generation of a .csv file with the markers in the panel.
60
78
#It should be ok to do it here b4 concatenation in the next step because if
61
79
# they are to be concatenaded they shpould already have the same panel of markers
80
+
#The function generates a panel markers file that can be used to indicate the selection status of markers. The file will contain marker names along with "N" values indicating that none of the markers are selected.
Copy file name to clipboardExpand all lines: code/aux/aux2_umap.py
+12-5
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,19 @@
12
12
# UMAP function
13
13
# umap embedding calculation; result saved in a pandas dataframe
14
14
# the names of the umap info columns are also defined here
15
-
15
+
#The function applies UMAP dimensionality reduction to the input data and combines it with the original data, providing the UMAP-transformed data as the output.
Copy file name to clipboardExpand all lines: code/aux/aux3_emd.py
+15-2
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,22 @@
6
6
importscprep
7
7
8
8
# Function to calculate EMD
9
-
9
+
#The function calculates the EMD between two distributions for each marker and stores the results in a DataFrame. The EMD measures the minimum amount of work required to transform one distribution into another, considering the distances between individual data points.
Copy file name to clipboardExpand all lines: code/aux/aux4_dremi.py
+14
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,21 @@
12
12
# find outliers for both marker_x and marker_y based on cufoffs of standard deviations
13
13
# return the number of outliers and a dataframe after outlier removal
14
14
# update the df_info_dict with the number of outliers
15
+
#The function identifies outliers based on the absolute difference between each marker's value and its mean, normalized by the marker's standard deviation. Rows that have values exceeding the cutoff multiplied by the standard deviation are considered outliers.
0 commit comments