def test_basic_search(): client = biosnake.Biosnake() db = client.databases.create("test", "Test database", TEST_INPUT_FILE) assert db.description == "Test database" assert db.name == "test" search_results = db.search( [ "ACTAGCTCAGTCAACTAGCTCAGTCCTCAGTCAACTAGCTCAGTCTATATATATACAAC", "ACTAGCTCAGTCAACTAGCTCAGTCCTCAGTCAACTAGCT", "ACTAGCTCAGTCAACTAGCT", "ACTAGCTCAGT", ], search_type="nucleotides", headers=[ "query_sequence_id", "target_sequence_id", "sequence_identity", "target_sequence_aligned" ], ) search_results.dataframe.to_csv('hujemuje.csv')
import biosnake # # Demonstration of basic biosnake2 operations # # Create a client client = biosnake.Biosnake() # Create a database from fasta file # Here we specify name of the database, description and input file # (The input can also be a Seq/SeqRecord list/iterator/etc.) client.databases.create("test", "Test database", "a.fasta") # Get description of the database print(client.databases[0].description) # Perform search on a database # Note that the search queries can be a string with a patch to the FASTA file with queries results = client.databases[0].search( [ "ACTAGCTCAGTCAACTAGCTCAGTCCTCAGTCAACTAGCTCAGTCTATATATATACAAC", "ACTAGCTCAGTCAACTAGCTCAGTCCTCAGTCAACTAGCT", "ACTAGCTCAGTCAACTAGCT", "ACTAGCTCAGT", ], search_type="nucleotides", headers=[ "query_sequence_id", "target_sequence_id", "sequence_identity", "target_sequence_aligned" ],
def test_empty(): client = biosnake.Biosnake() client.databases.create("test", "Test database", "./example/a.fasta")