def index_bwa(self):
"""
Index reference using bwa
Returns
-------
bool
True if successful
Raises
------
RuntimeError
If return code from external call is not 0
"""
self.logger.info("Creating bwa indices for: {}".format(
self.filepath))
bwa_idx_start = time.time()
rc = subprocess.call([self.bwa, "index", self.filepath])
if rc == 0:
self.logger.info(
"BWA indexing complete. Elapsed time: {} seconds".format(
time.time() - bwa_idx_start))
return True
else:
self.logger.error(
"Unable to create bwa indices for {}. Exiting".format(
self.filepath))
logging.shutdown()
raise RuntimeError("Unable to create bwa indicies. Exiting")
评论列表
文章目录