This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Seeing only "N's" in tablet genome viewer?

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?

genome viewer bam

but it still created a bam file nonetheless that was 5 kb in size.

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 header

How 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)

K00333:90:H3TMTBBXY:2:1101:1133:28780   83  NC_000964.3 476475  60  75M =   476412  -138    GAAAAACGGGCGCGGTGAGAGAGTGCCGCGCGAAGTCTGTTATAATAACAGGATGAGCGTGAAAGAAAGAGAAGT     NM:i:1  MD:Z:16T58  MC:Z:75M    AS:i:70 XS:i:0  
K00333:90:H3TMTBBXY:2:1101:1133:28780   163 NC_000964.3 476412  60  75M =   476475  138 NATTCACCAAACATCGCCCTCCGCGCAAACCGTCCCTCACGTCATTTTCTCAGAACTTGACCCGACAACCGGGCG  NM:i:9  MD:Z:0C3A2A12A13A20A5A3A2A6 MC:Z:75M    AS:i:38 XS:i:0

yes, the bai file is in the same directory

0 answers

No answers yet.

Log in to answer this question.