From 10694c994c6031c2537b014e05cda34e5c145c2f Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Fri, 20 Sep 2024 21:07:59 +1000 Subject: [PATCH] Missing test file tests/test_datatable.ini --- countess/plugins/fastq.py | 8 ++++---- tests/test_datatable.ini | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 tests/test_datatable.ini diff --git a/countess/plugins/fastq.py b/countess/plugins/fastq.py index 585b1d5..5400343 100644 --- a/countess/plugins/fastq.py +++ b/countess/plugins/fastq.py @@ -4,8 +4,8 @@ from typing import Iterable, Optional import pandas as pd -from fqfa.fastq.fastq import parse_fastq_reads # type: ignore from fqfa.fasta.fasta import parse_fasta_records # type: ignore +from fqfa.fastq.fastq import parse_fastq_reads # type: ignore from countess import VERSION from countess.core.parameters import BooleanParam, FloatParam, StringParam @@ -24,6 +24,7 @@ def _fastq_reader( "filename": clean_filename(filename), } + class LoadFastqPlugin(PandasInputFilesPlugin): """Load counts from one or more FASTQ files, by first building a dask dataframe of raw sequences with count=1 and then grouping by sequence and summing counts. It supports counting @@ -80,15 +81,14 @@ def read_file_to_dataframe(self, file_params, row_limit=None): return dataframe -def _fasta_reader( - file_handle, row_limit: Optional[int] = None -) -> Iterable[dict[str, str]]: +def _fasta_reader(file_handle, row_limit: Optional[int] = None) -> Iterable[dict[str, str]]: for header, sequence in islice(parse_fasta_records(file_handle), 0, row_limit): yield { "__s": sequence, "__h": header, } + class LoadFastaPlugin(PandasInputFilesPlugin): name = "FASTA Load" description = "Loads sequences from FASTA files" diff --git a/tests/test_datatable.ini b/tests/test_datatable.ini new file mode 100644 index 0000000..89f0bbe --- /dev/null +++ b/tests/test_datatable.ini @@ -0,0 +1,36 @@ +[DataTable] +_module = countess.plugins.data_table +_class = DataTablePlugin +_version = 0.0.69 +_hash = 5d54face788a55338e1873cd0c29820317e805c06f2fe9d95450f3f38153392c +_sort = 0 0 +_position = 500 500 +columns.0.name = 'aaa' +columns.0.type = 'string' +columns.0.index = False +columns.1.name = 'bbb' +columns.1.type = 'number' +columns.1.index = False +columns.2.name = 'ccc' +columns.2.type = 'boolean' +columns.2.index = False +rows.0.aaa = '' +rows.0.bbb = None +rows.0.ccc = False +rows.1.aaa = '' +rows.1.bbb = None +rows.1.ccc = False + +[CSV Save] +_module = countess.plugins.csv +_class = SaveCsvPlugin +_version = 0.0.69 +_hash = eeb7325e4c7649ab971759c5120eb0ffc8684495a4ddc7a4dfb395c3b9cf1e60 +_sort = 0 0 +_position = 581 559 +_parent.0 = DataTable +header = True +filename = None +delimiter = ',' +quoting = False +