Closed abearab closed 10 months ago
similar to this part https://github.com/mhorlbeck/ScreenProcessing/blob/0ee5192ecc17348665bd1387ddfa9037efb7964f/process_experiments.py#L484C1-L502C1
# pseudocount
if pseudocountBehavior == 'default' or pseudocountBehavior == 'zeros only':
def defaultBehavior(row): return row if min(
row) != 0 else row + pseudocountValue
combinedCountsPseudo = combinedCounts.apply(defaultBehavior, axis=1)
elif pseudocountBehavior == 'all values':
combinedCountsPseudo = combinedCounts.apply(
lambda row: row + pseudocountValue, axis=1)
elif pseudocountBehavior == 'filter out':
combinedCountsPseudo = combinedCounts.copy()
zeroRows = combinedCounts.apply(lambda row: min(row) <= 0, axis=1)
combinedCountsPseudo.loc[zeroRows, :] = np.nan
else:
raise ValueError(
'Pseudocount behavior not recognized or not implemented')
totalCounts = combinedCountsPseudo.sum()
countsRatio = float(totalCounts[0])/totalCounts[1]
https://github.com/abearab/ScreenPro2/blob/7804e9415e4dc8a9316aed16daacfa48ce45f202/screenpro/phenoScore.py#L21C7-L21C7