# converting .bam to .fastq

**URL:** <https://forum.qiime2.org/t/converting-bam-to-fastq/30619>\
**Category:** Other Bioinformatics Tools\
**Created:** [June 25, 2024, 1:56pm UTC](https://forum.qiime2.org/t/converting-bam-to-fastq/30619 "2024-06-25T13:56:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sfreeman](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/s/bbce88/32.png) [@sfreeman](https://forum.qiime2.org/u/sfreeman)\
**Post date:** [June 25, 2024, 1:56pm UTC](https://forum.qiime2.org/t/converting-bam-to-fastq/30619/1 "2024-06-25T13:56:49Z")

</div>

I am wondering if there are any plugins that support BAM files? I am new to using Qiime2 and saw that in 2022, @Nicholas_Bokulich mentioned that they were in progress to [adding BAM](https://forum.qiime2.org/t/import-from-bam-files-tool-or-tutorial/21988) file support. I haven't seen any posts about it since then, so I want to make sure I am not missing something before I use Samtools.

---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [June 28, 2024, 3:42pm UTC](https://forum.qiime2.org/t/converting-bam-to-fastq/30619/2 "2024-06-28T15:42:51Z")

</div>

Hi @sfreeman ,  
What type of data do you have and what exactly do you want to do with it? Samtools is used in a few places in QIIME 2, and bam/sam formats are used, but we do not have it as a stand-alone plugin. So depending on what you want to do, QIIME 2 might have a solution!

---

<div class="post-metadata">

**Author:** ![sfreeman](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/s/bbce88/32.png) [@sfreeman](https://forum.qiime2.org/u/sfreeman)\
**Post date:** [July 9, 2024, 7:43pm UTC](https://forum.qiime2.org/t/converting-bam-to-fastq/30619/3 "2024-07-09T19:43:44Z")

</div>

Thank you for your help! I have 16S human microbiome data in .bam files. I was actually able to convert them to fastq files and import them to qiime using paired-end-33 PHRED with a manifest file, but it would still be helpful to learn about other ways to import these files for future reference.

---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [July 9, 2024, 8:02pm UTC](https://forum.qiime2.org/t/converting-bam-to-fastq/30619/4 "2024-07-09T20:02:22Z")

</div>

Hi @sfreeman ,  
Thanks for clarifying. Yes I think that for raw data your solution is best for now. It would be possible to create a transformer so that .bam files could be imported as paired-end sequence data without first converting to .fastq (contributions welcome 😉 ); but I think your question is the first time I have heard of this use case. In QIIME 2 so far we have used bamfiles and samtools more with different read mapping tools, not for handling raw data.
