Question: No @SQ lines in the header
1
gravatar for tnazlin22
4.1 years ago by
tnazlin2210
tnazlin2210 wrote:

Hi all..

I'm stuck at the path where I'm about to call mitochondrial region (ChrM) from the whole genome sequencing data.

I have gone through the fastq, alignment and now I'm going deeper; calling ChrM out (because I'm specifically want to use mitochondrial region only for my study).

What I did was;

1) I have sorted .bam file, the command was like:

samtools sort unsorted_in.bam sorted_out

2) Then I converted the sorted .bam file into .sam. The command was:

samtools view -h file.bam > file.sam

3) After that, I have indexed sorted.bam file and the command was:

samtools index sorted.bam

Everything seems okay until I run the command to call ChrM region. The command for calling ChrM that I have used was this one:

samtools view -h sorted.bam | awk '$3== "chrM" || /n@/' | samtools view -Sb -> chrM.bam.sorted.bam

So, I typed this in the terminal and it appeared:

ws04@empress:/srv/disk01/Tools/samtools-0.1.19$ samtools view -h /srv/disk01/Postgraduates/OrangAsli/KS12R/Alignments/KS12R_sorted.bam.bam | awk '$3=="chrM" || /n@/' | samtools view -Sb -> /srv/disk01/Postgraduates/OrangAsli/KS12R/ChrM/KS12R_chrM.bam.sorted.bam [samopen] no @SQ lines in the header. [sam_read1] missing header? Abort!

I have tried more than twice but it's still the same. What does it mean with 'no @SQ lines in the header?'

I hope you guys can help me. Thank you in advance and glad to hear from you guys soon.

Thanks again, Lynn.

sequence • 1.9k views
ADD COMMENTlink modified 4.1 years ago • written 4.1 years ago by tnazlin2210
1

I think that this is should be posted as "question" not forum. :)

ADD REPLYlink written 4.1 years ago by iraun3.5k

You are correct, I've moved it.
 

ADD REPLYlink written 4.1 years ago by Devon Ryan88k

Hi. Sorry that I have posted at the wrong place :)

Thanks for your suggestion. I'll do it! 

Thanks again ^_^

ADD REPLYlink written 4.1 years ago by tnazlin2210
1
gravatar for Devon Ryan
4.1 years ago by
Devon Ryan88k
Freiburg, Germany
Devon Ryan88k wrote:
  1. There's no need to make a SAM file (step 2), especially since you're not using it.
  2. Just use samtools view -b sorted.bam chrM > chrM.sorted.bam

BTW, the problem was the /n@/ part of your command. Had you used /^@/ then you would have been fine, though that's still much slower than what I showed above.

ADD COMMENTlink modified 4.1 years ago • written 4.1 years ago by Devon Ryan88k
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: 1476 users visited in the last hour