I work in forensics and we are doing a study where we are trying to associate anonymous microbiome samples to microbiome from different body parts from a library so we would be able to know that the sample that we have comes from a mouth for example. I was wondering if it was possible to do this kind of source tracking with qiime2.
It sounds like your main aim is to predict the source of a sample (as opposed to specific species in a sample). For this, I would recommend using the plugin q2-sample-classifier, which can perform prediction of sample type (or other metadata), either via cross-validation or predicting unseen samples (e.g., where the sample type is actually not known). q2-sample-classifier is currently installed as part of QIIME 2, so you can check out the --help documentation, or see the online tutorials at docs.qiime2.org
Also, for predicting source-sink relationships there is a QIIME 2 plugin for sourcetracker2, though I am not sure if it is up to date, you can see this topic for some instructions to get it installed:
Sourcetracker2 allows prediction of the source of different species (or other features) in a sample. Different sample types are explicitly labeled as sources or sinks.