From f507bf97f5bf7e96e2b9f95f9c467f489a2b937e Mon Sep 17 00:00:00 2001 From: Nicolas Palacio Date: Tue, 19 Nov 2024 14:47:41 +0100 Subject: [PATCH] Fixed processing of references in Baccin2019 --- pypath/inputs/baccin2019.py | 2 +- pypath/inputs/common.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pypath/inputs/baccin2019.py b/pypath/inputs/baccin2019.py index f9ce72954..a85fab4ac 100644 --- a/pypath/inputs/baccin2019.py +++ b/pypath/inputs/baccin2019.py @@ -154,7 +154,7 @@ def get_partners(components, sources, references): _ref for _ref in ( ref.strip().replace('.0', '') - for ref in rec[7].split(',') + for ref in str(rec[7]).split(',') ) if _ref.isdigit() } diff --git a/pypath/inputs/common.py b/pypath/inputs/common.py index c4579e770..9bee516db 100644 --- a/pypath/inputs/common.py +++ b/pypath/inputs/common.py @@ -81,11 +81,17 @@ def read_xls( ) try: + if isinstance(sheet, int): + sheet = book.sheet_by_index(sheet) + else: + sheet = book.sheet_by_name(sheet) + except xlrd.biffh.XLRDError: + sheet = book.sheet_by_index(0) table = [