Currently nanomonsv checks if there is a file associated with the BAM path: https://github.com/friend1ws/nanomonsv/blob/40cda8c61f3711cf55d2a9b39c7c3ab31ee4e1ba/nanomonsv/utils.py#L18.
After running
singularity exec nanomonsv_0.5.0--pyhdfd78af_0.sif nanomonsv parse symlinked_file.bam COLO829
I was thrown the error message:
12/16/2022 11:55:31 - nanomonsv.utils - ERROR - Input not exists: symlinked_file.bam
Expected Behaviour:
We expect that a symlinked file is able to return None and proceed with the process.
Additional Testing:
Strangely, with further tests, this was able to return None, but not in the containerized version of NanomonSV.
import os
import sys
import logging
def get_logger(mod_name):
logger = logging.getLogger(mod_name)
logger.propagate = False
if not logger.hasHandlers():
ch = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s', datefmt='%m/%d/%Y %H:%M:%S')
ch.setFormatter(formatter)
logger.addHandler(ch)
logger.setLevel(logging.INFO)
return logger
logger = get_logger(__name__)
def is_exists(input_file):
if not os.path.exists(input_file):
logger.error("Input not exists: %s" % input_file)
sys.exit(1)
def is_exists_bam(input_file):
if input_file.startswith("s3://"):
is_exists_s3(input_file)
else:
is_exists(input_file)
print(os.path.exists('symlinkedfile.bam')) #Returns True
print(os.path.isfile('symlinkedfile.bam')) #Returns True
print(is_exists_bam('symlinkedfile.bam')) #Returns None
print(is_exists_bam('nonsymlinkedpath.py')) #Returns None
print(is_exists_bam('fakefilepath.py')) #Throws sys.arg with logger error
System Info
Bug:
Currently nanomonsv checks if there is a file associated with the BAM path:
https://github.com/friend1ws/nanomonsv/blob/40cda8c61f3711cf55d2a9b39c7c3ab31ee4e1ba/nanomonsv/utils.py#L18
.After running
singularity exec nanomonsv_0.5.0--pyhdfd78af_0.sif nanomonsv parse symlinked_file.bam COLO829
I was thrown the error message:
12/16/2022 11:55:31 - nanomonsv.utils - ERROR - Input not exists: symlinked_file.bam
Expected Behaviour:
We expect that a symlinked file is able to return None and proceed with the process.
Additional Testing:
Strangely, with further tests, this was able to return None, but not in the containerized version of NanomonSV.