title: How to implement R's p.adjust in Python
body: <p>I have a list of p-values and I would like to calculate the adjust p-values for multiple comparisons for the <a href="http://en.wikipedia.org/wiki/False_discovery_rate">FDR</a>. In R, I can use:</p>
  
  <pre><code>pval &lt;- read.csv("my_file.txt",header=F,sep="\t")
  pval &lt;- pval[,1]
  FDR &lt;- p.adjust(pval, method= "BH")
  print(length(pval[FDR&lt;0.1]))
  write.table(cbind(pval, FDR),"pval_FDR.txt",row.names=F,sep="\t",quote=F )
  </code></pre>
  
  <p>How can I implement this code in Python? Here was my feable attempt in Python with the help of Google:</p>
  
  <pre><code>pvalue_list [2.26717873145e-10, 1.36209234286e-11 , 0.684342083821...] # my pvalues
  pvalue_lst = [v.r['p.value'] for v in pvalue_list]
  p_adjust = R.r['p.adjust'](R.FloatVector(pvalue_lst),method='BH')
  for v in p_adjust:
      print v
  </code></pre>
  
  <p>The above code throws an <code>AttributeError: 'float' object has no attribute 'r'</code> error. Can anyone help point out my problem? Thanks in advance for the help!</p>