Skip to content

Commit

Permalink
force string conversion of values
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed May 13, 2020
1 parent 4583752 commit d05ed71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/sqlite_NextStrain_tsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Extract Assembly and SRA metadata from an NCBImeta sqlite database to create the tsv input file for NextStrain.
./sqlite_NextStrain_tsv.py \
./sqlite_extract.py \
--database ../results/ncbimeta_db/update/latest/output/database/yersinia_pestis_db.sqlite \
--query "SELECT BioSampleAccession,AssemblyFTPGenbank,SRARunAccession,BioSampleStrain,BioSampleCollectionDate,BioSampleHost,BioSampleGeographicLocation,BioSampleBiovar,PubmedArticleTitle,PubmedAuthorsLastName,AssemblyContigCount,AssemblyTotalLength,NucleotideGenes,NucleotideGenesTotal,NucleotidePseudoGenes,NucleotidePseudoGenesTotal,NucleotiderRNAs,AssemblySubmissionDate,SRARunPublishDate,BioSampleComment FROM Master WHERE (BioSampleComment NOT LIKE '%REMOVE%' AND TRIM(AssemblyFTPGenbank) > '')" \
--no-data-char ? \
Expand Down Expand Up @@ -111,7 +111,7 @@

for record in record_exists:
# Use list comprehension to replace empty DB values with the NextStrain NO_DATA_CHAR
record = [word if word != "" else word.replace("", NO_DATA_CHAR) for word in record]
record = [str(word) if word != "" else word.replace("", NO_DATA_CHAR) for word in record]
out_file.write("\t".join(record) + "\n")


Expand Down

0 comments on commit d05ed71

Please sign in to comment.