Sequence Collections Agent tutorial¶
Introduction¶
This tutorial will show you how to use the refget.RefgetDBAgent
class to interact with a SQL database of sequence collections.
Under construction
The RefgetDBAgent() is parameterized through environment variables, which will provide the information it needs to connect to a SQL database.
In [ ]:
Copied!
a_root = "test_fasta"
dbc = RefgetDBAgent()
print(f"SQL Engine: {dbc.engine}")
a_root = "test_fasta"
dbc = RefgetDBAgent()
print(f"SQL Engine: {dbc.engine}")
You can load some FASTA files into the database like this:
In [ ]:
Copied!
demo_results = {}
for demo_file in DEMO_FILES:
f = os.path.join(fa_root, demo_file)
print("Fasta file to be loaded: {}".format(f))
demo_results[f] = dbc.seqcol.add_from_fasta_file(f)
print(demo_results[f])
demo_results = {}
for demo_file in DEMO_FILES:
f = os.path.join(fa_root, demo_file)
print("Fasta file to be loaded: {}".format(f))
demo_results[f] = dbc.seqcol.add_from_fasta_file(f)
print(demo_results[f])