The RosettaCM requires Ligands must be added to all templates with a non-zero weight in the XML file!
In my case, the templates represent different parts of the target, so some template includes the ligand while some template does not. Do I really need to add the ligand to the template that does not have the ligand?
If it is necessary, how to do it? It is not likely to use some alignment to "estimate" the ligand location in the template.
The weight is only used to pick the starting structure on which the rest of the fragments are build onto. That's why you need to have the ligands in them -- RosettaCM can't place the ligand if it's not in the initially chosen template. (RosettaCM can bridge together disparate protein bits if there's enough overlapping templates, but the techinque it uses to place the non-protein ligands can't handle that.)
The easy fix is to simply set a weight of 0 to any template which doesn't contain the ligand. They'll still be used to build up their portions of the structure, they just won't be picked for that very first initial structure.
Thank you, it works.
I also tested putting the ligand to the template which does not contain the ligand. The resulting structure still only contains one ligand, which seems to be okay.