samtools view: failed to open for reading , samtools sort :can't open file
1
0
Entering edit mode
2.4 years ago
maria • 0

Hello,

I'm trying to align fastq files to a reference genome. I am very new to this work. And I got these errors. I don't understand what the problem is.

Can some one please help me to resolve this?Thank you

Code:

#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

SAM="/home/users/maria/project_data/maria/SAM/Precapture_fullSS.sam";
BAM="/home/users/maria/project_data/maria/BAM/";
BED="/home/users/maria/project_data/maria/BED/";

#conda activate samtools

############################### to tmerge without chimeric, unmapped and secondary

samtools view -h -F 2308 ${SAM}Precapture_fullSS.sam > ${SAM}Precapture_fullSS_uniq.sam

samtools view -Sb  ${SAM}Precapture_fullSS_uniq.sam > ${BAM}Precapture_fullSS_uniq_notsorted.bam

samtools sort ${BAM}Precapture_fullSS_uniq_notsorted.bam -o ${BAM}Precapture_fullSS_uniq_sorted.bam

module load bedtools/2.30.0

bedtools bamtobed -bed12 -i ${BAM}Precapture_fullSS_uniq_sorted.bam > ${BED}Precapture_fullSS_uniq.bed12

Error message:

[E::hts_open_format] Failed to open file "/home/users/maria/project_data/maria/SAM/Precapture_fullSS.samPrecapture_fullSS.sam" : No such file or directory
samtools view: failed to open "/home/users/maria/project_data/maria/SAM/Precapture_fullSS.samPrecapture_fullSS.sam" for reading: No such file or directory
/var/lib/slurm-llnl/slurmd/job24798250/slurm_script: line 22: /home/users/maria/grant_566/project_data/maria/BAM/Precapture_fullSS_uniq_notsorted.bam :No such file or directory
[E::hts_open_format] Failed to open file "/home/users/maria/project_data/maria/BAM/Precapture_fullSS_uniq_notsorted.bam" : No such file or directory
samtools sort: can't open "/home/users/maria/project_data/maria/BAM/Precapture_fullSS_uniq_notsorted.bam": No such file or directory
gcc/8.2.0 load complete.
bedtools/2.30.0 load complete.
/var/lib/slurm-llnl/slurmd/job24798250/slurm_script: line 28: /home/users/maria/project_data/maria/BED/Precapture_fullSS_uniq.bed12 No such file or directory
bam sam samtools • 1.7k views
ADD COMMENT
2
Entering edit mode

/home/users/maria/project_data/maria/SAM/Precapture_fullSS.samPrecapture_fullSS.sam" : No such file or directory

the message is quite clear to me. Did you check there is a file here ?

ADD REPLY
0
Entering edit mode

Hello thank you for answering and yes I check there is a file.

ADD REPLY
2
Entering edit mode
2.4 years ago

change the line

SAM="/home/users/maria/project_data/maria/SAM/Precapture_fullSS.sam"

to

SAM="/home/users/maria/project_data/maria/SAM/"

and try again.

ADD COMMENT
0
Entering edit mode

thank you !!

ADD REPLY

Login before adding your answer.

Traffic: 2899 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