I dug up an old piece of JSL that I used to calculate the FDR. Attached is an example data table that is the results from a Response Screening platform. I cut it down to have just the PValues and the FDR values calculated from the Response Screening platform. The script below, takes the p Values from the data table and independently calculates the FDR.
Names Default To Here( 1 );
dt = Current Data Table();
pValues = dt:PValue << get values;
index = Rank Index( pvalues ); // removes missing values
n = N Row( index );
ordPValue = pvalues[index];
adkPValue = J( n, 1, . );
For( i = 1, i <= n, i++,
k = n - i + 1;
ratio = n / (n - i + 1);
adkPValue[k] = If( i == 1,
ordPValue[k],
Min( ratio * ordPValue[k], adkPValue[k + 1] )
);
);
dt << New Column( "kEN Calculated FDR PValue", Format( "Scientific" ) );
For( i = 1, i <= N Rows( adkPValue ), i++,
dt:kEN Calculated FDR PValue[index[i]] = adkPValue[i]
);
Jim