Beispiel #1
0
    dest_dir = args.dest
    fetch_wgs = args.wgs
    extract_wgs = args.extract_wgs
    expanded = args.expanded
    fetch_meta = args.meta
    fetch_index = args.index
    aspera = args.aspera
    aspera_settings = args.aspera_settings

    if aspera or aspera_settings is not None:
        aspera = utils.set_aspera(aspera_settings)

    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)
Beispiel #2
0
if __name__ == '__main__':
    parser = set_parser()
    args = parser.parse_args()

    accession = args.accession
    format = args.format
    dest_dir = args.dest
    fetch_wgs = args.wgs
    fetch_meta = args.meta
    fetch_index = args.index
    aspera = args.aspera

    try:
        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)