INNER CODE UNIT · Python

parse

pha4ge/hAMRonization · hAMRonization/AmrPlusPlusIO.py:35

    def parse(self, handle):
        """
        Read each and return it
        """
        # skip any manually specified fields for later
        reader = csv.DictReader(handle, delimiter="\t")
        for result in reader:
            hit_information = (
                result["Gene"].replace("|RequiresSNPConfirmation", "").split("|")
            )
            result["_reference_accession"] = hit_information[0]
            result["_drug_class"] = hit_information[2]
            result["_gene_symbol"] = hit_information[-1]
            result["_gene_name"] = hit_information[-2]
            yield self.hAMRonize(result, self.metadata)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…