'Create a Tag object from a tag string.'

def _create_tag(self, tag_str):

    tag_hierarchy = tag_str.split(self.hierarchy_separator)
    tag_prefix = ''
    parent_tag = None
    for sub_tag in tag_hierarchy:
        tag_name = (tag_prefix + self._scrub_tag_name(sub_tag))
        tag = self.sa_session.query(galaxy.model.Tag).filter_by(name=tag_name).first()
        if (not tag):
            tag = galaxy.model.Tag(type=0, name=tag_name)
        tag.parent = parent_tag
        parent_tag = tag
        tag_prefix = (tag.name + self.hierarchy_separator)
    return tag
