try: if utils.is_wgs_set(accession): if output_format is not None: sequenceGet.check_format(output_format) sequenceGet.download_wgs(dest_dir, accession, output_format) elif not utils.is_available(accession): sys.stderr.write('ERROR: Record does not exist or is not available for accession provided\n') sys.exit(1) elif utils.is_sequence(accession): if output_format is not None: sequenceGet.check_format(output_format) sequenceGet.download_sequence(dest_dir, accession, output_format, expanded) elif utils.is_analysis(accession): if output_format is not None: readGet.check_read_format(output_format) readGet.download_files(accession, output_format, dest_dir, fetch_index, fetch_meta, aspera) elif utils.is_run(accession) or utils.is_experiment(accession): if output_format is not None: readGet.check_read_format(output_format) readGet.download_files(accession, output_format, dest_dir, fetch_index, fetch_meta, aspera) elif utils.is_assembly(accession): if output_format is not None: assemblyGet.check_format(output_format) assemblyGet.download_assembly(dest_dir, accession, output_format, fetch_wgs, extract_wgs, expanded) else: sys.stderr.write('ERROR: Invalid accession provided\n') sys.exit(1) print 'Completed' except Exception: traceback.print_exc()
if utils.is_wgs_set(accession): if format is not None: sequenceGet.check_format(format) sequenceGet.download_wgs(dest_dir, accession, format) elif not utils.is_available(accession): print( 'Record does not exist or is not available for accession provided' ) sys.exit(1) elif utils.is_sequence(accession): if format is not None: sequenceGet.check_format(format) sequenceGet.download_sequence(dest_dir, accession, format) elif utils.is_analysis(accession): if format is not None: readGet.check_read_format(format) readGet.download_files(accession, format, dest_dir, fetch_index, fetch_meta, aspera) elif utils.is_run(accession) or utils.is_experiment(accession): if format is not None: readGet.check_read_format(format) readGet.download_files(accession, format, dest_dir, fetch_index, fetch_meta, aspera) elif utils.is_assembly(accession): if format is not None: assemblyGet.check_format(format) assemblyGet.download_assembly(dest_dir, accession, format, fetch_wgs) else: print('Error: Invalid accession provided') sys.exit(1)