Cannot read non-existent file: when executing MarkDuplicates in a script
1
0
Entering edit mode
2.7 years ago
ManuelDB ▴ 110

I am running GATK4 MarkDuplicates and when it is run directly in the command line

 gatk MarkDuplicates --INPUT ./minimap2_sort.sam --METRICS_FILE ./dupMetrics.txt --CREATE_INDEX true --OUTPUT ./sorted_rmdupMINIMAP.bam

This works fine. However, if I create a script with exactly the same code I got this error

 To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
htsjdk.samtools.SAMException: Cannot read non-existent file: file:///mainfs/home/mdb1c20/my_onw_NGS_pipeline/scripts_my_first_NGS/comparing_tools/results/assample_results/minipap/to_variants/./minimap_sort.sam 
                                                                  ^^^                                                                                                                          ^

Can you see the 3 ///

GATK4 • 1.8k views
ADD COMMENT
0
Entering edit mode

Are you running MarkDuplicates in the directory that has minimap2_sort.sam?

In other words, I think this file doesn't exist, /mainfs/home/mdb1c20/my_onw_NGS_pipeline/scripts_my_first_NGS/comparing_tools/results/assample_results/minipap/to_variants/minimap_sort.sam, but minimap_sort.sam exists somewhere. To avoid this issue, you could try providing the absolute path to minimap_sort.sam (e.g. --INPUT /mainfs/home/...intermediate_path.../minimap2_sort.sam)

ADD REPLY
0
Entering edit mode

This exist

/mainfs/home/mdb1c20/my_onw_NGS_pipeline/scripts_my_first_NGS/comparing_tools/results/assample_results/minipap/to_variants/minimap_sort.sam

This doesn't

///mainfs/home/mdb1c20/my_onw_NGS_pipeline/scripts_my_first_NGS/comparing_tools/results/assample_results/minipap/to_variants/./minimap_sort.sam

With the absolute path, the 3 /// are added as well

ADD REPLY
0
Entering edit mode

With the absolute path, the 3 /// are added as well

Why is GATK adding ///?

What does "when I create a script" mean? Just a file that you try to submit as bash script.sh with the command in it?

ADD REPLY
0
Entering edit mode

It looks like this is Java's Path class doing this -

Sorry it is not a solution to the file:/// issue since from everything reported, it looks like MarkDuplicates isn't finding a file that exists. If it's a one-off analysis I would try to just add the absolute path.

gatk MarkDuplicates --INPUT /mainfs/home/mdb1c20/my_onw_NGS_pipeline/scripts_my_first_NGS/comparing_tools/results/assample_results/minipap/to_variants/minimap_sort.sam \
    --METRICS_FILE ./dupMetrics.txt --CREATE_INDEX true --OUTPUT ./sorted_rmdupMINIMAP.bam
ADD REPLY

Login before adding your answer.

Traffic: 2781 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6