Question: Samtools give this error
0
gravatar for kmkdesilva
3.8 years ago by
kmkdesilva80
United States
kmkdesilva80 wrote:

Hi all,

I am trying to align some fastq files to a reference genome. I am very new to this work. When I run this code it gives the following error. I do not understand the reason for this.

CODE ->

/home/kkdesi01/samtools-1.3.1/samtools sort /scratch/global/kkdesi01/NGS_Class/animals/Twilight/WGS/bwaDir/SRR1055837.bam -T /scratch/global/kkdesi01/NGS_Class\
/animals/Twilight/WGS/bwaDir/SRR1055837.sorted -o scratch/global/kkdesi01/NGS_Class/animals/Twilight/WGS/bwaDir/SRR1055837.sorted.bam

/home/kkdesi01/samtools-1.3.1/samtools index /scratch/global/kkdesi01/NGS_Class/animals/Twilight/WGS/bwaDir/SRR1055837.sorted.bam

ERROR message ->

[E::hts_open_format] fail to open file 'scratch/global/kkdesi01/NGS_Class/animals/Twilight/WGS/bwaDir/SRR1055837.sorted.bam'
[bam_merge_core2] failed to create "scratch/global/kkdesi01/NGS_Class/animals/Twilight/WGS/bwaDir/SRR1055837.sorted.bam": No such file or directory
[E::hts_open_format] fail to open file '/scratch/global/kkdesi01/NGS_Class/animals/Twilight/WGS/bwaDir/SRR1055837.sorted.bam'
samtools index: failed to open "/scratch/global/kkdesi01/NGS_Class/animals/Twilight/WGS/bwaDir/SRR1055837.sorted.bam": No such file or directory

Can some one please help me to resolve this. I am using SAmtools 1.3.1 Thank you in advance

Kalpi

samtools • 5.6k views
ADD COMMENTlink modified 3.8 years ago • written 3.8 years ago by kmkdesilva80

Now I get this message in the error file.

[bam_sort_core] merging from 303 files...

And my bwaDie looks like this. 
total 224241792
-rw------- 1 kkdesi01 unixuser 138463147124 Jun 18 11:27 SRR1055837.sam
-rw------- 1 kkdesi01 unixuser  51312872276 Jun 18 14:13 SRR1055837.bam
-rw------- 1 kkdesi01 unixuser  39839305515 Jul  1 21:04 SRR1055837.sorted.bam
-rw------- 1 kkdesi01 unixuser      8023696 Jul  1 21:15 SRR1055837.sorted.bam.bai

Can someone please tell me what does this error means. Is it actually an error? Am I done with sorting? Thank you inadvance.

Kalpi

ADD REPLYlink modified 3.8 years ago by genomax80k • written 3.8 years ago by kmkdesilva80
1

Looks like you are all done :-)

Go on to the next step of your analysis.

ADD REPLYlink written 3.8 years ago by genomax80k

Yayy Thank you :D Does it give an error file even it runs correctly.

ADD REPLYlink written 3.8 years ago by kmkdesilva80
1
gravatar for genomax
3.8 years ago by
genomax80k
United States
genomax80k wrote:

You are missing a leading / in the -o directive on your samtools command. Following should work. You should not need the -T since you are already working in that same directory.

/home/kkdesi01/samtools-1.3.1/samtools sort /scratch/global/kkdesi01/NGS_Class/animals/Twilight/WGS/bwaDir/SRR1055837.bam  -o /scratch/global/kkdesi01/NGS_Class/animals/Twilight/WGS/bwaDir/SRR1055837.sorted.bam

The index command looks fine. Once the sorted file gets produced indexing will work.

ADD COMMENTlink modified 3.8 years ago • written 3.8 years ago by genomax80k

Thank you very much. It is running now. Will you please tell me how I can learn these things. Are there any books or tutorials? I really want to know these things better.

Kalpi

ADD REPLYlink written 3.8 years ago by kmkdesilva80
1

Follow this tutorial to acquire unix/command line skills. Only way to become good at this is to practice :-)

ADD REPLYlink modified 3.8 years ago • written 3.8 years ago by genomax80k

Yes I will start there. Thank you

ADD REPLYlink written 3.8 years ago by kmkdesilva80
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1862 users visited in the last hour