text: user185: I am doing some metagenomic analysis of samples which can only contain microbes due to the experimental setup.
  For this, it would be useful to be able to distinguish whether a specific organism is a microbe or not, as it allows:
  
  to detect potentially false findings,
  to avoid an unnecessary inflation of the metagenomic database.
  
  For animals and plants, this is straightforward, as they are never microbes.
  However, for fungi (and some other clades) it gets complicated.
  At the very least, I failed to find a simple list of microbial or non-microbial clades.
  Ideally, I would like to have a function that maps a taxonomic ID to a boolean stating whether this organism is microbial. I acknowledge that this is utopic since microbe is not that well defined, there are facultatively multicellular organisms, and for some cases it may simply not be known. I am therefore happy with any reasonable approximation such as unicellularity. In particular, given my application, a small chance of falsely identifying an organism as microbial is not an issue.
  I am currently working with the NCBI database accessed via the ETE 3 module for Python, but I am open to use other databases and tools.
  
  user2108: I would start by saying that your statement that no animals/plants are microbes is false. There are indeed microbial algae (plants) and microbial animals.
  So it is indeed difficult. (I'll briefly note that unless your protocol specifically gets rid of environmental DNA, you will probably have some contaminating non-microbial DNA no matter what.)
  However, we can use a different version of your proposition to make a simple (over-simple, most would argue) approximation: all prokaryotic organisms, e.g. bacteria and archaea, are microbial, and all eukaryotic organisms are not. This is not hard to do if you are already using NCBI taxonomy, as you can use e.g. this mapping. It has the advantage that all bacteria and archaea are definitely microbial. 
  Of course it's quite wrong, as you already know. In principle you could set up a complex decision tree sorting this out, though I imagine that's the thing you wish to avoid.
  In terms of other genome databases, you might consider looking into GOLD, which has extensive metadata in a slightly less arcane setup than NCBI, which might be helpful. But there is a high rate of missingness there, and also there is still not necessarily a great "microbe"/"not microbe" mapping.
  There are also existing databases of microorganisms, which may or may not satisfy your requirements; I have little familiarity with most of those so caveat emptor. 
  I believe (hope) that NCBI taxid is a good way to do lookups in all such databases, but it may not be true.
  
original_text: 185: <p>I am doing some metagenomic analysis of samples which can only contain microbes due to the experimental setup.
  For this, it would be useful to be able to distinguish whether a specific organism is a microbe or not, as it allows:</p>
  
  <ul>
  <li>to detect potentially false findings,</li>
  <li>to avoid an unnecessary inflation of the metagenomic database.</li>
  </ul>
  
  <p>For animals and plants, this is straightforward, as they are never microbes.
  However, for fungi (and some other clades) it gets complicated.
  At the very least, I failed to find a simple list of microbial or non-microbial clades.</p>
  
  <p>Ideally, I would like to have a function that maps a taxonomic ID to a boolean stating whether this organism is microbial. I acknowledge that this is utopic since <em>microbe</em> is not that well defined, there are facultatively multicellular organisms, and for some cases it may simply not be known. I am therefore happy with any reasonable approximation such as unicellularity. In particular, given my application, a small chance of falsely identifying an organism as microbial is not an issue.</p>
  
  <p>I am currently working with the NCBI database accessed via the ETE 3 module for Python, but I am open to use other databases and tools.</p>
   2108: <p>I would start by saying that your statement that no animals/plants are microbes is false. There are indeed microbial <a href="https://microbiologyonline.org/index.php/about-microbiology/introducing-microbes/algae" rel="nofollow noreferrer">algae</a> (plants) and <a href="https://msystems.asm.org/content/4/3/e00109-19" rel="nofollow noreferrer">microbial animals</a>.</p>
  
  <p>So it is indeed difficult. (I'll briefly note that unless your protocol specifically gets rid of environmental DNA, you will probably have some contaminating non-microbial DNA no matter what.)</p>
  
  <p>However, we can use a different version of your proposition to make a simple (over-simple, most would argue) approximation: all prokaryotic organisms, e.g. bacteria and archaea, are microbial, and all eukaryotic organisms are not. This is not hard to do if you are already using NCBI taxonomy, as you can use e.g. <a href="https://ftp.ncbi.nih.gov/pub/taxonomy/taxcat_readme.txt" rel="nofollow noreferrer">this mapping</a>. It has the advantage that all bacteria and archaea are <em>definitely</em> microbial. </p>
  
  <p>Of course it's quite wrong, as you already know. In principle you could set up a complex decision tree sorting this out, though I imagine that's the thing you wish to avoid.</p>
  
  <p>In terms of other genome databases, you might consider looking into <a href="https://gold.jgi.doe.gov/organisms" rel="nofollow noreferrer">GOLD</a>, which has extensive metadata in a slightly less arcane setup than NCBI, which might be helpful. But there is a high rate of missingness there, and also there is still not necessarily a great "microbe"/"not microbe" mapping.</p>
  
  <p>There are also <a href="https://jb.asm.org/content/197/15/2458#:~:text=The%20Global%20Catalog%20of%20Microorganisms,from%20different%20sources%20(78)." rel="nofollow noreferrer">existing databases</a> of microorganisms, which may or may not satisfy your requirements; I have little familiarity with most of those so caveat emptor. </p>
  
  <p>I believe (hope) that NCBI taxid is a good way to do lookups in all such databases, but it may not be true.</p>
  