Skip to content

Commit

Permalink
Missing test file tests/test_datatable.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzoic committed Sep 20, 2024
1 parent 7c74148 commit 10694c9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
8 changes: 4 additions & 4 deletions countess/plugins/fastq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down
36 changes: 36 additions & 0 deletions tests/test_datatable.ini
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 10694c9

Please sign in to comment.