Variants filtering issue

24 views
Skip to first unread message

Riccardo Altea

unread,
Sep 4, 2018, 8:53:11 AM9/4/18
to lobSTR user group
Hello, I'm trying to filter variants from vcf files obtained using lobSTR. I get some errors while calling lobSTR_filter_vcf.py script:

Traceback (most recent call last):
  File "/home/rich/Scrivania/Tool_Espansioni/lobSTR-bin-Linux-x86_64-4.0.6/share/lobSTR/scripts/lobSTR_filter_vcf.py", line 97, in <module>
    reader = vcf.Reader(open(args.vcf, "rb"))
  File "/home/rich/miniconda3/lib/python3.6/site-packages/vcf/parser.py", line 300, in __init__
    self._parse_metainfo()
  File "/home/rich/miniconda3/lib/python3.6/site-packages/vcf/parser.py", line 319, in _parse_metainfo
    while line.startswith('##'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

I don't know Python language, but I found that writing the letter 'b' before '##' should solve my problem. When I do this, I get new error messages:

Traceback (most recent call last):
  File "/home/rich/Scrivania/Tool_Espansioni/lobSTR-bin-Linux-x86_64-4.0.6/share/lobSTR/scripts/lobSTR_filter_vcf.py", line 97, in <module>
    reader = vcf.Reader(open(args.vcf, "rb"))
  File "/home/rich/miniconda3/lib/python3.6/site-packages/vcf/parser.py", line 300, in __init__
    self._parse_metainfo()
  File "/home/rich/miniconda3/lib/python3.6/site-packages/vcf/parser.py", line 353, in _parse_metainfo
    fields = self._row_pattern.split(line[1:])
TypeError: cannot use a string pattern on a bytes-like object

Probably I should not edit the scripts, but I've been trying for over a week and didn't manage to solve this...Any suggestions?

Melissa Gymrek

unread,
Sep 5, 2018, 11:37:54 AM9/5/18
to lobstr-u...@googlegroups.com
Dear Ricardo,
Thanks for your message. I recommend you use the updated HipSTR tool instead:


There are many new features and bug fixes since the last release of lobSTR.
~M

--
You received this message because you are subscribed to the Google Groups "lobSTR user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lobstr-user-gr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

RICCARDO ALTEA

unread,
Sep 7, 2018, 5:58:45 AM9/7/18
to lobstr-u...@googlegroups.com
Thanks for your answer, I was using both tools!

2018-09-05 17:37 GMT+02:00 Melissa Gymrek <melissa...@gmail.com>:
Dear Ricardo,
Thanks for your message. I recommend you use the updated HipSTR tool instead:


There are many new features and bug fixes since the last release of lobSTR.
~M
On Tue, Sep 4, 2018 at 5:53 AM Riccardo Altea <riccardo.altea01@universitadipavia.it> wrote:
Hello, I'm trying to filter variants from vcf files obtained using lobSTR. I get some errors while calling lobSTR_filter_vcf.py script:

Traceback (most recent call last):
  File "/home/rich/Scrivania/Tool_Espansioni/lobSTR-bin-Linux-x86_64-4.0.6/share/lobSTR/scripts/lobSTR_filter_vcf.py", line 97, in <module>
    reader = vcf.Reader(open(args.vcf, "rb"))
  File "/home/rich/miniconda3/lib/python3.6/site-packages/vcf/parser.py", line 300, in __init__
    self._parse_metainfo()
  File "/home/rich/miniconda3/lib/python3.6/site-packages/vcf/parser.py", line 319, in _parse_metainfo
    while line.startswith('##'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

I don't know Python language, but I found that writing the letter 'b' before '##' should solve my problem. When I do this, I get new error messages:

Traceback (most recent call last):
  File "/home/rich/Scrivania/Tool_Espansioni/lobSTR-bin-Linux-x86_64-4.0.6/share/lobSTR/scripts/lobSTR_filter_vcf.py", line 97, in <module>
    reader = vcf.Reader(open(args.vcf, "rb"))
  File "/home/rich/miniconda3/lib/python3.6/site-packages/vcf/parser.py", line 300, in __init__
    self._parse_metainfo()
  File "/home/rich/miniconda3/lib/python3.6/site-packages/vcf/parser.py", line 353, in _parse_metainfo
    fields = self._row_pattern.split(line[1:])
TypeError: cannot use a string pattern on a bytes-like object

Probably I should not edit the scripts, but I've been trying for over a week and didn't manage to solve this...Any suggestions?

--
You received this message because you are subscribed to the Google Groups "lobSTR user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lobstr-user-group+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "lobSTR user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lobstr-user-group+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages