From 57f43bbbe59e5398a18133c08c1c92d70c25981e Mon Sep 17 00:00:00 2001 From: donkirkby Date: Tue, 29 Jun 2021 11:52:52 -0700 Subject: [PATCH] Fix bug when removing primers. Update dependencies. --- Pipfile | 2 +- Pipfile.lock | 47 ++++++++++++++++++----------------- gene_splicer/primer_finder.py | 7 +++--- setup.py | 4 +-- 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/Pipfile b/Pipfile index a362115..0b1543f 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ gotoh = {subdirectory = "micall/alignment", ref = "v7.7.0", git = "https://githu numpy = "==1.18.4" python-levenshtein = "==0.12.0" pandas = "==1.0.5" -requests = "==2.24.0" +requests = "==2.25.1" pyyaml = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index dfeb200..62eecb4 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "0dde2db89ed19f589e8e87e84c9530167576085787df8e59cbc5bf63b8479c59" + "sha256": "5ca3ad6876e19ad6ab64a2c685c9a30b77715161919b81613e94ee66e6305cbd" }, "pipfile-spec": 6, "requires": { @@ -18,17 +18,18 @@ "default": { "certifi": { "hashes": [ - "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c", - "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830" + "sha256:2bbf76fd432960138b3ef6dda3dde0544f27cbf8546c458e60baf371917ba9ee", + "sha256:50b1e4f8446b06f41be7dd6338db18e0990601dce795c2b1686458aa7e8fa7d8" ], - "version": "==2020.12.5" + "version": "==2021.5.30" }, "chardet": { "hashes": [ - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" + "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa", + "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5" ], - "version": "==3.0.4" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==4.0.0" }, "gotoh": { "git": "https://github.com/cfe-lab/MiCall.git", @@ -151,37 +152,37 @@ }, "requests": { "hashes": [ - "sha256:b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b", - "sha256:fe75cc94a9443b9246fc7049224f75604b113c36acb93f87b80ed42c44cbb898" + "sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804", + "sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e" ], "index": "pypi", - "version": "==2.24.0" + "version": "==2.25.1" }, "six": { "hashes": [ - "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", - "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" + "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.15.0" + "version": "==1.16.0" }, "urllib3": { "hashes": [ - "sha256:8d7eaa5a82a1cac232164990f04874c594c9453ec55eef02eab885aa02fc17a2", - "sha256:f5321fbe4bf3fefa0efd0bfe7fb14e90909eb62a48ccda331726b4319897dd5e" + "sha256:39fb8672126159acb139a7718dd10806104dec1e2f0f6c88aab05d17df10c8d4", + "sha256:f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.25.11" + "version": "==1.26.6" } }, "develop": { "attrs": { "hashes": [ - "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6", - "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700" + "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1", + "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==20.3.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==21.2.0" }, "coverage": { "hashes": [ @@ -282,11 +283,11 @@ }, "pytest": { "hashes": [ - "sha256:671238a46e4df0f3498d1c3270e5deb9b32d25134c99b7d75370a68cfbe9b634", - "sha256:6ad9c7bdf517a808242b998ac20063c41532a570d088d77eec1ee12b0b5574bc" + "sha256:50bcad0a0b9c5a72c8e4e7c9855a3ad496ca6a881a3641b4260605450772c54b", + "sha256:91ef2131a9bd6be8f76f1f08eac5c5317221d6ad1e143ae03894b862e8976890" ], "index": "pypi", - "version": "==6.2.3" + "version": "==6.2.4" }, "toml": { "hashes": [ diff --git a/gene_splicer/primer_finder.py b/gene_splicer/primer_finder.py index ec2225d..4ebd9a6 100644 --- a/gene_splicer/primer_finder.py +++ b/gene_splicer/primer_finder.py @@ -385,8 +385,9 @@ def add_primers(row): def remove_primers(row): # Strip the primers out - newseq = row.sequence[int(row.fwd_sample_primer_size - ):-int(row.rev_sample_primer_size)] + newseq = row.sequence[ + row.fwd_sample_primer_size + row.fwd_sample_primer_start + :-(row.rev_sample_primer_size + row.rev_sample_primer_start)] row.sequence = newseq return row @@ -395,7 +396,7 @@ def filter_df(df, nodups=True): filtered = df[(df['error'].isna() & df['fwd_error'].isna() & df['rev_error'].isna())] - filtered = filtered.apply(remove_primers, axis=1) + filtered = filtered.apply(remove_primers, axis=1, result_type='broadcast') if nodups: filtered = filtered.drop_duplicates(subset='sample', keep=False) if not filtered.empty: diff --git a/setup.py b/setup.py index 49c0030..5013969 100644 --- a/setup.py +++ b/setup.py @@ -2,14 +2,14 @@ setup( name='gene_splicer', - version='v2.3.1', + version='v2.3.9', packages=find_packages(), install_requires=[ 'gotoh @ git+https://github.com/cfe-lab/MiCall.git@v7.7.0#egg=gotoh&subdirectory=micall/alignment', 'numpy==1.18.4', 'python-Levenshtein==0.12.0', 'pandas==1.0.5', - 'requests==2.24.0', + 'requests==2.25.1', 'pyyaml' ], package_data={