NabaviLab / CNV-Sim

Copy Number Variations (CNV) Simulator
10 stars 8 forks source link

A problem when use CNV-SIM through docker #10

Open ranneal opened 4 years ago

ranneal commented 4 years ago

Dear Dr.Hosny, I am a postgraduate student, and I was doing the CNV simulation work recently. I found that your package may help me a lot. What I want to simulate is one genome. However, when I followed your suggestion and run the command in docker, an error occurred which said cannot find my reference file. The command and error are posted below:

(base) ran@ran-HP-EliteBook-850-G3:~/Documents/Grace$ sudo docker run -v /home/ran/Documents/Grace/main_project/data nabavilab/cnv-sim ./cnv-sim.py -o /home/ran/Documents/Grace/main_project/data/simulation_output genome /home/ran/Documents/Grace/main_project/data/human_g1k_v37.fasta [sudo] password for ran: Traceback (most recent call last): File "./cnv-sim.py", line 103, in main() File "./cnv-sim.py", line 65, in main args = parser.parse_args() File "/usr/lib/python2.7/argparse.py", line 1690, in parse_args args, argv = self.parse_known_args(args, namespace) File "/usr/lib/python2.7/argparse.py", line 1722, in parse_known_args namespace, args = self._parse_known_args(args, namespace) File "/usr/lib/python2.7/argparse.py", line 1931, in _parse_known_args stop_index = consume_positionals(start_index) File "/usr/lib/python2.7/argparse.py", line 1887, in consume_positionals take_action(action, args) File "/usr/lib/python2.7/argparse.py", line 1780, in take_action argument_values = self._get_values(action, argument_strings) File "/usr/lib/python2.7/argparse.py", line 2220, in _get_values value = self._get_value(action, arg_string) File "/usr/lib/python2.7/argparse.py", line 2249, in _get_value result = type_func(arg_string) IOError: [Errno 2] No such file or directory: '/home/ran/Documents/Grace/main_project/data/human_g1k_v37.fasta'

I have changed different reference fasta files and the location of the reference file, but it still occurred again and again.Could you please give me some suggestions about how to fix the issue and get a success simulation result? Thanks a lot! Looking forward to your reply.

abdelrahmanhosny commented 4 years ago

Hello @ranneal Thanks for trying out the tool. I think there is a missing part in the docker run command. Specifically, you are missing the path inside the container to mount the data to. So, the command should be:

sudo docker run -v /home/ran/Documents/Grace/main_project/data:/data nabavilab/cnv-sim ./cnv-sim.py -o /data/simulation_output genome /data/human_g1k_v37.fasta

Assuming that the .fasta file is currently under /home/ran/Documents/Grace/main_project/data on your local machine. What this command does is that it maps this directory to a directory inside the docker container at /data. Then, everything should be referenced from /data afterwords.