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

Sample Sheets >2048 character give Error: Could not determine delimiter (DSL2) #235

Closed
TheodoreMarkulin opened this issue May 18, 2022 · 1 comment
Labels
bug Something isn't working dsl2
Milestone

Comments

@TheodoreMarkulin
Copy link

Description of the bug

When using a particularly large sample sheet the sniff_format function is unable to determine the format of the sample sheet and returns an error. This appears to happen when the size given to handle.read is smaller than the size of the file.

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a large delimited samplesheet, any delimiter works so long as the samplesheet has more than 2048 characters
  2. import check_samplesheet- may need to append its location into your sys.path
  3. Create a pair of Path objects, one for the sample sheet, one for the file output
  4. Run check_samplesheet.check_samplesheet(<IN>, <OUT>)
  5. See error:
Error("Could not determine delimiter")

Additional context

Drastically upping the value given to line 147 in check_samplesheet.py fixes this issue.

def sniff_format(handle):
"""
Detect the tabular format.
Args:
handle (text file): A handle to a `text file`_ object. The read position is
expected to be at the beginning (index 0).
Returns:
csv.Dialect: The detected tabular format.
.. _text file:
https://docs.python.org/3/glossary.html#term-text-file
"""
peek = handle.read(2048)

@TheodoreMarkulin TheodoreMarkulin added the bug Something isn't working label May 18, 2022
@ewels
Copy link
Member

ewels commented May 18, 2022

This was a bug in the nf-core template and should have been fixed in the latest release of nf-core/tools I believe. As such this should be resolved once #233 is merged 👍🏻

x-ref nf-core/tools#1561 and nf-core/tools#1584

@ewels ewels added the dsl2 label Nov 3, 2022
@ewels ewels closed this as completed Nov 3, 2022
@edmundmiller edmundmiller added this to the 2.0.0 milestone Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dsl2
Projects
None yet
Development

No branches or pull requests

3 participants