Entering edit mode
5.2 years ago
tuj92050
•
0
I downloaded a bam file of an exome sequence from the 1000 genome project website and ran samtools view to extract chromosome 22. My command was
samtools view -b NA20515.bam 22 > chr22.bam
I received the message random alignment retrieval only works for indexed BAM or CRAM files
but it still created a bam file nonetheless that was 5 kb in size. I then ran samtools index chr22.bam
to create the indexed bam file. I want to map the reads in Tablet genome viewer, so I load the chr22 bam file with the reference genome in Tablet, but when I visualize all of the reads in tablet all I see are N's. Did I do something wrong with samtools?
Did you check by doing
samtools view chr22.bam | less
to make sure there are actually alignments in it? Perhaps you only created a file with the header, which is otherwise empty.If it's only header, s/he needs
samtools view -h chr22.bam
to see the headerHow would I know that it actually has alignments in it?
You should see lines like this (apologies for borrowing the data from a recent unrelated thread)
do you have the file
NA20515.bam.bai
?yes, the bai file is in the same directory