Example #1
0
def get_eggnog_taxid_info_file():
    return pjoin(get_data_path(), "e5.taxid_info.tsv")
Example #2
0
    parser.add_argument('-y', action="store_true", dest='allyes',
                        help='assume "yes" to all questions')

    parser.add_argument('-f', action="store_true", dest='force',
                        help='forces download even if the files exist')

    parser.add_argument('-s', action="store_true", dest='simulate',
                        help='simulate and print commands. Nothing is downloaded')


    args = parser.parse_args()
    if 'all' in args.dbs:
        args.dbs = EGGNOG_DATABASES

    if args.force or not pexists(pjoin(DATA_PATH, 'eggnog.db')):
        if args.allyes or ask("Download main annotation database?") == 'y':
            print colorify('Downloading "eggnog.db" at %s...' %DATA_PATH, 'green')
            download_annotations()
        else:
            print 'Skipping'

    else:
        print colorify('Skipping eggnog.db database (already present). Use -f to force download', 'lblue')

    if args.force or not pexists(pjoin(DATA_PATH, 'OG_fasta')):
        if args.allyes or ask("Download OG fasta files for annotation refinement (~20GB after decompression)?") == 'y':
            print colorify('Downloading fasta files " at %s/OG_fasta...' %DATA_PATH, 'green')
            download_groups()
        else:
            print 'Skipping'
Example #3
0
def get_eggnog_proteins_file():
    return pjoin(get_data_path(), "e5.proteomes.faa")
Example #4
0
            download_taxid_info(data_path)
        else:
            print(
                colorify(
                    f'eggnog5 taxid info table was not found. Use --data_dir to specify another data path, or allow the download',
                    'red'))
            sys.exit(1)
    else:
        print(
            colorify(
                f'Using existing eggnog5 taxid info table found at {get_eggnog_taxid_info_file()}',
                'green'))

    taxa_set = parse_taxa_table(get_eggnog_taxid_info_file(), args.taxids,
                                args.taxa)
    proteins_out_file = pjoin(get_data_path(), f"{args.dbname}.faa")
    parse_proteins(proteins_out_file, get_eggnog_proteins_file(), taxa_set)

    # generate DB
    dbprefix = None
    if args.mode == "diamond":
        dbprefix = pjoin(get_data_path(), f'{args.dbname}.dmnd')
        create_diamond_db(dbprefix, proteins_out_file)

    elif args.mode == "mmseqs":
        dbdir = pjoin(get_data_path(), f'{args.dbname}.mmseqs')
        dbprefix = pjoin(get_data_path(), f'{args.dbname}.mmseqs',
                         f'{args.dbname}.mmseqs')
        if not os.path.isdir(os.path.realpath(dbdir)):
            os.mkdir(dbdir)
    args = parser.parse_args()

    if "EGGNOG_DATA_DIR" in os.environ:
        set_data_path(os.environ["EGGNOG_DATA_DIR"])

    if args.data_dir:
        set_data_path(args.data_dir)

    # if args.force or not pexists(pjoin(get_data_path(), 'og2level.tsv.gz')):
    #     print colorify('Downloading "og2level.tsv.gz" at %s' %get_data_path(), 'green')
    #     download_og2level()

    # if 'all' in args.dbs:
    #     args.dbs = EGGNOG_DATABASES

    if args.force or not pexists(pjoin(get_data_path(), 'eggnog.db')):
        if args.allyes or ask("Download main annotation database?") == 'y':
            print colorify(
                'Downloading "eggnog.db" at %s...' % get_data_path(), 'green')
            download_annotations()
        else:
            print 'Skipping'

    else:
        if not args.quiet:
            print colorify(
                'Skipping eggnog.db database (already present). Use -f to force download',
                'lblue')

    # if args.force or not pexists(pjoin(get_data_path(), 'OG_fasta')):
    #     if args.allyes or ask("Download OG fasta files for annotation refinement (~20GB after decompression)?") == 'y':
    parser.add_argument('-y', action="store_true", dest='allyes',
                        help='assume "yes" to all questions')

    parser.add_argument('-f', action="store_true", dest='force',
                        help='forces download even if the files exist')

    parser.add_argument('-s', action="store_true", dest='simulate',
                        help='simulate and print commands. Nothing is downloaded')


    args = parser.parse_args()
    if 'all' in args.dbs:
        args.dbs = EGGNOG_DATABASES

    if args.force or not pexists(pjoin(DATA_PATH, 'eggnog.db')):
        if args.allyes or ask("Download main annotation database?") == 'y':
            print colorify('Downloading "eggnog.db" at %s...' %DATA_PATH, 'green')
            download_annotations()
        else:
            print 'Skipping'

    else:
        print colorify('Skipping eggnog.db database (already present). Use -f to force download', 'lblue')

    if args.force or not pexists(pjoin(DATA_PATH, 'OG_fasta')):
        if args.allyes or ask("Download OG fasta files for annotation refinement (~20GB after decompression)?") == 'y':
            print colorify('Downloading fasta files " at %s/OG_fasta...' %DATA_PATH, 'green')
            download_groups()
        else:
            print 'Skipping'
    parser.add_argument('-q',
                        action="store_true",
                        dest='quiet',
                        help='quiet_mode')

    parser.add_argument("--data_dir",
                        metavar='',
                        type=existing_dir,
                        help='Directory to use for DATA_PATH.')

    args = parser.parse_args()

    if args.data_dir:
        set_data_path(args.data_dir)

    if args.force or not pexists(pjoin(get_data_path(), 'og2level.tsv.gz')):
        print colorify('Downloading "og2level.tsv.gz" at %s' % get_data_path(),
                       'green')
        download_og2level()

    if 'all' in args.dbs:
        args.dbs = EGGNOG_DATABASES

    if args.force or not pexists(pjoin(get_data_path(), 'eggnog.db')):
        if args.allyes or ask("Download main annotation database?") == 'y':
            print colorify(
                'Downloading "eggnog.db" at %s...' % get_data_path(), 'green')
            download_annotations()
        else:
            print 'Skipping'