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

sequana / sequana / 11808924106

17 Oct 2024 01:01PM UTC coverage: 73.623% (-1.2%) from 74.78%
11808924106

push

github

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

add somy, improved coverage

204 of 550 new or added lines in 19 files covered. (37.09%)

22 existing lines in 4 files now uncovered.

14009 of 19028 relevant lines covered (73.62%)

2.94 hits per line

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

86.67
/sequana/scripts/main/ribodesigner.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 pathlib
4✔
13
import shutil
4✔
14
import sys
4✔
15

16
import colorlog
4✔
17
import rich_click as click
4✔
18

19
from sequana.ribodesigner import RiboDesigner
4✔
20
from sequana.scripts.common import teardown
4✔
21
from sequana.scripts.utils import CONTEXT_SETTINGS
4✔
22

23
logger = colorlog.getLogger(__name__)
4✔
24

25

26
# =====================================================================================
27
# Ribodepletion custom probes designer
28
# =====================================================================================
29
@click.command(context_settings=CONTEXT_SETTINGS)
4✔
30
@click.argument("fasta", type=click.Path(exists=True))
4✔
31
@click.argument("gff", type=click.Path(exists=True), default=None, required=False)
4✔
32
@click.option(
4✔
33
    "--method", type=click.Choice(["original", "greedy", "spiral", "simple"]), default="original", required=False
34
)
35
@click.option("--output-directory", show_default=True, default="out_ribodesigner", type=click.Path(exists=False))
4✔
36
@click.option(
4✔
37
    "--seq-type", default="rRNA", show_default=True, help="The annotation type (column 3 in gff) to target for probes."
38
)
39
@click.option(
4✔
40
    "--max-n-probes", default=384, show_default=True, type=click.INT, help="The maximum number of probes to design."
41
)
42
@click.option(
4✔
43
    "--force-clustering",
44
    default=False,
45
    is_flag=True,
46
    type=click.BOOL,
47
    show_default=True,
48
    required=False,
49
    help="By default, if number of probes is above 384 (see --max-n-probes) a clustering is performed using an identity threshold (with --identity-step). If not, no clustering is done. You may force the clustering using this option.",
50
)
51
@click.option(
4✔
52
    "--threads", default=4, show_default=True, type=click.INT, help="The number of threads to use for cd-hit-est."
53
)
54
@click.option(
4✔
55
    "--identity-step",
56
    default=0.01,
57
    show_default=True,
58
    type=click.FLOAT,
59
    help="The identity parameters used by cd-hit-est.",
60
)
61
@click.option("--output-image", default=None)
4✔
62
@click.option(
4✔
63
    "--force",
64
    default=False,
65
    is_flag=True,
66
    type=click.BOOL,
67
    show_default=True,
68
    help="If output directory exists, use this option to erase previous results",
69
)
70
def ribodesigner(**kwargs):
4✔
71
    """A tool to design custom ribodepletion probes.
72

73
    This uses a reference genome (FASTA file) and the corresponding annotation
74
    (GFF file). CD-HIT-EST should be installed and in your $PATH.
75
    """
76
    if not shutil.which("cd-hit-est"):
4✔
NEW
77
        logger.error("cd-hit-est not found in PATH. Try to install it with conda, or damona (damona.readthedocs.io)")
×
78
        sys.exit(1)
×
79

80
    RiboDesigner(**kwargs).run(method=kwargs["method"])
4✔
81

82
    if kwargs["output_image"]:
4✔
83
        from pylab import savefig
×
84

85
        savefig("/".join([kwargs["output_directory"], kwargs["output_image"]]))
×
86

87
    teardown(kwargs["output_directory"])
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