First, a subset of the atoms of the query fragment must be (manually) flagged as masked atoms in the XYZ input file by appending an exclamation mark ! to their atomic species labels (e.g., C → C! for a carbon atom). A masked atom in the query fragment implies that the corresponding atom of the parent crystal structure (i) must be removed [e.g., to make room for replacement with a different functionality] but (ii) does not correspond with an atom on the replacement fragment and thus cannot be used in the process of aligning the replacement fragment onto the parent crystal. E.g., in Fig. , the H atom of the p-phenylene is a masked atom. The atom property viewer in iRASPA [ ] facilitates finding which atom(s) in the XYZ file to annotate with ! to label as masked. Let V q,! ⊆ V q denote the subset of nodes of the query graph that are masked. Then, PoreMatMod.jl automatically searches for each subgraph G r of the replacement graph that is isomorphic to the induced subgraph of the query graph containing the non-masked nodes V q \ V q,! . Each is a bijection φ : V r → V q \ V q,! indicating correspondence between a subset of the atoms on the replacement fragment and the non-masked atoms of the query fragment. Finally, the composition of the bijections v p = θ -1 (φ(v r )) (with • -1 indicating the inverse of a mapping) gives the node of the parent graph v p ∈ V p that corresponds with node v r ∈ V r of the replacement graph-this directly informs the alignment of the replacement fragment onto the parent structure.