INNER CODE UNIT · Python
parse
pha4ge/hAMRonization · hAMRonization/AmrFinderPlusIO.py:72
def parse(self, handle):
"""
Read each and return it
"""
skipped_truncated = 0
reader = csv.DictReader(handle, delimiter="\t")
for result in reader:
# Replace NA value with None for consistency
for field, value in result.items():
if value == "NA":
result[field] = None
# Skip reported virulence genes
if result['Type'] == "VIRULENCE":
continue
# AFP reports partial hits so to avoid misleadingly listing these