From d0e320059a1bccb0dd1a9705c2c4d59dfb94feec Mon Sep 17 00:00:00 2001 From: HarshitGupta11 <50410275+HarshitGupta11@users.noreply.github.com> Date: Wed, 5 Jun 2019 13:51:31 +0530 Subject: [PATCH] Removed Errors in Reading FastA Files --- read_get_gene_seq.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/read_get_gene_seq.py b/read_get_gene_seq.py index c1221e8..71c9062 100644 --- a/read_get_gene_seq.py +++ b/read_get_gene_seq.py @@ -95,12 +95,14 @@ def read_gene_sequences(df,lsy,data_dir,fname): if gxr not in gene_by_species_dict[species]: gene_by_species_dict[species].append(gxr) - s=[x for x in gene_by_species_dict if len(gene_by_species_dict[x])!=0]#select those species only whose gene sequences we have to read. - s=[x.capitalize() for x in s] + s=[x for x in gene_by_species_dict if len(gene_by_species_dict[x])!=0]#select those species only whose gene sequences we have to read. + s=[x.capitalize() for x in s] - data=read_gene_seq(data_dir,s,gene_by_species_dict) + print(len(s)) - with open("processed/"+fname+".json","w") as file:#save the data - json.dump(data,file) + data=read_gene_seq(data_dir,s,gene_by_species_dict) - return data + with open("processed/"+fname+".json","w") as file:#save the data + json.dump(data,file) + + return data