Relabel/rename OTU IDs in an OTU table using a taxonomy file
0
0
Entering edit mode
6.8 years ago
jack1120 ▴ 30

Hi all,

I tried to search the forum exhaustively for related topics, so I hope that this is a new and useful question.

I have an OTU table in which each OTU is named with a sha1 label from an earlier step in my pipeline. I also generated a tab-separated taxonomy table using sequences associated with these OTUs. The taxonomy table contains a column with with sha1 labels and a column with species names, but it also contains taxa that didn't make into my final OTU table. Thus, there is not a 1 for 1 relationship between the number of OTUs in my OTU table and the number of taxa in the taxonomy table. I would like to rename the OTU IDs in my OTU table with the corresponding species names in the taxonomy table.

My OTU table is currently formatted:

OTU_ID  Sample1 Sample2 Sample3
56e3db633d31500040d8f4ab17085d5d174bf232    400 75  250
f1359a957a52091b3df7fa4612cfbd6d9472bfa4    100 200 999
b3f67fe2d59fe1e9808743bf8e645e5186c01956    25  300 750

My taxonomy table is formatted:

qseqid  sseqid  ssciname
2dd3bf79b7c187b598a007636b3727023d535e59    LC203322.1  Melanomma pulvis-pyrius
56e3db633d31500040d8f4ab17085d5d174bf232    LC015712.1  uncultured Eutypa
c7cfee1d916e081d649ea8223ebac11dbb6ba829    JF908413.1  Mycena maurella
f1359a957a52091b3df7fa4612cfbd6d9472bfa4    KP891143.1  uncultured fungus
195f508548eed794556049771e3eeaeabfd1992b    JF908387.1  Mycena pseudocorticola
b3f67fe2d59fe1e9808743bf8e645e5186c01956    LT906565.1  Fomitopsis pinicola

I would like my OTU table to look like:

OTU_ID  Sample1 Sample2 Sample3
uncultured Eutypa   400 75  250
uncultured fungus   100 200 999
Fomitopsis pinicola 25  300 750

Thank you!

sequencing rename relabel taxonomy OTU • 4.3k views
ADD COMMENT
0
Entering edit mode

This should be a pretty easy conversion. Do you mind updating the text in your question to show what you have exactly and what is your desired formatted output?

There are lots of ways using biom-format to add taxonomy to an OTU table, but what you might want to be done could also be done easily with AWK or SED.

ADD REPLY
0
Entering edit mode

Hi Josh,

I updated my initial question as you suggested. I have also been looking through the biom-format documentation and it looks like this may be the best way forward. This is the first time that I have generated OTU tables, which felt like an accomplishment itself, but I am now stuck and wondering what the heck to do with them! It looks like the biom-format is a good way to add in metadata and start performing analyses. Thanks for the tip!

Lauren

ADD REPLY

Login before adding your answer.

Traffic: 2053 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6