Skip to content

Instantly share code, notes, and snippets.

View derrick-daniel's full-sized avatar
:octocat:

derrick_daniel derrick-daniel

:octocat:
View GitHub Profile
@derrick-daniel
derrick-daniel / CARD-DB_to_Abricate-CARD-DB_format
Last active December 22, 2023 15:04
This script is tailored for the manipulation of the Comprehensive Antibiotic Resistance Database (CARD). It functions by ingesting data from a JSON file, selectively extracting pertinent details, and then reformatting them to align with the Abricate CARD DB structure. This process is essential for updating the Abricate CARD DB.
import json
def format_sequence(sequence):
return '\n'.join([sequence[i:i+60] for i in range(0, len(sequence), 60)])
def process_category_name(name):
words = name.split()
if words[-1].lower() == 'antibiotic':
return ' '.join(words[:-1])
return ' '.join(words)