|
36 | 36 | import lib.BtCore as bt
|
37 | 37 | import lib.BtLog as BtLog
|
38 | 38 | import lib.BtIO as BtIO
|
39 |
| -from os.path import basename, isfile, join, dirname |
| 39 | +import os.path |
40 | 40 |
|
41 | 41 |
|
42 | 42 | if __name__ == '__main__':
|
43 | 43 | ASSEMBLY_TYPES = [None, 'spades', 'soap', 'abyss', 'velvet']
|
44 |
| - main_dir = dirname(__file__) |
| 44 | + main_dir = os.path.dirname(__file__) |
45 | 45 | #print data_dir
|
46 | 46 | args = docopt(__doc__)
|
47 | 47 | #print args
|
|
60 | 60 | names_f = args['--names']
|
61 | 61 | nodes_f = args['--nodes']
|
62 | 62 | taxrules = args['--taxrule']
|
63 |
| - title = args['--title'] if (args['--title']) else basename(".".join(fasta_f.split('.')[0:-1])) |
| 63 | + title = args['--title'] if (args['--title']) else os.path.basename(".".join(fasta_f.split('.')[0:-1])) |
64 | 64 |
|
65 | 65 |
|
66 | 66 | # Do files exist ?
|
67 | 67 | files = [x for x in list([fasta_f] + sam_fs + bam_fs + cov_fs + cas_fs + [names_f] + [nodes_f] + hit_fs) if x is not None]
|
68 | 68 | for f in files:
|
69 |
| - if not isfile(f): |
| 69 | + if not os.path.isfile(f): |
70 | 70 | BtLog.error('0', f)
|
71 | 71 |
|
72 | 72 | # Is taxonomy provided?
|
73 | 73 | if nodesDB_f == "data/nodesDB.txt":
|
74 |
| - nodesDB_f = join(main_dir, nodesDB_f) |
75 |
| - if not isfile(nodesDB_f) and not ((names_f) and (nodes_f)): |
| 74 | + nodesDB_f = os.path.join(main_dir, nodesDB_f) |
| 75 | + if not os.path.isfile(nodesDB_f) and not ((names_f) and (nodes_f)): |
76 | 76 | BtLog.error('3')
|
77 | 77 |
|
78 | 78 | if not (hit_fs):
|
|
107 | 107 | nodesDB, nodesDB_f = BtIO.getNodesDB(nodes=nodes_f, names=names_f, nodesDB=nodesDB_f)
|
108 | 108 | blobDb.nodesDB_f = nodesDB_f
|
109 | 109 |
|
110 |
| - if not isfile(nodesDB_f): |
| 110 | + if not os.path.isfile(nodesDB_f): |
111 | 111 | print BtLog.status_d['5'] % nodesDB_f
|
112 | 112 | BtIO.writeNodesDB(nodesDB, nodesDB_f)
|
113 | 113 |
|
|
0 commit comments