Converting BAM files to index files (bam.bai files)
0
1
Entering edit mode
5.3 years ago
babasaraki ▴ 50

Hello All,

Please is there a way I can simply convert BAM files to bam.bai index files through Mac Terminal or Galaxy server?

Thank you for your usual support.

RNA-Seq SNP assembly alignment • 6.4k views
ADD COMMENT
2
Entering edit mode

convert is the not the word to use here, especially given that bai files are indexes to the bam files and without the bam files, the bai files make no sense.

Have you tried googling "index BAM files"? It will show you the tool to use. You can then google "how to install <tool-name> on macOS" and that should get you on the way to solving your own problem.

ADD REPLY
0
Entering edit mode

Thank you Sir for the tips. Let me give it a trial.

ADD REPLY
0
Entering edit mode

Indexing the files is simple using a program called samtools. samtools index your.bam will do that. Do you know if your files are sorted? Generally they are sorted by coordinates. You would need to sort them first (again using samtools sort), if they are not sorted.

What is the end-goal here? You want to view/count or do something else with them?

ADD REPLY
0
Entering edit mode

Thank you. Yes, I want view the files via IGV and observe if there is any variant from the files. All the files are sorted.

ADD REPLY
0
Entering edit mode

You need them sorted and indexed then. Depending on the size of the data sorting on a local machine (use more than one core) may still take some time. You will find the relevant options once you do your research. Ask here if you have questions.

ADD REPLY
0
Entering edit mode

All the bam files are sorted.

ndv11_S16_L006.sorted.bam.vcf   v_ndv11_S16_L006.sorted.bam
ndv12_S17_L006.sorted.bam.vcf   v_ndv12_S17_L006.sorted.bam
ndv13_S18_L007.sorted.bam.vcf   v_ndv13_S18_L007.sorted.bam
ndv17_S22_L007.sorted.bam.vcf   v_ndv17_S22_L007.sorted.bam
ndv18_S23_L007.sorted.bam.vcf   v_ndv18_S23_L007.sorted.bam
ndv19_S10_L003.sorted.bam.vcf   v_ndv19_S10_L003.sorted.bam
ADD REPLY
0
Entering edit mode

What's your question?

ADD REPLY
0
Entering edit mode

I w as trying to map the files to a viral reference genome to detect if the files contained virus sequences. The files are the bam files of bladder cancer cells persistently infected with NDV. Any further idea on how to approach it?

Thank you.

ADD REPLY
0
Entering edit mode

All the bam files are sorted.

Then just index the *.sorted.bam files.

ADD REPLY
0
Entering edit mode

Okay Sir. Thank you for the guidance

ADD REPLY

Login before adding your answer.

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