File: make_predictions.py

package info (click to toggle)
python-seqcluster 1.2.9%2Bds-3
  • links: PTS, VCS
  • area: contrib
  • in suites: bookworm
  • size: 113,624 kB
  • sloc: python: 5,308; makefile: 184; sh: 122; javascript: 55
file content (29 lines) | stat: -rw-r--r-- 803 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
import logging

from seqcluster.libs.read import load_data, write_data
from seqcluster.function.predictions import is_tRNA, run_coral
from seqcluster.libs.utils import safe_dirs

logger = logging.getLogger('predictions')


def predictions(args):
    """
    Create predictions of clusters
    """

    logger.info(args)
    logger.info("Reading sequences")
    out_file = os.path.abspath(os.path.splitext(args.json)[0] + "_prediction.json")
    data = load_data(args.json)
    out_dir = os.path.abspath(safe_dirs(os.path.join(args.out, "predictions")))

    logger.info("Make predictions")
    data = is_tRNA(data, out_dir, args)

    if args.coral:
        logger.info("Make CoRaL predictions")
        run_coral(data, out_dir, args)
    write_data(data[0], out_file)
    logger.info("Done")