Make sequence splitter compatible with augur v9.0.0+
augur version 9.0.0 changes the API of the `read_sequences` function. This
commit adds support for older versions of augur and the new API.
@@ -15,7 +15,12 @@ if __name__ == "__main__":
args = parser.parse_args()
# Read sequences with augur to benefit from additional checks for duplicates.
- sequences = list(read_sequences(*args.sequences).values())
+ sequences = read_sequences(*args.sequences)
+
+ # Convert dictionary of sequences by id to a list, for compatibility with
+ # augur versions <9.0.0.
+ if isinstance(sequences, dict):
+ sequences = list(sequences.values())
# Create the requested output directory.
output_dir = Path(args.output_dir)
