Skip to content

Commit

Permalink
Merge pull request #4 from peterk87/patch/pd-series-str-check
Browse files Browse the repository at this point in the history
Check SnpSift column dtype is str
  • Loading branch information
peterk87 authored Apr 19, 2021
2 parents ec5ec4f + 7efbfc3 commit 59c0894
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.2
current_version = 0.2.3
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/peterk87/xlavir',
version='0.2.2',
version='0.2.3',
zip_safe=False,
)
2 changes: 1 addition & 1 deletion xlavir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """Peter Kruczkiewicz"""
__email__ = 'peter.kruczkiewicz@gmail.com'
__version__ = '0.2.2'
__version__ = '0.2.3'
6 changes: 5 additions & 1 deletion xlavir/tools/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ def simplify_snpsift(df: pd.DataFrame, sample_name: str) -> Optional[pd.DataFram
continue
else:
field_names.add(new_series_name)
new_series = df[c].str.split(',', n=1, expand=True)[0]
series = df[c]
if series.dtype == 'object' and isinstance(series.values[0], str):
new_series = series.str.split(',', n=1, expand=True)[0]
else:
new_series = series.astype('str')
new_series.name = new_series_name
series.append(new_series)
else:
Expand Down

0 comments on commit 59c0894

Please sign in to comment.