• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sequana / sequana / 19136367672

06 Nov 2025 12:56PM UTC coverage: 68.835% (-0.4%) from 69.186%
19136367672

push

github

web-flow
Merge pull request #875 from cokelaer/dev

update HTML variant calling + others

157 of 332 new or added lines in 14 files covered. (47.29%)

5 existing lines in 3 files now uncovered.

14551 of 21139 relevant lines covered (68.83%)

1.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.0
/sequana/scripts/main/fastq_split.py
1
# sequana/cli/fastq_split.py
2
import rich_click as click
3✔
3

4
from sequana import logger
3✔
5
from sequana.fastq_splitter import FastqSplitter
3✔
6

7

8
@click.command(name="fastq-split")
3✔
9
@click.argument("input_fastq", type=click.Path(exists=True))
3✔
10
@click.option("--by-size", type=int, help="Split file into chunks of N reads each.")
3✔
11
@click.option("--by-part", type=int, help="Split file into N equal parts.")
3✔
12
@click.option(
3✔
13
    "--pattern",
14
    default="output.#.fastq.gz",
15
    show_default=True,
16
    help="Output filename pattern (use # as placeholder for chunk number).",
17
)
18
@click.option("--gzip", "gzip_output", is_flag=True, help="Compress output with gzip.")
3✔
19
@click.option(
3✔
20
    "--buffer-size",
21
    type=int,
22
    default=10000,
23
    show_default=True,
24
    help="Number of reads to buffer before writing to disk.",
25
)
26
def fastq_split(input_fastq, by_size, by_part, pattern, gzip_output, buffer_size):
3✔
27
    """
28
    Split a FASTQ file into smaller parts (by number of reads or by number of parts).
29

30
    Examples:
31

32
        sequana fastq-split reads.fastq --by-size 1000000 --pattern chunk.#.fastq.gz
33

34
        sequana fastq-split reads.fastq.gz --by-part 10 --pattern sample.#.fastq.gz
35
    """
NEW
36
    if (by_size and by_part) or not (by_size or by_part):
×
NEW
37
        raise click.UsageError("Use either --by-size or --by-part, not both.")
×
38

NEW
39
    splitter = FastqSplitter(input_fastq)
×
40

NEW
41
    if by_size:
×
NEW
42
        logger.info(f"Splitting {input_fastq} into chunks of {by_size} reads each.")
×
NEW
43
        splitter.by_size(by_size, pattern, gzip_output, buffer_size)
×
44
    else:
NEW
45
        logger.info(f"Splitting {input_fastq} into {by_part} equal parts.")
×
NEW
46
        splitter.by_part(by_part, pattern, gzip_output, buffer_size)
×
47

NEW
48
    logger.info("Splitting completed successfully.")
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc