Skip to content

Commit ba704f9

Browse files
committed
bugfix
- limit cov float to three decimals - fix taxify - changed tax file to hits file in help
1 parent d31ea5a commit ba704f9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

bloblib/BtCore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def calculateGC(self, seq):
437437
if self.agct_count > 0 else 0.0)
438438

439439
def addCov(self, lib_name, cov):
440-
self.covs[lib_name] = cov
440+
self.covs[lib_name] = float("{0:.3f}".format(cov)) # changed to three decimal digits
441441

442442
def addReadCov(self, lib_name, read_cov):
443443
self.read_cov[lib_name] = read_cov

bloblib/create.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
"""usage: blobtools create -i FASTA [-y FASTATYPE] [-o PREFIX] [--title TITLE]
55
[-b BAM...] [-s SAM...] [-a CAS...] [-c COV...]
66
[--nodes <NODES>] [--names <NAMES>] [--db <NODESDB>]
7-
[-t TAX...] [-x TAXRULE...] [-m INT] [--tax_collision_random]
7+
[-t HITS...] [-x TAXRULE...] [-m INT] [--tax_collision_random]
88
[-h|--help]
99
1010
Options:
1111
-h --help show this
1212
-i, --infile FASTA FASTA file of assembly. Headers are split at whitespaces.
1313
-y, --type FASTATYPE Assembly program used to create FASTA. If specified,
1414
coverage will be parsed from FASTA header.
15-
(Parsing supported for 'spades', 'soap',
16-
'velvet', 'abyss', 'platanus')
17-
-t, --taxfile TAX... Taxonomy file in format (qseqid\\ttaxid\\tbitscore)
15+
(Parsing supported for 'spades', 'velvet', 'platanus')
16+
-t, --hitsfile HITS... Hits file in format (qseqid\\ttaxid\\tbitscore)
1817
(e.g. BLAST output "--outfmt '6 qseqid staxids bitscore'")
1918
-x, --taxrule <TAXRULE>... Taxrule determines how taxonomy of blobs
2019
is computed [default: bestsum]
@@ -61,7 +60,7 @@ def main():
6160
bam_fs = args['--bam']
6261
cov_fs = args['--cov']
6362
cas_fs = args['--cas']
64-
hit_fs = args['--taxfile']
63+
hit_fs = args['--hitsfile']
6564
prefix = args['--out']
6665
nodesDB_f = args['--db']
6766
names_f = args['--names']

bloblib/taxify.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ def main():
6262
if diamond_f:
6363
output.append("%s\t%s\t%s\t%s" % (line[0], taxid_d[line[1]], line[11], "\t".join(line[1:])))
6464
else:
65-
if line[1] == 'N/A' or force:
65+
if line[1] == 'N/A' or force: # so that it does not overwrite existing taxIDs
6666
output.append("%s\t%s\t%s" % (line[0], taxid_d[line[3]], "\t".join(line[2:5])))
6767
else:
6868
print BtLog.warn_d['10'] % (idx+1, line[0], line[1])
69+
output.append("%s\t%s\t%s" % (line[0], line[1], "\t".join(line[2:5])))
6970

7071
if output:
7172
with open(out_f, "w") as fh:

0 commit comments

Comments
 (0)