Example #1
0
def main(num_ranks, num_simulations):

    for i in range(1, num_ranks + 1):

        dir_name = "from_subtree_{i}".format(i=i)
        os.makedirs(dir_name)
        os.chdir(dir_name)

        mylogger.initialize(dir_name)

        prune_subtrees(i, ALIGN, num_simulations)

        os.chdir("../")
Example #2
0
    parser.add_argument('--trimal_gapthreshold',
                        '-trimal',
                        required=False,
                        default=-1,
                        help='gapthreshold of trimal')

    parser.add_argument('--num_simulations',
                        '-n',
                        required=True,
                        help='number of simulations')

    args = parser.parse_args()
    species_list = args.species_list
    output_name = args.output_name
    num_simulations = int(args.num_simulations)
    trimal_gapthreshold = float(args.trimal_gapthreshold)

    mylogger.initialize(output_name)

    logging.info("species list: {}".format(species_list))
    logging.info("output name: {}".format(output_name))
    logging.info("number of simulations: {}".format(num_simulations))
    logging.info(
        "indelible sequences - alinged: {}".format(INDELIBLE_SEQS_ALIGNED))
    logging.info("indelible sequences - not alinged: {}".format(
        INDELIBLE_SEQS_UNALIGNED))
    logging.info("genes: {}".format(", ".join(GENES)))
    logging.info("gapthreshold of trimal: {}".format(trimal_gapthreshold))

    main(species_list, output_name, num_simulations, trimal_gapthreshold)
Example #3
0
    parser.add_argument('-max_gaps',
                        '-max',
                        required=False,
                        default=50,
                        help='max gaps for indelible control file')
    parser.add_argument('-output',
                        '-o',
                        required=False,
                        default=OUTPUT,
                        help='output name of final file')
    parser.add_argument('-paths',
                        action='store_true',
                        help='file contains paths')
    args = parser.parse_args()

    mylogger.initialize("fit_indel_parameters_logfile.csv")
    logging.info("gene name:,{}".format(args.gene))
    logging.info("model file:,{}".format(args.model_file))
    logging.info("tree file:,{}".format(args.tree_file))
    logging.info("num simulations:,{}".format(args.n))
    logging.info("reference alignment:,{}".format(args.ref))
    logging.info("max gaps length:,{}".format(args.ref))
    logging.info("range divided to: {}".format(INTERVALS))

    if args.paths:
        main_paths(args.gene, args.model_file, args.tree_file, args.n,
                   args.ref, args.max_gaps, args.output)
    else:
        main(args.gene, args.model_file, args.tree_file, args.n, args.ref,
             args.max_gaps, args.output)
Example #4
0
        i += 1


def main():

    logging.info("true tree: " + TRUE_TREE)
    logging.info("small tree speicies: " + SMALL_TEEE_SPECIES)
    logging.info("big tree speicies: " + BIG_TEEE_SPECIES)

    small_species = read_species(SMALL_TEEE_SPECIES)
    big_species = read_species(BIG_TEEE_SPECIES)

    logging.info("# species in small tree: " + str(len(small_species)))
    logging.info("# species in big tree: " + str(len(big_species)))

    species_in_big_only = [
        species for species in big_species if species not in small_species
    ]

    lion_in_desert2(small_species, species_in_big_only)


if __name__ == "__main__":

    if len(sys.argv) < 1:
        print "please insert argument"
        sys.exit(0)

    mylogger.initialize(__file__)

    main()
Example #5
0
        os.chdir("../")


if __name__ == "__main__":

    parser = argparse.ArgumentParser(description='')

    parser.add_argument('--ranks',
                        '-r',
                        required=True,
                        help='number of ranks in tree')

    parser.add_argument('--simulations',
                        '-n',
                        required=True,
                        help='number of simulations')

    args = parser.parse_args()
    num_ranks = int(args.ranks)
    num_simulations = int(args.simulations)

    mylogger.initialize("prune_subtrees.logfile")

    logging.info("num ranks: {}".format(num_ranks))
    logging.info("number of simulations: {}".format(num_simulations))
    logging.info("paths of trees: {}".format(TREE_PATH))
    logging.info("paths of species: {}".format(SPECIES_PATH))
    logging.info("alignments aligned by: {}".format(ALIGN))

    main(num_ranks, num_simulations)