Skip to content

Commit

Permalink
Add get_ms2deepscore_embeddings (from sqlite)
Browse files Browse the repository at this point in the history
  • Loading branch information
niekdejonge committed Nov 23, 2023
1 parent deb5665 commit 9329b22
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ms2query/query_from_sqlite_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,14 @@ def contains_class_annotation(self) -> bool:
if has_class_annotations is False:
print("SQLite file does not contain compound class information (download a newer version)")
return has_class_annotations

def get_ms2deepscore_embeddings(self):
# Connect to the SQLite database
conn = sqlite3.connect(self.sqlite_file_name)
# Write an SQL query to select data from the table
query = "SELECT * FROM MS2Deepscore_embeddings"
# Use the read_sql_query function to execute the query and read the results into a DataFrame
ms2deepscore_embeddings = pd.read_sql_query(query, conn, index_col="spectrumid")
# Close the connection
conn.close()
return ms2deepscore_embeddings

0 comments on commit 9329b22

Please sign in to comment.