Question: Converting BAM files to index files (bam.bai files)
0
gravatar for babasaraki
8 days ago by
babasaraki0
babasaraki0 wrote:

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.

snp rna-seq alignment assembly • 121 views
ADD COMMENTlink written 8 days ago by babasaraki0
2

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 REPLYlink written 8 days ago by RamRS23k

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

ADD REPLYlink written 8 days ago by babasaraki0

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 REPLYlink modified 8 days ago • written 8 days ago by genomax70k

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 REPLYlink modified 8 days ago • written 8 days ago by babasaraki0

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 REPLYlink written 8 days ago by genomax70k

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 REPLYlink modified 8 days ago by RamRS23k • written 8 days ago by babasaraki0

What's your question?

ADD REPLYlink written 8 days ago by RamRS23k

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 REPLYlink written 7 days ago by babasaraki0

All the bam files are sorted.

Then just index the *.sorted.bam files.

ADD REPLYlink written 8 days ago by genomax70k

Okay Sir. Thank you for the guidance

ADD REPLYlink written 7 days ago by babasaraki0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1076 users visited in the last hour