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

cokelaer / sequana / 7762707327

02 Feb 2024 11:27PM UTC coverage: 75.585% (-0.01%) from 75.599%
7762707327

push

github

cokelaer
Fix test

13829 of 18296 relevant lines covered (75.58%)

3.02 hits per line

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

65.12
/sequana/scripts/main/samplesheet.py
1
#  This file is part of Sequana software
2
#
3
#  Copyright (c) 2016-2020 - Sequana Development Team
4
#
5
#  Distributed under the terms of the 3-clause BSD license.
6
#  The full license is in the LICENSE file, distributed with this software.
7
#
8
#  website: https://github.com/sequana/sequana
9
#  documentation: http://sequana.readthedocs.io
10
#
11
##############################################################################
12
import colorlog
4✔
13
import rich_click as click
4✔
14

15
from sequana.iem import IEM
4✔
16
from sequana.scripts.utils import CONTEXT_SETTINGS
4✔
17

18
logger = colorlog.getLogger(__name__)
4✔
19

20

21
@click.command(context_settings=CONTEXT_SETTINGS)
4✔
22
@click.argument("name", type=click.STRING)
4✔
23
@click.option("--check", is_flag=True, help="")
4✔
24
@click.option("--full-check", is_flag=True)
4✔
25
@click.option("--extract-adapters", is_flag=True)
4✔
26
@click.option("--quick-fix", is_flag=True)
4✔
27
@click.option("--output", default=None)
4✔
28
def samplesheet(**kwargs):
4✔
29
    """Utilities to manipulate sample sheet"""
30
    name = kwargs["name"]
4✔
31
    if kwargs["check"]:
4✔
32
        iem = IEM(name)
4✔
33
        iem.validate()
4✔
34
        logger.info("SampleSheet looks correct")
4✔
35
    elif kwargs["full_check"]:
4✔
36
        iem = IEM(name)
×
37

38
        try:
×
39
            iem.validate()
×
40
        except SystemExit:
×
41
            pass
×
42

43
        checks = iem.checker()
×
44
        for check in checks:
×
45
            if check["status"] == "Error":
×
46
                print(f"\u274C {check['status']}, {check['msg']}")
×
47

48
        for check in checks:
×
49
            if check["status"] == "Warning":
×
50
                print(f"\u26A0 {check['status']}, {check['msg']}")
×
51

52
        for check in checks:
×
53
            if check["status"] == "Success":
×
54
                print(f"\u2714 {check['status']}, {check['msg']}")
×
55

56
    elif kwargs["extract_adapters"]:
4✔
57
        iem = IEM(name)
4✔
58
        iem.to_fasta()
4✔
59
    elif kwargs["quick_fix"]:
4✔
60
        iem = IEM(name)
4✔
61
        if kwargs["output"]:
4✔
62
            filename = kwargs["output"]
4✔
63
        else:  # pragma: no cover
64
            filename = name + ".fixed"
65
        logger.info("Saving fixed version in {}".format(filename))
4✔
66
        iem.quick_fix(output_filename=filename)
4✔
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