Change sample-ids after running dada2


I would like to know how can I change the sample-ids in the table and rep-seq artifacts that are obtained after running dada2 module, without having to repeat the import and quality filtering steps. I just found a naming error in my samples after days running dada2 :scream: .

Thank you very much in advance,

Hello @ju4n_dc!

:scream: :scream: :scream:

Luckily, I have just the trick for you! Take a look at feature-table group! That might sound weird at first, but, stick with me. What you can do is add a new column to your metadata file that contains the new sample IDs. Then, when you run the group command, point the --m-metadata-column to the column containing your new sample IDs. The --p-mode parameter don’t matter (you can pick whatever you want) - because you are “grouping” the values into the same “groups”, just with new names, none of the abundances will change. Et voila! Moving forward, just drop the old sample ID column from your metadata and replace it with the new sample ID column. :recycle:

Fortunately you don’t need to do anything here - this file contains FeatureData, and is blissfully unaware of any sample-id SNAFUs that might be lurking in your feature table.

Good luck and keep us posted! :t_rex:


It worked OK! Thanks!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.