TypeError: cannot use a string pattern on a bytes-like object
Closed this issue · 2 comments
MSleeper1 commented
Hello, Thank you for developing this program. I am interested in using it, but when I run python BCReval.py -n 8 -i SRR11858960.fastq -o SRR11858960_bcr.stat
with wgbs data as the input, I am getting the following error:
File "/home/programs/BCR_Evaluator/BCReval.py", line 341, in <module>
main(sys.argv[1:])
File "/home/programs/BCR_Evaluator/BCReval.py", line 326, in main
rep = getTeloRepCount(min_rep_number, f)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/programs/BCR_Evaluator/BCReval.py", line 153, in getTeloRepCount
[type, bs] = findBestTelomereMatch(line)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/programs/BCR_Evaluator/BCReval.py", line 86, in findBestTelomereMatch
bs1= findLongestTelomereMatch(seq, p0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/programs/BCR_Evaluator/BCReval.py", line 77, in findLongestTelomereMatch
matchs = re.findall(pattern, seq)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miniconda3/envs/bcr/lib/python3.12/re/__init__.py", line 217, in findall
return _compile(pattern, flags).findall(string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot use a string pattern on a bytes-like object```
Could you suggest why this error might be arising and any adjustments I could make to resolve the issue? Thank you for your assistance.
MSleeper1 commented
Update: The issue was related to using a newer version of Python. I saw that you mentioned testing BCReval with Python 2.7
and I was able to get your program to work by pinning 2.7 as the Python version in my Conda environment with the command mamba create -n bcr python=2.7 conda-forge::gzip
.
Thanks again for developing this program.
hqyone commented
Hi Meghan
Sorry for the late response, and happy you solve the problem.
Thank you
Quanyuan
…On Mon, Jan 22, 2024 at 6:07 PM Meghan Sleeper ***@***.***> wrote:
Update: The issue was related to using a newer version of Python. I saw
that you mentioned testing BCReval with Python 2.7 and I was able to get
your program to work by pinning 2.7 as the Python version in my Conda
environment with the command mamba create -n bcr python=2.7
conda-forge::gzip.
Thanks again for developing this program.
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB4PHW4E3UPBNBEELTKKYATYP4EO3AVCNFSM6AAAAABCGBIAQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBVGEYTCMBUGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>