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.
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.
Thank you Sir for the tips. Let me give it a trial.
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 usingsamtools sort
), if they are not sorted.What is the end-goal here? You want to view/count or do something else with them?
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.
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.
All the bam files are sorted.
What's your question?
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.
Then just index the
*.sorted.bam
files.Okay Sir. Thank you for the guidance