# Fastq.gz file as input for ShortBRED?

**URL:** <https://forum.biobakery.org/t/fastq-gz-file-as-input-for-shortbred/2152>\
**Category:** ShortBRED\
**Created:** [May 26, 2021, 1:43pm UTC](https://forum.biobakery.org/t/fastq-gz-file-as-input-for-shortbred/2152 "2021-05-26T13:43:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thalla](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@Thalla](https://forum.biobakery.org/u/Thalla)\
**Post date:** [May 26, 2021, 1:43pm UTC](https://forum.biobakery.org/t/fastq-gz-file-as-input-for-shortbred/2152/1 "2021-05-26T13:43:39Z")

</div>

Hi,

I didn’t find any information about this and I’m worried that my results are not correct because I used ShortBRED with zipped files. So my question is, can I use fastq.gz files as input for ShortBRED quantify?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![sagunmaharjann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/sagunmaharjann/32/168_2.png) [@sagunmaharjann](https://forum.biobakery.org/u/sagunmaharjann)\
**Post date:** [June 3, 2021, 2:53pm UTC](https://forum.biobakery.org/t/fastq-gz-file-as-input-for-shortbred/2152/2 "2021-06-03T14:53:58Z")

</div>

Hi @Thalla,

The input files for ShortBRED has to be fasta format(.faa). Please feel free to see the example input tutorial. [shortbred · biobakery/biobakery Wiki · GitHub](https://github.com/biobakery/biobakery/wiki/shortbred#11-input-files).

Regards,  
Sagun

---

<div class="post-metadata">

**Author:** ![Thalla](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@Thalla](https://forum.biobakery.org/u/Thalla)\
**Post date:** [June 4, 2021, 9:37am UTC](https://forum.biobakery.org/t/fastq-gz-file-as-input-for-shortbred/2152/3 "2021-06-04T09:37:58Z")

</div>

Hi @sagunmaharjann,

I would assume that a zipped FASTA file is still a FASTA file. But if zipped and non zipped files or only the latter was meant, is not stated clearly in the documentation.  
I have looked it up in the code now. Should have done this in the first place 😅. So thanks for your answer! That pushed me in the right direction.

The code was easy to follow 👍 🙂 :

The tutorial says that .fasta files are needed for ShortBRED quantify. So I assume fastq is fine, too. And in the code I can see that fastq is mentioned as example:

> aaFileInfo is array of string arrays, each with details on the file so ShortBRED  
> knows how to process it efficiently. Each line has the format:  
> [filename, format, “large” or “small”, extract method, and corresponding tarfile (if needed)]  
> An example:  
> [‘SRS011397/SRS011397.denovo\_duplicates\_marked.trimmed.1.fastq’, ‘fastq’, ‘large’, ‘r:bz2’, ‘/n/CHB/data/hmp/wgs/samplesfqs/SRS011397.tar.bz2’]

Considering the zipped/unzipped problem there is a line in the quantify script that checks which extraction method is needed:

> strExtractMethod= sq.CheckExtract(strWGS)

And the corresponding function definition looks like this:

> def CheckExtract(strWGS):  
> if strWGS.find(“.tar.bz2”) \> -1:  
> strExtractMethod = ‘r:bz2’  
> elif strWGS.find(“.tar.gz”) \> -1:  
> strExtractMethod = ‘r:gz’  
> elif strWGS.find(“.gz”) \> -1:  
> strExtractMethod = ‘gz’  
> elif strWGS.find(“.bz2”) \> -1:  
> strExtractMethod = ‘bz2’  
> else:  
> strExtractMethod = “”
> 
> return strExtractMethod

All in all I think it is safe to assume that fastq.gz files are handled correctly.

Regards,  
Thalla
