def getAnalysis(self):
        """
        Assembles metadata within the VCF header into a GA4GH
        Analysis object.
        :return: protocol.Analysis
        """
        metadata = self.getMetadata()
        analysis = protocol.Analysis()
        formats = metadata.formats.items()
        infos = metadata.info.items()
        for prefix, content in [("FORMAT", formats), ("INFO", infos)]:
            for contentKey, value in content:
                key = "{0}.{1}".format(prefix, value.name)
                if key not in analysis.info:
                    analysis.info[key] = []
                if value.description is not None:
                    analysis.info[key].append(value.description)
        analysis.createDateTime = self._creationTime
        analysis.updateDateTime = self._updatedTime
        for r in metadata.records:
            # Don't add a key to info if there's nothing in the value
            if r.value is not None:
                if analysis.info not in r.key:
                    analysis.info[r.key] = []
                analysis.info[r.key].append(str(r.value))

            if r.key == "created":
                # TODO handle more date formats
                analysis.createDateTime = datetime.datetime.strptime(
                    r.value, "%Y-%m-%d").isoformat() + "Z"
            if r.key == "software":
                analysis.software.append(r.value)
            if r.key == "name":
                analysis.name = r.value
            if r.key == "description":
                analysis.description = r.value
        analysis.id = str(datamodel.VariantAnnotationSetAnalysisCompoundId(
            self._compoundId, "analysis"))
        return analysis
dataset/ETHPy150Open ga4gh/server/ga4gh/datamodel/variants.py/HtslibVariantAnnotationSet.getAnalysis/swapped operands of `not in`