import pandas as pd
q =0.05
pvals2 =[0.00000295, 0.78497692, 0.67490742, 0.93007279, 0.65885729, 0.00009310, 0.99380176, 0.98943676, 0.01493185, 0.07604793]
pvals = pd.DataFrame(pvals2)
for i in pvals:
if i < 0 or i >1:
print('p-values are not in valid range')
#print(pvals)
probs = pvals.sort_values(by=pvals.columns[0])
#print(probs)
l = len(pvals)
#print(l)
ll = list(range(1, l+1))
#print(ll)
d = []
for i in ll:
d.append(1/i)
correct = sum(d)
#print(correct)
fdr = [i/l * (q/correct) for i in ll]