Skip to content
Snippets Groups Projects

Resolve "erreur avec le script d'accés au données de genbank"

Merged Mouhamadou Ba requested to merge 75-erreur-avec-le-script-d-acces-au-donnees-de-genbank into dev
2 files
+ 9
6
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -45,7 +45,10 @@ def get_values(record):
if feature.type == 'source':
# TaxID
taxID = feature.qualifiers['db_xref'][0].replace('taxon:', '')
if 'db_xref' in feature.qualifiers:
taxID = feature.qualifiers['db_xref'][0].replace('taxon:', '')
else:
taxID = 0
# Strain
if 'strain' in feature.qualifiers:
@@ -127,7 +130,7 @@ if __name__ == '__main__':
# --- Ecriture --- #
#if (source != "" or host != "" or country != "") and taxID in dict_ncbi :
if (source != "" or host != "") and taxID in dict_ncbi :
if (source != "" or host != "") and taxID != 0 and taxID in dict_ncbi :
#outfile.write(accession + "\t" + str(length) + "\t" + species + "\t" + strain + "\t" + taxID + "\t" + journal + "\t" + source + "\t" + host + "\t" + country + " \n")
outfile.write(accession + "\t" + str(length) + "\t" + species + "\t" + strain + "\t" + taxID + "\t" + journal + "\t" + source + "\t" + host + " \n")
ok += 1
Loading