bin/bactopia/bactopia-datasets.py
def available_species(dataset_dir):
    """Print species already in the dataset, and exit."""
    summary_json = f'{dataset_dir}/summary.json'
    if os.path.exists(summary_json):
        species_list = []
        with open(summary_json, 'rt') as summary_fh:
            summary_data = json.load(summary_fh)
            for species in summary_data['species-specific'].keys():
                species_list.append(species.capitalize().replace('-', ' '))
        if species_list:
            print(','.join(species_list))
        else:
            print(f'No available species datasets, exiting...', file=sys.stderr)
        sys.exit(0)
    else:
        print(f'Please verify {dataset_dir} contains Bactopia Datasets, exiting...', file=sys.stderr)
        sys.exit(1)
Print species already in the dataset, and exit.
Print species already in the dataset, and exit.
Print species already in the dataset and exit .
def available_species(dataset_dir):
    summary_json = f'{dataset_dir}/summary.json'
    if os.path.exists(summary_json):
        species_list = []
        with open(summary_json, 'rt') as summary_fh:
            summary_data = json.load(summary_fh)
            for species in summary_data['species-specific'].keys():
                species_list.append(species.capitalize().replace('-', ' '))
        if species_list:
            print(','.join(species_list))
        else:
            print(f'No available species datasets, exiting...', file=sys.stderr)
        sys.exit(0)
    else:
        print(f'Please verify {dataset_dir} contains Bactopia Datasets, exiting...', file=sys.stderr)
        sys.exit(1)
def available_species ( dataset_dir ) : summary_json = f'{dataset_dir}/summary.json' if os . path . exists ( summary_json ) : species_list = [ ] with open ( summary_json , 'rt' ) as summary_fh : summary_data = json . load ( summary_fh ) for species in summary_data [ 'species-specific' ] . keys ( ) : species_list . append ( species . capitalize ( ) . replace ( '-' , ' ' ) ) if species_list : print ( ',' . join ( species_list ) ) else : print ( f'No available species datasets, exiting...' , file = sys . stderr ) sys . exit ( 0 ) else : print ( f'Please verify {dataset_dir} contains Bactopia Datasets, exiting...' , file = sys . stderr ) sys . exit ( 1 )
Print species already in the dataset, and exit.
Print species already in the dataset and exit .
"""Print species already in the dataset, and exit."""
dataset_dir