Skip to content

Commit

Permalink
Remove unessesary rm command duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
davve2 committed Nov 9, 2020
1 parent 73e84d8 commit 6d872e1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions flextaxd/modules/CreateKrakenDatabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,14 @@ def create_database(self,outdir,keep=False):
logger.info("cp {outdir}/*.map {krakendb}".format(outdir=outdir,krakendb=self.krakendb))
logger.info(self.krakenversion+"-build --build --db {krakendb} {params} --threads {threads}".format(krakendb=self.krakendb, threads=self.build_processes, params=self.params))
os.system(self.krakenversion+"-build --build --skip-maps --db {krakendb} {params} --threads {threads}".format(krakendb=self.krakendb, threads=self.build_processes, params=self.params))

if self.krakenversion in ["kraken2"]:
logger.info("Create inspect file!")
os.system(self.krakenversion+"-inspect --db {krakendb} --report-zero-counts --threads {threads} > {krakendb}/inspect.txt".format(krakendb=self.krakendb,threads=self.build_processes ))
os.system("gzip {krakendb}/*.map".format(krakendb=self.krakendb))
os.system("gzip {krakendb}/inspect.txt".format(krakendb=self.krakendb))
if not keep:
os.system(self.krakenversion+"-build --clean --db {krakendb}".format(outdir=outdir,krakendb=self.krakendb, threads=self.processes))
logger.info("Cleaning up tmp files")
os.system('find {krakendb} -maxdepth 1 -name "*.f*a" -print0 | xargs -0 rm'.format(krakendb=self.krakendb))
# logger.info("Cleaning up tmp files")
# os.system('find {krakendb} -maxdepth 1 -name "*.f*a" -print0 | xargs -0 rm'.format(krakendb=self.krakendb))
logger.info("{krakenversion} database created".format(krakenversion=self.krakenversion))

0 comments on commit 6d872e1

Please sign in to comment.