Plugin Definition and Registration

class qiime2.plugin.Plugin(name, version, website, package, citation_text=None, user_support_text=None, short_description=None, description=None, citations=None)
property actions
register_formats(*formats, citations=None)
register_semantic_type_to_format(semantic_type, artifact_format)
register_semantic_types(*semantic_types)
register_transformer(_fn=None, *, citations=None)

A transformer has the type Callable[[type], type]

register_views(*views, citations=None)
qiime2.plugin.SemanticType(name, field_names=None, field_members=None, variant_of=None)

Create a new semantic type.

Parameters
  • name (str) – The name of the semantic type: this should match the variable to which the semantic type is assigned.

  • field_names (str, iterable of str, optional) – Name(s) of the fields where member types can be placed. This makes the type a composite type, meaning that fields must be provided to produce realized semantic types. These names will define ad-hoc variant types accessible as name.field[field_names member].

  • field_members (mapping, optional) – A mapping of strings in field_names to one or more semantic types which are known to be members of the field (the variant type).

  • variant_of (VariantField, iterable of VariantField, optional) – Define the semantic type to be a member of one or more variant types allowing it to be placed in the respective fields defined by those variant types.

Returns

There are several (private) types which may be returned, but anything returned by this factory will cause is_semantic_type to return True.

Return type

A Semantic Type

class qiime2.plugin.Properties(*include, exclude=())
collapse_intersection(other)
get_kind()
get_kind_expr(self_expr)
get_name()
get_name_expr(self_expr)
get_union_membership_expr(self_expr)
is_element(expr)
is_element_expr(self_expr, value)
is_symbol_subtype(other)
is_symbol_subtype_expr(self_expr, other_expr)
is_symbol_supertype(other)
is_symbol_supertype_expr(self_expr, other_expr)
is_template = True
public_proxy = ()
update_ast(ast)
update_ast_expr(self_expr, ast)
class qiime2.plugin.Range(*args, inclusive_start=True, inclusive_end=False)
collapse_intersection(other)
get_kind()
get_kind_expr(self_expr)
get_name()
get_name_expr(self_expr)
get_union_membership_expr(self_expr)
is_element(value)
is_element_expr(self_expr, value)
is_symbol_subtype(other)
is_symbol_subtype_expr(self_expr, other_expr)
is_symbol_supertype(other)
is_symbol_supertype_expr(self_expr, other_expr)
is_template = True
iter_boundaries()
public_proxy = ()
update_ast(ast)
update_ast_expr(self_expr, ast)
qiime2.plugin.Start(start, inclusive=True)
qiime2.plugin.End(end, inclusive=False)
class qiime2.plugin.Choices(*choices)
collapse_intersection(other)
get_kind()
get_kind_expr(self_expr)
get_name()
get_name_expr(self_expr)
get_union_membership_expr(self_expr)
is_element(value)
is_element_expr(self_expr, value)
is_symbol_subtype(other)
is_symbol_subtype_expr(self_expr, other_expr)
is_symbol_supertype(other)
is_symbol_supertype_expr(self_expr, other_expr)
is_template = True
iter_boundaries()
public_proxy = ()
unpack_union()
update_ast(ast)
update_ast_expr(self_expr, ast)
class qiime2.plugin.TypeMap(mapping)
input_width()
iter_outputs(*, _double_as_input=False)
property lifted
solve(*inputs)
qiime2.plugin.TypeMatch(listing)
exception qiime2.plugin.ValidationError
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class qiime2.plugin.Citations
clear() → None. Remove all items from od.
copy() → a shallow copy of od
fromkeys(S[, v]) → New ordered dictionary with keys from S.

If not specified, the value defaults to None.

get(k[, d]) → D[k] if k in D, else d. d defaults to None.
items() → a set-like object providing a view on D's items
keys() → a set-like object providing a view on D's keys
classmethod load(path, package=None)
move_to_end()

Move an existing element to the end (or beginning if last==False).

Raises KeyError if the element does not exist. When last=True, acts like a fast version of self[key]=self.pop(key).

pop(k[, d]) → v, remove specified key and return the corresponding

value. If key is not found, d is returned if given, otherwise KeyError is raised.

popitem()

Remove and return a (key, value) pair from the dictionary.

Pairs are returned in LIFO order if last is true or FIFO order if false.

save(f)
setdefault(k[, d]) → od.get(k,d), also set od[k]=d if k not in od
update([E, ]**F) → None. Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() → an object providing a view on D's values
class qiime2.plugin.CitationRecord(type, fields)
count(value) → integer -- return number of occurrences of value
property fields

Alias for field number 1

index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

property type

Alias for field number 0

Record Containers

qiime2.plugin.plugin.TransformerRecord = <class 'qiime2.plugin.plugin.TransformerRecord'>

TransformerRecord(transformer, plugin, citations)

qiime2.plugin.plugin.SemanticTypeRecord = <class 'qiime2.plugin.plugin.SemanticTypeRecord'>

SemanticTypeRecord(semantic_type, plugin)

qiime2.plugin.plugin.FormatRecord = <class 'qiime2.plugin.plugin.FormatRecord'>

FormatRecord(format, plugin)

qiime2.plugin.plugin.ViewRecord = <class 'qiime2.plugin.plugin.ViewRecord'>

ViewRecord(name, view, plugin, citations)

qiime2.plugin.plugin.TypeFormatRecord = <class 'qiime2.plugin.plugin.TypeFormatRecord'>

TypeFormatRecord(type_expression, format, plugin)

Formats

class qiime2.plugin.model.DirectoryFormat(path=None, mode='w')
validate(level='max')
class qiime2.plugin.model.File(pathspec, *, format=None)
class qiime2.plugin.model.FileCollection(pathspec, *, format=None)
set_path_maker(function)
class qiime2.plugin.model.TextFileFormat(path=None, mode='w')
open()
validate(level='max')
class qiime2.plugin.model.BinaryFileFormat(path=None, mode='w')
open()
validate(level='max')
qiime2.plugin.model.SingleFileDirectoryFormat(name, pathspec, format)
class qiime2.plugin.model.SingleFileDirectoryFormatBase(path=None, mode='w')
validate(level='max')
exception qiime2.plugin.model.ValidationError
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.