Skip to content

Commit

Permalink
reduce sniffer data content
Browse files Browse the repository at this point in the history
  • Loading branch information
tdayris committed Jan 16, 2024
1 parent 8a3cb2f commit 720e4c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
* Snakemake-wrappers up to 3.3.3
* Snakemake 8+ compatibility

## Fix:

* csv.Sniffer getting too much data

# 2.2.7

## Features:
Expand Down
4 changes: 2 additions & 2 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ snakemake.utils.validate(config, "../schemas/config.schema.yaml")
# Load and check samples properties table
sample_table_path: str = config.get("samples", "config/samples.csv")
with open(sample_table_path, "r") as sample_table_stream:
dialect: csv.Dialect = csv.Sniffer().sniff(sample_table_stream.read(1024))
dialect: csv.Dialect = csv.Sniffer().sniff(sample_table_stream.readline())
sample_table_stream.seek(0)

samples: pandas.DataFrame = pandas.read_csv(
Expand All @@ -41,7 +41,7 @@ snakemake.utils.validate(samples, "../schemas/samples.schema.yaml")
genome_table_path: str = config.get("genomes")
if genome_table_path:
with open(genome_table_path, "r") as genome_table_stream:
dialect: csv.Dialect = csv.Sniffer().sniff(genome_table_stream.read(1024))
dialect: csv.Dialect = csv.Sniffer().sniff(genome_table_stream.readline())
genome_table_stream.seek(0)

genomes: pandas.DataFrame = pandas.read_csv(
Expand Down

0 comments on commit 720e4c2

Please sign in to comment.