davidaknowles / leafcutter

Annotation-free quantification of RNA splicing. Yang I. Li, David A. Knowles, Jack Humphrey, Alvaro N. Barbeira, Scott P. Dickinson, Hae Kyung Im, Jonathan K. Pritchard
http://davidaknowles.github.io/leafcutter/
Apache License 2.0
208 stars 115 forks source link

Enable leafcutter-ds to handle a group_file with no confounder columns #255

Open lianos opened 5 months ago

lianos commented 5 months ago

leafcutter-ds would error out when no confounder columns were present in group_file, this is an attempt to fix that.

  1. A default confounders = None variable is set
  2. A chunk of code that manipulates the confounders DataFrame was pushed up into the if len(meta.columns) > 2 block
  3. If no confounders are present, the counts DataFrame is subset to just include the samples defined in meta

Please note I'm not a Python or pandas guru, so I'm sure there may be better (more idiomatic) ways to do this, but this seems to do what I think is intended to setup the ultimate call to differential_splicing()