Why We have to call from the directory containing all the documents?

Issue #36 new
yangmqglobe created an issue

When my teacher ask me times and times that is the python script have to call in the directory contain it? This make me really confuse and I think that we can call it any where since we give the interpreter the path of the script. After that, I try a lot of python script and I never found a script have to call in the directory contain it. Today, I finally found it!

After the program crushed and I am really curious why ROSE and CRCmapper have to call in the directory contain it? So after I check the exception and now, let's found the way to fix this since ROSE is the usually method to identify super-enhancers and there won't be me, the only one who hate that the have to call ROSE in the directory contain it.

So why ROSE have to call in the directory contain it? For example in the line 335-342 in ROSE_main.py, here, we use os.getcwd() to find out that where are we and find out the annotation file's path. But in this way, we have to call ROSE in the directory contain annotation folder which is the directory contain ROSE, too. It means that the program have to find out the annotation file, and this way definitely limit user to call ROSE where they are.

To fix this problem, we can use the build-in attribute __file__, this attribute contain the path of the current script, so I think cwd = os.path.dirname(__file__) will fix a lot of problems.

Comments (0)

  1. Log in to comment