Export biom into R taxa ranks are in wrong columns

Hi there,

When I export a BIOM table from Megan6 using the official classification option and upload into R my ranks are out of order. This seems to happen mostly for taxa that are not well classified so the ID collapses to the highest rank. Is there a way to only have taxa assigned to the right rank? Can I delete taxa based on the first letter of their name (s__ or o__ for example)?

Here is an example of some taxa using taxa after using the import_biom function in R and thenn tail(tax_table(biom),25) to get a small list.
Rank1 should be phyla (all p__) but these are all species (s__). Why are they in this column?

 Rank1                                                 Rank2 Rank3 Rank4 Rank5 Rank6 Rank7 Rank8

455557 “s__uncultured marine microorganism HF4000_APKG10F13” NA NA NA NA NA NA NA
455560 “s__uncultured marine microorganism HF4000_APKG10H12” NA NA NA NA NA NA NA
455562 “s__uncultured marine microorganism HF4000_APKG10K24” NA NA NA NA NA NA NA
455551 “s__uncultured marine microorganism HF4000_APKG7H23” NA NA NA NA NA NA NA
455553 “s__uncultured marine microorganism HF4000_APKG8C21” NA NA NA NA NA NA NA
455555 “s__uncultured marine microorganism HF4000_APKG8K5” NA NA NA NA NA NA NA
455556 “s__uncultured marine microorganism HF4000_APKG8L7” NA NA NA NA NA NA NA
941421 “s__uncultured organism CA878” NA NA NA NA NA NA NA
941422 “s__uncultured organism CA915” NA NA NA NA NA NA NA
198431 “s__uncultured prokaryote” NA NA NA NA NA NA NA
672203 “s__uncultured prokaryote AT5” NA NA NA NA NA NA NA
672204 “s__uncultured prokaryote EC6” NA NA NA NA NA NA NA
128422 “s__uncultured soil microbe SL1-36C7” NA NA NA NA NA NA NA
415540 “s__uncultured marine microorganism” NA NA NA NA NA NA NA
360281 “s__uncultured marine organism” NA NA NA NA NA NA NA
358574 “s__uncultured microorganism” NA NA NA NA NA NA NA
155900 “s__uncultured organism” NA NA NA NA NA NA NA
743609 “s__uncultured organism MedDCM-OCT-S04-C138” NA NA NA NA NA NA NA
743650 “s__uncultured organism MedDCM-OCT-S09-C426” NA NA NA NA NA NA NA
743658 “s__uncultured organism MedDCM-OCT-S11-C29” NA NA NA NA NA NA NA
743660 “s__uncultured organism MedDCM-OCT-S11-C346” NA NA NA NA NA NA NA
1457551 “s__uncultured soil microorganism” NA NA NA NA NA NA NA
46465 “s__unidentified soil organism” NA NA NA NA NA NA NA
32630 “s__synthetic construct” NA NA NA NA NA NA NA
28430 “s__Sym plasmid” NA NA NA NA NA NA NA

How about trying to export from MEGAN in CSV format and then importing that in R? MEGAN is more flexible when it comes to CSV formatting.

Ok thanks Daniel. I will try out different csv options in megan today and see if there is a suitable option.