sara-javadzadeh / FastViFi

Detect viral infection and integration sites on NGS input. Manuscript is in preparation.
GNU General Public License v3.0
10 stars 2 forks source link

"run_kraken_vifi_pipeline.py" becomes a directory #16

Closed hiuchi closed 3 months ago

hiuchi commented 3 months ago

Thank you for providing excellent software. I am tripping at the beginning.

I am trying to use FastViFi with docker, but my understanding is that test_fastvifi.sh is not available with the docker option. So I have execute the following code

python /home/hiuchi/sw/FastViFi/run_kraken_vifi_container.py \
       --docker \
       --input-file /data1/WES/data/fastq/Cx1_S1_L005_R1_001.fastq.gz \
       --input-file-2 /data1/WES/data/fastq/Cx1_S1_L005_R2_001.fastq.gz \
       --skip-bwa-filter \
       --output-dir /data1/WES/240620_FastViFi/res/ \
       --virus hpv \
       --kraken-db-path /data1/WES/FastViFi_db/kraken_datasets/ \
       --vifi-viral-ref-dir /data1/WES/FastViFi_db/viral_data/ \
       --human-chr-list /data1/WES/FastViFi_db/chr.txt \
       --vifi-human-ref-dir /data1/WES/FastViFi_db/data_repo

And this command outputs the following error.

Changing the mode of the output directory to be writable by other users (i.e., the user in the docker container)
docker run --rm --read-only -v /data1/WES/data/fastq/Cx1_S1_L005_R1_001.fastq.gz:/home/input/Cx1_S1_L005_R1_001.fastq.gz --read-only -v /data1/WES/data/fastq/Cx1_S1_L005_R2_001.fastq.gz:/home/input/Cx1_S1_L005_R2_001.fastq.gz --read-only -v /data1/WES/FastViFi_db/:/home/kraken2-db --read-only -v /data1/WES/FastViFi_db/:/home/data_repo/ --read-only -v /data1/WES/FastViFi_db/:/home/repo/data/ -v /data1/WES/240620_FastViFi/run_kraken_vifi_pipeline.py:/home/fastvifi/run_kraken_vifi_pipeline.py -v /data1/WES/240620_FastViFi/res/:/home/output --user $(id -u):$(id -g) sarajava/fastvifi:v1.2.1 python /home/fastvifi/run_kraken_vifi_pipeline.py --kraken-path /home/kraken2/kraken2 --vifi-path /home/ViFi/scripts/run_vifi.py --output /home/output --human-chr-list /home/data_repo/GRCh38/chrom_list.txt --kraken-db-path /home/kraken2-db --min-hybrid-support 4 --docker --virus hpv --input-file /home/input/Cx1_S1_L005_R1_001.fastq.gz --input-file-2 /home/input/Cx1_S1_L005_R2_001.fastq.gz  --skip-bwa-filter  --threads 1 --skip-kraken-filters
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/data1/WES/240620_FastViFi/run_kraken_vifi_pipeline.py" to rootfs at "/home/fastvifi/run_kraken_vifi_pipeline.py": mount /data1/WES/240620_FastViFi/run_kraken_vifi_pipeline.py:/home/fastvifi/run_kraken_vifi_pipeline.py (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
Traceback (most recent call last):
  File "/home/hiuchi/sw/FastViFi/run_kraken_vifi_container.py", line 105, in <module>
    call_fastvifi_pipeline(args)
  File "/home/hiuchi/sw/FastViFi/run_kraken_vifi_container.py", line 98, in call_fastvifi_pipeline
    shell_output = subprocess.check_output(
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hiuchi/sw/miniconda3/lib/python3.12/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hiuchi/sw/miniconda3/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'docker run --rm --read-only -v /data1/WES/data/fastq/Cx1_S1_L005_R1_001.fastq.gz:/home/input/Cx1_S1_L005_R1_001.fastq.gz --read-only -v /data1/WES/data/fastq/Cx1_S1_L005_R2_001.fastq.gz:/home/input/Cx1_S1_L005_R2_001.fastq.gz --read-only -v /data1/WES/FastViFi_db/:/home/kraken2-db --read-only -v /data1/WES/FastViFi_db/:/home/data_repo/ --read-only -v /data1/WES/FastViFi_db/:/home/repo/data/ -v /data1/WES/240620_FastViFi/run_kraken_vifi_pipeline.py:/home/fastvifi/run_kraken_vifi_pipeline.py -v /data1/WES/240620_FastViFi/res/:/home/output --user $(id -u):$(id -g) sarajava/fastvifi:v1.2.1 python /home/fastvifi/run_kraken_vifi_pipeline.py --kraken-path /home/kraken2/kraken2 --vifi-path /home/ViFi/scripts/run_vifi.py --output /home/output --human-chr-list /home/data_repo/GRCh38/chrom_list.txt --kraken-db-path /home/kraken2-db --min-hybrid-support 4 --docker --virus hpv --input-file /home/input/Cx1_S1_L005_R1_001.fastq.gz --input-file-2 /home/input/Cx1_S1_L005_R2_001.fastq.gz  --skip-bwa-filter  --threads 1 --skip-kraken-filters' returned non-zero exit status 125.

Also, a directory (not a file) named "run_kraken_vifi_pipeline.py" has been created in the current directory. Could you please help me?

sara-javadzadeh commented 3 months ago

Hi,

Thanks for bringing this up. Could you please share what is your operating system and what is the version of Docker you are using?

Also could you please try removing the FastViFi container? You can run docker ps -a to view all the locally downloaded / or locally built containers. Then you can run docker rm -v <container_name> to remove the corresponding Fastvifi container.

Docker will download the image again, when you run FastViFi.

Please let me know if you see an error after running this.

Best, Sara

hiuchi commented 3 months ago

Thanks for the reply.

After removing, I have pulled both sarajava/fastvifi:v1.2.1 and sarajava/fastvifi:v1.2.2 with the same result. Here is the OS.

$  lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:    22.04
Codename:   jammy

regards,

sara-javadzadeh commented 3 months ago

That is very strange. I have not seen a similar error before. Removing the container was the recommendation in case the run_kraken_vifi_pipeline.py was not there before, when you ran the run_kraken_vifi_container.py the first time. But I do not think that it is likely to happen, as both files are present at the same time in the FastViFi directory the you clone the repository.

Did you also include the -v in docker rm -v <container id> when removing the container? The -v will remove any volumes associated with the container and that's what we are planning to do here.

If adding the -v flag did not work, I suggest you comment out this line just to see if the problem persists or not. But ideally, I would not expect such an error, even with the current version.

Best, Sara

hiuchi commented 3 months ago

Thanks, I have tried the -v option and commenting out but it doesn't seem to work. I will try to isolate the problem on another OS or machine.

regards,