I have a bunch of sequences which failed to get assignment up to genus level. For downstream analysis I want to remove those OTUs/sequences/ASVs from the phyloseq object (OTU table). Could somebody suggest me script to remove those OTUs? Thanks in advance.
EDIT:
The input and output provided as image as well as ta ext. You can see ASVs which are not assigned up to genus level (NA) which are ASV, ASV7, ASV8 etc has been removed in output. I want the same for whole table. because of certain reasons I dont want to use Excel.
Input
#otuid sample1 sample2 Phylum Class Order Family Genus species
ASV6 0 0 Cyano [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] NA NA
ASV7 7549 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] NA NA
ASV8 165 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] NA NA
ASV11 0 0 TM7 TM7-3 I025 Rs-045 NA NA
ASV12 0 0 TM7 TM7-3 I025 Rs-045 NA [Saccharibacteria]_UB2523
ASV13 0 0 TM7 TM7-3 I025 Rs-045 [Saccharibacteria] [Saccharibacteria]_UB2523
ASV1 14692 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] NA
ASV2 0 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] NA
ASV3 7347 5107 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] NA
ASV4 0 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] NA
ASV5 0 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] NA
ASV9 0 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] [Melainabacter_A1]
ASV10 3685 2773 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] [Melainabacter_A1]
output
#otuid sample1 sample2 Phylum Class Order Family Genus species
ASV13 0 0 TM7 TM7-3 I025 Rs-045 [Saccharibacteria] [Saccharibacteria]_UB2523
ASV1 14692 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] NA
ASV2 0 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] NA
ASV3 7347 5107 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] NA
ASV4 0 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] NA
ASV5 0 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] NA
ASV9 0 0 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] [Melainabacter_A1]
ASV10 3685 2773 Cyanobacteria[Melainabacteria] [Melainabacteria] [Melainabacteriales] [Melainabacteriaceae] [Melainabacter] [Melainabacter_A1]