This is a test version of Biostars. For the public version, visit https://www.biostars.org.
gatk error: reference file does not exist

hello, I am trying to run gatk cnv caller tutorial and I am facing an error with respect to reference fasta file. I have installed gatk using conda. The code I am trying to run is:

gatk PreprocessIntervals \
    -R ~/tutorial/GRCh38/resources_broad_hg38_v0_Homo_sapiens_assembly38.fasta
    --padding 0 \
    -L ~/tutorial/tutorial_11684/gcnv-chr20XY-contig.list \
    -imr OVERLAPPING_ONLY \
    -O ~/output/chr20XY.interval_list

and the error i am getting is:

A USER ERROR has occurred: The specified fasta file (file:///home/username/tutorial/GRCh38/resources_broad_hg38_v0_Homo_sapiens_assembly38.fasta) does not exist.

Please give some suggestions if there is any error in the code.

preprocessinterval linux gatk

well, the error is quite clear. the path to the file /home/username/tutorial/GRCh38/resources_broad_hg38_v0_Homo_sapiens_assembly38.fasta is wrong. you can check this using

ls /home/username/tutorial/GRCh38/resources_broad_hg38_v0_Homo_sapiens_assembly38.fasta

Please give some suggestions

use the correct path.

i checked and it is working fine without any error. I tried changing the permissions of the file and found error:

A USER ERROR has occurred: Couldn't read file file:///home/username/tutorial/GRCh38/resources_broad_hg38_v0_Homo_sapiens_assembly38.fasta. Error was: File exists but is not readable: file:///home/username/tutorial/GRCh38/resources_broad_hg38_v0_Homo_sapiens_assembly38.fasta.fai

1 answer

Have you checked to see if the file is readable? You can use

ls -lh

If it isn't readable, you can make it so using chmod. For example, you could use

chmod a+r <your_file>

thank you. This helped in solving the error.

Log in to answer this question.