Newer
Older
"""
@author: ershov
"""
import os, sys
import numpy as np
import pandas as pd
# To find local version of the library, we assume that internal organization of
# the project was not modified.
PROJECT_ROOT_DIR = os.path.abspath("../")
sys.path.append( PROJECT_ROOT_DIR )
from lib import assign_particles as al
# IMPORTANT!!!
# al.parameters modify the global values in the module directly!!!
# Chromatic abberations: correct green G to map it to blue B
# B[x,y] = G[x,y] + shift_g_to_b[x,y]; shift obtained experimentally.
# Set to 0 if you have not performed the alignment.
al.shiftY = -1.57142857
al.shiftX = 1.71428571
# parameter to normalize counts of pole-associated degradosomes
# (they are biased to higher numbers because of additional degree of freedom)
tip_r = 2.5 # D/2; D = typicall nucle width in pix
al.normalize_tip_counts_by = np.pi * tip_r # Tip perimeter is pi*R: half of the circle perimeter.
# get data subset
data_dir = os.path.join( PROJECT_ROOT_DIR, 'data' )
datasets_df = pd.read_csv( data_dir + '/datasets_example.csv' )
selected_data_df = datasets_df[
(datasets_df['data_lbl']=='data_set_2_od')
# & (datasets_df['cond']=='WT')
all_cells, all_particles, all_heatmap_data = al.assign_particles_to_nuclei( data_dir, selected_data_df )