I have mapped reads to a reference genome and generated both a sam.gz and vcf files. I would like to visualize the mapping with the Integrative Genomics Viewer (IGV) and I loaded the reference genome in the viewer. When I load the sam.gz files, though, I get the error:
I can see from the Web that the standard file to use is BAM rather than SAM. I am now using Samtools to make the conversion. THe first step is to create an index, but I get the error:
$ samtools index -b V25_chr1_TrmDedMap.sam.gz
[E::sam_index_build3] SAM file "HoVa25.sam.gz" not BGZF compressed
samtools index: failed to create index for "V25_chr1_TrmDedMap.sam.gz"
I followed this post to try and create a bam with index, but again I got an error:
even though I have these fules in the same folder:
How can I load them properly into IGV?
Thank you
Share the output of
file V25_chr1_TrmDedMap.sam.gz
.If it's a text file with gzip compression, use the following commands to convert it into a coordinate-sorted and indexed BAM file.