Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unicode bug #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mdmcleaner/read_gtdb_taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
refseq_dbsource_dict["crc"] = { "url": "{}/release-catalog/".format(ftp_adress_refseqrelease), "pattern" : "release*.files.installed" } #TODO: add eukaryotic 18S/28S + ITS seqeunces to this! either silva or ncbi?

MD5FILEPATTERN_GTDB = "MD5SUM*"
gtdb_server = "https://data.ace.uq.edu.au/public/gtdb/data/releases/latest"
gtdb_server = "https://data.gtdb.ecogenomic.org/releases/latest"
gtdb_source_dict = { "gtdb_taxfiles" : { "url": "{}/".format(gtdb_server), "pattern" : "{}".format(",".join(["*_taxonomy.tsv", MD5FILEPATTERN_GTDB]))}, \
"gtdb_fastas" : { "url": "{}/genomic_files_reps".format(gtdb_server), "pattern" : "gtdb_genomes_reps.tar.gz,gtdb_proteins_aa_reps.tar.gz" }, \
"gtdb_vs_ncbi_lookup" : { "url" : "{}/auxillary_files".format(gtdb_server), "pattern" : "*_vs_*.xlsx" } } #todo: remove gtdb_vs_ncbi_lookuptables
Expand Down Expand Up @@ -360,7 +360,7 @@ def getsilvaversion(urldict, targetfolder): #yes I know. This could go easier wi
returncode = _download_unixwget(urldict[url] + urldict["wishlist"][0], targetdir=targetfolder, verbose=verbose)
if returncode != 0:
sys.exit("\n\tERROR: can't reach silva database. please try again later\n")
with open(versionfilename) as versionfile:
with open(versionfilename, 'r', encoding='utf-8') as versionfile:
version = versionfile.read().strip()
return version, url
# end of nested subfunctions
Expand Down Expand Up @@ -752,7 +752,7 @@ def _download_dbdata_nonncbi(targetdir, progressdump, verbose=False): #todo: pas
sys.stderr.write("-->already did this step earlier. skipping it now! (delete progress marker '{}' and higher if you want to redo it)\n".format(currentprogressmarker))
sys.stderr.flush()

with openfile(os.path.join(targetdir, "DB_versions.txt"), "wt") as versionsfile:
with openfile(os.path.join(targetdir, "DB_versions.txt"), "wt", encoding='utf-8') as versionsfile:
versionsfile.write("GTDB version = {}\n".format(progressdump["gtdb_version"]))
versionsfile.write("RefSeq release = {}\n".format(progressdump["refseq_release_number"]))
versionsfile.write("silva_download_dict = {}\n".format(progressdump["silva_version"]))
Expand Down