Пример #1
0
import argparse
import os
from pathlib import Path

import scripts
from config.settings import setup_logging
from scripts import rename_debug_images
from scripts.prep_manual_re_extract import prep_for_manual_extraction
from scripts.set_active_workspace import get_workspace_choices

setup_logging()

parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()


class FixPathAction(argparse.Action):
    # thanks DFL
    def __call__(self, parser, namespace, values, option_string=None):
        setattr(namespace, self.dest,
                Path(os.path.abspath(os.path.expanduser(values))))


def run_choose_workspace(args):
    scripts.set_active_workspace.choose_workspace(
        show_workspace=args.show_workspace)


p = subparsers.add_parser(
    'choose_workspace',
    help="Set the current workspace for use by the DFL batch scripts")
Пример #2
0
"""
The full pipeline for generating simulated population reads for unit testing.
Usage:  python sim_pipeline.py [config file]
"""

import subprocess
import os
import logging
import sys
import ConfigParser
import hyphy.hyphy_handler as hyphy_handler
import fasttree.fasttree_handler as fasttree_handler
import config.settings as settings

settings.setup_logging()
LOGGER = logging.getLogger(__name__)


def get_path_str(path, pardir):
    """
    If absolute path, then returns the path as is.
    If relative path, then returns absolute path of concatenated pardir/path
    :param str path:  absolute or relative file or directory path
    :param str pardir: parent directory to concatenate to path if path is relative directory
    :return str: absolute resolved path
    """
    if not os.path.isabs(path):
        return os.path.join(pardir, path)
    else:
        return path
Пример #3
0
import csv
import glob
import os
import hyphy.hyphy_handler as hyphy_handler
import Bio.SeqIO as SeqIO
import re
import math
import fnmatch
from collections import namedtuple
import config.settings as settings
import logging
import multiprocessing
import subprocess
import Bio.Phylo as Phylo
from test.test_topology import TestTopology
settings.setup_logging()
import tempfile
import run_sliding_window_tree as simulator
from argparse import ArgumentParser
from test.simulations.SimData import SimData
import scipy.stats

LOGGER = logging.getLogger(__name__)
LOGGER.propagate = 1

PROCS = 10


def get_tree_len_depth(treefilename, polytomy_brlen_thresh=0.0):
    """
    Returns tuple of (sum of all branch lengths in tree (excluding root branch), deepest root to tip distance)