Skip to content

Commit

Permalink
Merge pull request #17 from SynBioDex/t-w-testing
Browse files Browse the repository at this point in the history
T w testing
  • Loading branch information
CarolusVitalis authored Jan 31, 2025
2 parents 25e1a39 + 582570a commit b2315d6
Show file tree
Hide file tree
Showing 19 changed files with 3,162 additions and 438 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added .github/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ dmypy.json

# Pyre type checker
.pyre/
.DS_Store
544 changes: 297 additions & 247 deletions SBOL3_simple_library4.nt

Large diffs are not rendered by default.

Binary file modified SBOL3_simple_library4.xlsx
Binary file not shown.
685 changes: 685 additions & 0 deletions SampleTemp3Output.nt

Large diffs are not rendered by default.

Binary file added excelutils/.DS_Store
Binary file not shown.
Binary file added excelutils/excel_sbol_utils/.DS_Store
Binary file not shown.
10 changes: 8 additions & 2 deletions excelutils/excel_sbol_utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import string
import rdflib
from openpyxl.worksheet import cell_range, worksheet
from openpyxl import load_workbook
from pathlib import Path

def check_name(nm_to_chck):
Expand All @@ -22,6 +23,11 @@ def check_name(nm_to_chck):
for ltr in nm_to_chck:
if ord(ltr) == 32:
nm_to_chck = nm_to_chck.replace(ltr, "_")
elif ord(ltr) == 45:
# Allow hyphens to be reinterpreted as underscores
nm_to_chck = nm_to_chck.replace(ltr, "_")
elif ord(ltr) == 46:
nm_to_chck = nm_to_chck.replace(ltr, "_")
elif ord(ltr) > 122 or ord(ltr) < 48:
# 122 is the highest decimal code number
# for common latin ltrs or arabic numbers
Expand Down Expand Up @@ -124,7 +130,7 @@ def read_variant_table(excel_file: Path) -> tuple[str, str, list[list]]:
LAST_VARIANT_ROW = 35

print(f'Loading workbook "{excel_file}"')
work_book = openpyxl.load_workbook(excel_file, data_only=True)
work_book = load_workbook(excel_file, data_only=True)
sheet = work_book[VARIANTS_SHEET]

# First, get the library name
Expand All @@ -133,7 +139,7 @@ def read_variant_table(excel_file: Path) -> tuple[str, str, list[list]]:

# Then get the base sequence
print('Extracting base sequence')
first_aa_column = get_column_number(FIRST_AMINO_ACID_COLUMN)
first_aa_column = col_to_num(FIRST_AMINO_ACID_COLUMN)
last_aa_column = row_ends(sheet, ORIGINAL_AMINO_ACID_ROW, first_aa_column)
# Get row from sheet and concatenate it into a string
row_iterator = sheet.iter_rows(min_row=ORIGINAL_AMINO_ACID_ROW, max_row=ORIGINAL_AMINO_ACID_ROW,
Expand Down
Loading

0 comments on commit b2315d6

Please sign in to comment.