code: public static DfPattern findSubstructure(IAtomContainer query) {
          if (query instanceof IQueryAtomContainer)
              return new DfPattern((IQueryAtomContainer) query);
          else
              return new DfPattern(QueryAtomContainer.create(query,
                                                             ALIPHATIC_ELEMENT,
                                                             AROMATIC_ELEMENT,
                                                             SINGLE_OR_AROMATIC,
                                                             ALIPHATIC_ORDER,
                                                             STEREOCHEMISTRY));
      }
docs: Create a pattern which can be used to find molecules which contain the
  {@code query} structure. If a 'real' molecule is provided is is converted
  with {@link QueryAtomContainer#create(IAtomContainer, Expr.Type...)}
  matching elements, aromaticity status, and bond orders.
  
  @param query the substructure to find
  @return a pattern for finding the {@code query}
  @see QueryAtomContainer#create(IAtomContainer, Expr.Type...)