Mercurial > repos > rv43 > tomo
comparison tomo_setup.py @ 53:d34915cfd997 draft
"planemo upload for repository https://github.com/rolfverberg/galaxytools commit db0affe73093d1bf862c83aad93b375374a7ee11"
author | rv43 |
---|---|
date | Thu, 28 Jul 2022 17:26:54 +0000 |
parents | 1c7f86ab84aa |
children | 71aea0636efe |
comparison
equal
deleted
inserted
replaced
52:1c7f86ab84aa | 53:d34915cfd997 |
---|---|
66 | 66 |
67 # Check input file type | 67 # Check input file type |
68 print(f'inputfiles ({type(args.inputfiles)}):\n{args.inputfiles}') | 68 print(f'inputfiles ({type(args.inputfiles)}):\n{args.inputfiles}') |
69 print(f'inputfile_types ({type(args.inputfile_types)}):\n{args.inputfile_types}') | 69 print(f'inputfile_types ({type(args.inputfile_types)}):\n{args.inputfile_types}') |
70 if isinstance(args.inputfile_types, list): | 70 if isinstance(args.inputfile_types, list): |
71 if args.inputfile_types[0] == 'collection': | 71 if if len(args.inputfile_types) == 1 and args.inputfile_types[0] == 'collection': |
72 input_as_collection = True | 72 if len(args.inputfiles) != 1 or args.inputfiles[0] != 'inputfiles.txt': |
73 if len(args.inputfiles) != 1 or args.inputfiles[0] != inputfiles.txt: | |
74 raise ValueError('Inconsistent inputfiles and inputfile_types:\n'+ | 73 raise ValueError('Inconsistent inputfiles and inputfile_types:\n'+ |
75 f'inputfiles ({type(inputfiles)}):\n{inputfiles}\n'+ | 74 f'inputfiles ({type(inputfiles)}):\n{inputfiles}\n'+ |
76 f'inputfile_types ({type(inputfile_types)}):\n{inputfile_types}') | 75 f'inputfile_types ({type(inputfile_types)}):\n{inputfile_types}') |
76 input_as_collection = True | |
77 else: | 77 else: |
78 if len(args.inputfiles) != len(args.inputfile_types): | |
79 raise ValueError('Inconsistent inputfiles and inputfile_types:\n'+ | |
80 f'inputfiles ({type(inputfiles)}):\n{inputfiles}\n'+ | |
81 f'inputfile_types ({type(inputfile_types)}):\n{inputfile_types}') | |
78 input_as_collection = False | 82 input_as_collection = False |
79 else: | 83 else: |
80 raise ValueError(f'Invalid args.inputfile_types: {args.inputfile_types} '+ | 84 raise ValueError(f'Invalid args.inputfile_types: {args.inputfile_types} '+ |
81 f'{type(args.inputfile_types)}') | 85 f'{type(args.inputfile_types)}') |
82 | 86 |
83 datasets = [] | 87 datasets = [] |
84 collections = [] | 88 collections = [] |
85 if input_as_collection: | 89 if input_as_collection: |
86 # Read input file collections and collect data files info | 90 # Read input file collections and collect data files info |
87 with open(args.inputfiles) as cf: | 91 with open(args.inputfiles[0]) as cf: |
88 for line in cf: | 92 for line in cf: |
89 if not line.strip() or line.startswith('#'): | 93 if not line.strip() or line.startswith('#'): |
90 continue | 94 continue |
91 fields = [x.strip() for x in line.split('\t')] | 95 fields = [x.strip() for x in line.split('\t')] |
92 filepath = fields[0] | 96 filepath = fields[0] |