Skip to content

leafcutter2::leafcutter-ds errors out when groups_file.txt has no cofounder columns #256

@lianos

Description

@lianos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions