def setUp(self):
        cfg = EpacTrainerConfig()
        cfg.debug=True
        testfile_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "testfiles")
        tax_fname = os.path.join(testfile_dir, "test.tax")
        phy_fname = os.path.join(testfile_dir, "test.phy")
        tax = Taxonomy(EpacConfig.REF_SEQ_PREFIX, tax_fname)
        seqs = SeqGroup(sequences=phy_fname, format = "phylip")
        self.inval = InputValidator(cfg, tax, seqs, False)

        self.expected_mis_ids = ["Missing1", "Missing2"]
        self.expected_dups = ["DupSeq(01)", "DupSeq02"]
        self.expected_merges = [self.inval.taxonomy.seq_rank_id(sid) for sid in self.expected_dups]
    def setUp(self):
        cfg = EpacTrainerConfig()
        cfg.debug = True
        testfile_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                    "testfiles")
        tax_fname = os.path.join(testfile_dir, "test.tax")
        phy_fname = os.path.join(testfile_dir, "test.phy")
        tax = Taxonomy(EpacConfig.REF_SEQ_PREFIX, tax_fname)
        seqs = SeqGroup(sequences=phy_fname, format="phylip")
        self.inval = InputValidator(cfg, tax, seqs, False)

        self.expected_mis_ids = ["Missing1", "Missing2"]
        self.expected_dups = ["DupSeq(01)", "DupSeq02"]
        self.expected_merges = [
            self.inval.taxonomy.seq_rank_id(sid) for sid in self.expected_dups
        ]
Beispiel #3
0
            print "or call this script with -no-hmmer option to skip building HMMER profile." 
            config.exit_user_error()
            
def run_trainer(config):
    check_dep(config)
    builder = RefTreeBuilder(config)
    builder.invocation_epac = " ".join(sys.argv)
    builder.build_ref_tree()
        
# -------
# MAIN
# -------
if __name__ == "__main__":
    args = parse_args()
    check_args(args)
    config = EpacTrainerConfig(args)

    print ""
    config.print_version("SATIVA-trainer")

    start_time = time.time()

    run_trainer(config)
    config.clean_tempdir()

    config.log.info("Reference JSON was saved to: %s", os.path.abspath(config.refjson_fname))
    config.log.info("Execution log was saved to: %s\n", os.path.abspath(config.log_fname))

    elapsed_time = time.time() - start_time
    config.log.info("Training completed successfully, elapsed time: %.0f seconds\n", elapsed_time)
Beispiel #4
0

def run_trainer(config):
    check_dep(config)
    builder = RefTreeBuilder(config)
    builder.invocation_epac = " ".join(sys.argv)
    builder.build_ref_tree()


# -------
# MAIN
# -------
if __name__ == "__main__":
    args = parse_args()
    check_args(args)
    config = EpacTrainerConfig(args)

    print ""
    config.print_version("SATIVA-trainer")

    start_time = time.time()

    run_trainer(config)
    config.clean_tempdir()

    config.log.info("Reference JSON was saved to: %s",
                    os.path.abspath(config.refjson_fname))
    config.log.info("Execution log was saved to: %s\n",
                    os.path.abspath(config.log_fname))

    elapsed_time = time.time() - start_time
Beispiel #5
0
 def test_trainer_config(self):
     args = self.get_trainer_namespace()
     cfg = EpacTrainerConfig(args)
     self.check_common_config(cfg)