Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load BED file with skgenome #899

Open
EfraMP opened this issue Jul 19, 2024 · 0 comments
Open

Unable to load BED file with skgenome #899

EfraMP opened this issue Jul 19, 2024 · 0 comments

Comments

@EfraMP
Copy link

EfraMP commented Jul 19, 2024

Hi,

I installed CNVkit (v0.9.11) via Conda. I tried to read a BED file using skgenome, as this:

import skgenome as skg
bed = skg.tabio.read_auto('file.bed')

But got the next output:

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.10/site-packages/skgenome/tabio/util.py", line 9, in wrapper
    return line_parser(line)
  File "/home/user/.local/lib/python3.10/site-packages/skgenome/tabio/bedio.py", line 29, in _parse_line
    return chrom, int(start), int(end), gene, strand
ValueError: invalid literal for int() with base 10: 'chromStart'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python3.10/site-packages/skgenome/tabio/__init__.py", line 111, in read_auto
    return read(infile, fmt or 'tab')
  File "/home/user/.local/lib/python3.10/site-packages/skgenome/tabio/__init__.py", line 75, in read
    dframe = reader(infile, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/skgenome/tabio/bedio.py", line 49, in read_bed
    return pd.DataFrame.from_records(
  File "/home/user/.local/lib/python3.10/site-packages/pandas/core/frame.py", line 2450, in from_records
    first_row = next(data)
  File "/home/user/.local/lib/python3.10/site-packages/skgenome/tabio/util.py", line 11, in wrapper
    raise ValueError("Bad line: %r" % line) from exc
ValueError: Bad line: '#chrom\tchromStart\tchromEnd\tname\tscore\n'

FYI, the BED is just chr, start, end, bin_name and copy number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant