From 55a15adcdb8c9ca2203e626408844e538f1ce76c Mon Sep 17 00:00:00 2001 From: Brant Faircloth Date: Wed, 4 Oct 2023 14:39:23 -0500 Subject: [PATCH] Fix name clash btw. input() and input Update to Python3 changed the raw_input() function to the input() function, which clashed with the variable `input` used in this code. That caused odd behavior. --- .../phyluce_assembly_explode_get_fastas_file | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/assembly/phyluce_assembly_explode_get_fastas_file b/bin/assembly/phyluce_assembly_explode_get_fastas_file index 1cf6558c..75df9782 100755 --- a/bin/assembly/phyluce_assembly_explode_get_fastas_file +++ b/bin/assembly/phyluce_assembly_explode_get_fastas_file @@ -46,7 +46,10 @@ def get_args(): help="""Split file by taxon and not by locus""", ) parser.add_argument( - "--split-char", type=str, default="_", help="""The character to split on""" + "--split-char", + type=str, + default="_", + help="""The character to split on""", ) return parser.parse_args() @@ -66,13 +69,13 @@ def main(): os.makedirs(args.output) print("Reading fasta...") if not args.by_taxon: - with open(args.input, "rU") as input: - for seq in SeqIO.parse(input, "fasta"): + with open(args.input, "rU") as input_file: + for seq in SeqIO.parse(input_file, "fasta"): uce = seq.id.split(args.split_char)[0] seqdict[uce].append(seq) elif args.by_taxon: - with open(args.input, "rU") as input: - for seq in SeqIO.parse(input, "fasta"): + with open(args.input, "rU") as input_file: + for seq in SeqIO.parse(input_file, "fasta"): taxon = "-".join(seq.id.split(args.split_char)[1:]) seqdict[taxon].append(seq) print("Writing fasta...")