locpix.preprocessing.functions.file_to_datastruc#
- file_to_datastruc(input_file, file_type, dim, channel_col, frame_col, x_col, y_col, z_col, channel_choice=None, channel_label=None)[source]#
Loads in .csv or .parquet and converts to the required datastructure.
Currently considers the following columns: channel frame x y z Also user can specify the channels they want to consider, these should be present in the channels column
- Parameters:
input_file (string) – Location of the file
file_type (string) – Either csv or parquet
save_loc (string) – Location to save datastructure to
dim (int) – Dimensions to consider either 2 or 3
channel_col (string) – Name of column which gives channel for localisation
frame_col (string) – Name of column which gives frame for localisation
x_col (string) – Name of column which gives x for localisation
y_col (string) – Name of column which gives y for localisation
z_col (string) – Name of column which gives z for localisation
channel_choice (list of ints) – If specified then this will be list of integers representing channels to be considered
channel_label (list of strings) – If specified then this is the label for each channel i.e. [‘egfr’, ‘ereg’,’unk’] means channel 0 is egfr protein, channel 1 is ereg proteins and channel 2 is unknown
- Returns:
Datastructure containg the data
- Return type:
datastruc (SMLM_datastruc)