q2-dsfdr not working with mann-whitney or kruskal-wallis tests

@serenejiang Its very interesting test method, we have tried this for our data to get the differential abundance taxa. We got the results using by default method " meandiff ", but if we wanted to apply Mann-Whitney or Kruskal-Wallis we are unable to do this in QIIME2 plugin, it's not working. We tried a lot to apply those diff. methods. So can you help us to resolve this issue?
Thank you.

1 Like

For mann-whitney test, you can add this line: --p-statistical-test ‘mannwhitney’
While for Kruskal-Wallis test, you can add: --p-statistical-test ‘kruwallis’

Using the example of the data in the qiime2 tutorial for dsfdr, you can use the following commands:

## Mann-Whitney
qiime dsfdr permutation-fdr \
--i-table dblr_haddad.qza \
--m-metadata-file metadata_rare2k.txt \
--m-metadata-column 'exposure_type' \
--p-statistical-test 'mannwhitney' \
--o-visualization dsfdr_mann.qzv \
--verbose
qiime tools view dsfdr_mann.qzv

## Kruskal-Wallis
qiime dsfdr permutation-fdr \
--i-table dblr_haddad.qza \
--m-metadata-file metadata_rare2k.txt \
--m-metadata-column 'exposure_type' \
--p-statistical-test 'kruwallis' \
--o-visualization dsfdr_Krukal.qzv \
--verbose
qiime tools view dsfdr_Krukal.qzv

@serenejiang thanks for the suggestions we have used it but still it didn’t worked out we were able to do it for Kruskal-Wallis but could not apply the Mann-Whitney test. We also tried using your link on Github for DS- FDR.

That’s strange. I tested on my laptop and it worked for mannwhitney. Could you send me the command that you used in q2-dsfdr, and also the error that you received?

I ran the code from github with
self.data5 = np.array([[-1000, -341, -53333, -2235, -3440, -34441, 100, 300, 400, 500, 600, 700],
[1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1]])
self.labels = np.array([1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0])

res_ds = dsfdr.dsfdr(self.data5, self.labels, method='meandiff',
transform_type=None, alpha=0.1, numperm=1000, # 1000
fdr_method='dsfdr')

and I got REJECTED for the first row.
But when running the same with method='mannwhitney' I got False for rejecting H0 for the first row.
It seems there is a bug in the implementation of mannwhitney, no?
thanks