No @SQ lines in the header
1
1
Entering edit mode
10.7 years ago
tnazlin22 ▴ 10

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 • 13k views
ADD COMMENT
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

You are correct, I've moved it.

ADD REPLY
1
Entering edit mode
10.7 years ago
  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 COMMENT

Login before adding your answer.

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