pommevilla / MetaFunPrimer

A qPCR primer design pipeline to target environmentally abundant functional genes

Home Page:https://metafunprimer.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

calc_sscore: change normalization technique

pommevilla opened this issue · comments

info=$(awk '{
for(i = 2; i <= NF; i++)
{
sums[i] += $i
sums_squared[i] += ($i)^2
}
}
END {
for(i = 2; i <= NF; i++)
{
means[i - 1] = sums[i] / NR;
std_devs[i - 1]=sqrt((sums_squared[i]-sums[i]^2/NR)/NR)
}
printf "%s,%s,%s,%s", means[1],std_devs[1],means[2],std_devs[2]
}' $input_file)

The S-score is currently calculated by taking the mean of the standardized presence and absences of a gene. However, this isn't compatible with our desired thresholding function, since the the first gene will always have S-score greater than whatever threshold that is set. Change the above lines so that the S-score is the mean of the 0-1 normalized presence and abundance.

Resolved by #21