microbiome / mia

Microbiome analysis
https://microbiome.github.io/mia/
Artistic License 2.0
45 stars 25 forks source link

remove only empty rank cols #572

Closed Daenarys8 closed 3 weeks ago

Daenarys8 commented 3 weeks ago

ping #568 This PR modifies .remove_NA_cols_from_rowdata to remove only rank columns with only NAs.

TuomasBorman commented 3 weeks ago

rd <- rowData()[, taxonomy, drop = FALSE]

Do tricks

.... rowData()[, taxonomy, drop = FALSE] <- rd

TuomasBorman commented 3 weeks ago

Something like that

Daenarys8 commented 3 weeks ago

ohh I thought calling taxonomyRanks will take into account only rank cols. i will update

TuomasBorman commented 3 weeks ago

It does, but you are replacing the whole rowData() with table that contains only taxonomy table --> you are removing all other columns

Daenarys8 commented 3 weeks ago

okay I get it. thanks

TuomasBorman commented 3 weeks ago

Can you create unit tests for this?

Daenarys8 commented 3 weeks ago

sure. will do.