It looks like the current suggestion is to use the python version of leafcutter, so I thought I'd give it a shot.
I had some problems with the install via pip, but managed to manually copy the right files in the site-packages of my conda env (not sure if this has gone smoothly for others?), however after the install leafcutter-cluster seemed to work just fine, however leafcutter-ds threw an error when I used a pretty vanilla group_file.txt file, that looks like so:
RSQ3197 DMSO
RSQ3198 DMSO
RSQ3199 DMSO
RSQ3200 DMSO
RSQ3170 treatment
RSQ3171 treatment
RSQ3172 treatment
The error was being thrown from this line because the confounders object never gets instantiated since len(meta.columns) is 2
I hacked the file leafcuter_ds.py file to make things work as I think is intended, and wrapped it up in this pull request for your consideration.
As noted in the PR, my Python is very rusty and I've really never messed with pandas (sorry, I'm an R guy these days) so I'm sure the code there is not idiomatic, but it did the job for now.
It looks like the current suggestion is to use the python version of leafcutter, so I thought I'd give it a shot.
I had some problems with the install via
pip, but managed to manually copy the right files in thesite-packagesof my conda env (not sure if this has gone smoothly for others?), however after the installleafcutter-clusterseemed to work just fine, howeverleafcutter-dsthrew an error when I used a pretty vanillagroup_file.txtfile, that looks like so:The error was being thrown from this line because the
confoundersobject never gets instantiated sincelen(meta.columns)is2I hacked the file
leafcuter_ds.pyfile to make things work as I think is intended, and wrapped it up in this pull request for your consideration.As noted in the PR, my Python is very rusty and I've really never messed with pandas (sorry, I'm an R guy these days) so I'm sure the code there is not idiomatic, but it did the job for now.