def _check_outdpath(self): if self.argparse_args.outdir is None: return # end if try: fs.create_dir(self.argparse_args.outdir) except FatalErrors as err: error_msg = '\nError: cannot create directory `{}`:\n {}' \ .format(self.argparse_args.outdir, err) raise FatalError(error_msg)
def _init_output(self): fs.create_dir(self.outdir_path) output_fpaths = ( self.major_outfpath, self.minor_outfpath, self.uncertain_outfpath, ) for outfpath in output_fpaths: fs.init_file(outfpath)
def _init_output(self): fs.create_dir(self.outdir_path) output_fpaths = ( self.frw_outfpath, self.rvr_outfpath, self.frw_unpaired_outfpath, self.rvr_unpaired_outfpath, ) for outfpath in output_fpaths: fs.init_file(outfpath)
def _create_tmp_directory(self): self.tmp_dir_path = os.path.join( self.outdir_path, 'tmp' ) try: fs.create_dir(self.tmp_dir_path) except FatalError as err: print_err('\nError: cannot create temporary directory `{}`' \ .format(self.tmp_dir_path)) print_err(err) print_err('The program will use the root of the output directory' \ ' as a storage of temporary files') self.tmp_dir_path = self.outdir_path
def create_reference_database(kromsatel_args): db_dirpath = os.path.join(kromsatel_args.outdir_path, 'blast_database') fs.create_dir(db_dirpath) db_fpath = os.path.join(db_dirpath, 'kromsatel_blast_database') print('{} - Creating a reference database for BLAST:\n `{}`...'.format( getwt(), db_fpath)) _make_blast_db(kromsatel_args.reference_fpath, db_fpath) print('{} - Database: created'.format(getwt())) if kromsatel_args.use_index: print('{} - Indexing the database...'.format(getwt())) _index_database(db_fpath) print('{} - Index: created'.format(getwt())) else: print('Index will not be created for the database.') # end if return db_fpath
def _init_output(self): fs.create_dir(self.outdir_path) fs.init_file(self.outfpath)