Want to create a new Index file for BAM using SAMTOOLS. Do I need to sort the default BAM file from Dante Labs First?
1
0
Entering edit mode
3.9 years ago
Umesh • 0

In hopes of getting more tools to play with my BAM file, I took the plunge to install Ubuntu on my W-10. I also installed all of the tools mentioned in a handy guide provided by RandyH (https://docs.google.com/document/d/1Yg4oRDCIQr5RoTZqECPYFDZxoxN-hggXKxy9BVDQpnY/edit#). My process was not exactly the same as he had mentioned, and I tweaked it by googling the steps(eg by using chocolatey to install lxrunoffline), but I think the end result is the same. I did install samtools using conda (using a post from him on this forum), but had to face an issue which was ultimately solved by downgrading openssl to version 1.0

I was reading more about samtools for the purpose of creating an index file for my BAM file, since IGV and Tablet BAM browsers say that Index File is older than BAM file.

However the page at http://quinlanlab.org/tutorials/samtools/samtools.html mentions about sorting the BAM file first before generating an Index. When I check the order using the command on the page, I get an output, but I am not sure what I need to be looking at to check whether the order is correct, or a re-sorting is needed.

Could someone please take a look at the output and tell whether I need to re-sort the file before attempting to re-index or not? Since I am from a medical background, and have very less experience of using command prompt, please forgive any basic mistakes I may be making. I have uploaded the screenshots.

https://img.techpowerup.org/200707/3.jpg

https://img.techpowerup.org/200707/4.jpg

https://img.techpowerup.org/200707/5.jpg

WGSExtract Dante-Labs samtools • 1.5k views
ADD COMMENT
1
Entering edit mode

From the 1st screenshot, I suspect you're using the wrong fasta reference .

enter image description here

Furthermore, the command samtools view -H your.bam | head should show you if the sort-order is coordinate

ADD REPLY
0
Entering edit mode

enter image description hereI've uploaded the result which i get after the command, but i am unsure what numbers represent the coordinates?

Also, the log file of the error which I get in Tablet is here: https://img.techpowerup.org/200707/tablet.jpg

I use a hg-19 fasta file that I downloaded from broadinstitute.org https://img.techpowerup.org/200707/hg-19-fasta.jpg which works fine in IGV. The folder also contains the hg-19 fasta.fai and hg-19fasta.gz.gzi files. Even the BAM opens fine in IGV. However even WGSExtract gives the same notification as Tablet, i.e. Index file is older than BAM File. https://img.techpowerup.org/200707/wgs-extract.jpg

I had upgraded my Sample from 4x to 30x coverage, so maybe Dante forgot to update my bam.bai file.

Thats why I was trying to create a new Index file using samtools.

ADD REPLY
3
Entering edit mode
3.9 years ago

The last screen shot in your post suggests that the files are sorted. Please note that the BAM files appear to use chromosome names like 1 and 2, but in Tablet you're trying to use chr1 and chr2, which will likely cause some issues.

ADD COMMENT

Login before adding your answer.

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