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

cokelaer / sequana / 7117302237

06 Dec 2023 04:23PM UTC coverage: 75.482% (+1.8%) from 73.729%
7117302237

push

github

cokelaer
Update version

13709 of 18162 relevant lines covered (75.48%)

2.26 hits per line

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

85.71
/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
3✔
13
import shutil
3✔
14
import sys
3✔
15

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

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

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

25

26
# =====================================================================================
27
# Ribodepletion custom probes designer
28
# =====================================================================================
29
@click.command(context_settings=CONTEXT_SETTINGS)
3✔
30
@click.argument("fasta", type=click.Path(exists=True))
3✔
31
@click.argument("gff", type=click.Path(exists=True), default=None, required=False)
3✔
32
@click.option("--output-directory", show_default=True, default="out_ribodesigner", type=click.Path(exists=False))
3✔
33
@click.option(
3✔
34
    "--seq-type", default="rRNA", show_default=True, help="The annotation type (column 3 in gff) to target for probes."
35
)
36
@click.option(
3✔
37
    "--max-n-probes", default=384, show_default=True, type=click.INT, help="The maximum number of probes to design."
38
)
39
@click.option(
3✔
40
    "--threads", default=4, show_default=True, type=click.INT, help="The number of threads to use for cd-hit-est."
41
)
42
@click.option(
3✔
43
    "--identity-step",
44
    default=0.01,
45
    show_default=True,
46
    type=click.FLOAT,
47
    help="The number of threads to use for cd-hit-est.",
48
)
49
@click.option("--output-image", default=None)
3✔
50
@click.option(
3✔
51
    "--force",
52
    default=False,
53
    is_flag=True,
54
    type=click.BOOL,
55
    show_default=True,
56
    help="If output directory exists, use this option to erase previous results",
57
)
58
def ribodesigner(**kwargs):
3✔
59
    """A tool to design custom ribodepletion probes.
60

61
    This uses a reference genome (FASTA file) and the corresponding annotation
62
    (GFF file). CD-HIT-EST should be installed and in your $PATH.
63
    """
64

65
    if not shutil.which("cd-hit-est"):
3✔
66
        logger.error("cd-hit-est not found in PATH.")
×
67
        sys.exit(1)
×
68

69
    RiboDesigner(**kwargs).run()
3✔
70
    if kwargs["output_image"]:
3✔
71
        from pylab import savefig
×
72

73
        savefig("/".join([kwargs["output_directory"], kwargs["output_image"]]))
×
74

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