# Error in database preparing: the python script first downloads uniprot\_sprot.dat.gz and uniprot\_trembl.dat.gz, then combines them into a file called "uniprot.dat.gz", but the command line for combining two files does not work well

**URL:** <https://forum.biobakery.org/t/error-in-database-preparing-the-python-script-first-downloads-uniprot-sprot-dat-gz-and-uniprot-trembl-dat-gz-then-combines-them-into-a-file-called-uniprot-dat-gz-but-the-command-line-for-combining-two-files-does-not-work-well/7200>\
**Category:** MetaWIBELE\
**Created:** [June 27, 2024, 9:20pm UTC](https://forum.biobakery.org/t/error-in-database-preparing-the-python-script-first-downloads-uniprot-sprot-dat-gz-and-uniprot-trembl-dat-gz-then-combines-them-into-a-file-called-uniprot-dat-gz-but-the-command-line-for-combining-two-files-does-not-work-well/7200 "2024-06-27T21:20:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen1](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/stephen1/32/2287_2.png) [@Stephen1](https://forum.biobakery.org/u/Stephen1)\
**Post date:** [June 27, 2024, 9:20pm UTC](https://forum.biobakery.org/t/error-in-database-preparing-the-python-script-first-downloads-uniprot-sprot-dat-gz-and-uniprot-trembl-dat-gz-then-combines-them-into-a-file-called-uniprot-dat-gz-but-the-command-line-for-combining-two-files-does-not-work-well/7200/1 "2024-06-27T21:20:47Z")

</div>

Hi Yancong,

I think there is a bug in metawibele\_prepare\_uniprot\_annotation (metawibele/common/prepare\_uniprot\_annotation.py),

This Python script first downloads uniprot\_sprot.dat.gz and uniprot\_trembl.dat.gz, then combines them into a file called “uniprot.dat.gz”, but the command line for combining two files does not work well because these commands compress the uniprot.dat.gz twice.

Kind regards,  
Stephen

---

<div class="post-metadata">

**Author:** ![YancongZhang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/yancongzhang/32/1176_2.png) [@YancongZhang](https://forum.biobakery.org/u/YancongZhang)\
**Post date:** [June 27, 2024, 11:14pm UTC](https://forum.biobakery.org/t/error-in-database-preparing-the-python-script-first-downloads-uniprot-sprot-dat-gz-and-uniprot-trembl-dat-gz-then-combines-them-into-a-file-called-uniprot-dat-gz-but-the-command-line-for-combining-two-files-does-not-work-well/7200/2 "2024-06-27T23:14:20Z")

</div>

Hi Stephen,

Thanks for your interest! Could I ask which version you used? By testing our latest version (v0.4.8 [GitHub - biobakery/metawibele: MetaWIBELE: Workflow to Identify novel Bioactive Elements in microbiome](https://github.com/biobakery/metawibele)), I didn’t find this issue, where the downloaded `uniprot_sprot.dat.gz` and `uniprot_trembl.dat.gz` were combined into` uniprot.dat` and then compressed into `uniprot.dat.gz`

Best,  
Yancong

---

<div class="post-metadata">

**Author:** ![Stephen1](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/stephen1/32/2287_2.png) [@Stephen1](https://forum.biobakery.org/u/Stephen1)\
**Post date:** [June 28, 2024, 7:52am UTC](https://forum.biobakery.org/t/error-in-database-preparing-the-python-script-first-downloads-uniprot-sprot-dat-gz-and-uniprot-trembl-dat-gz-then-combines-them-into-a-file-called-uniprot-dat-gz-but-the-command-line-for-combining-two-files-does-not-work-well/7200/3 "2024-06-28T07:52:37Z")

</div>

Hi Yancong,

I used v0.4.7.  
I found the problem is that “less” was used to decompress and combine uniprot\_sprot.dat.gz and uniprot\_trembl.dat.gz, but in some Linux distribution, less doesn’t automatically decompress gzipped files ([gzip - "less" doesn't automatically decompress gzipped files - Ask Ubuntu](https://askubuntu.com/questions/62655/less-doesnt-automatically-decompress-gzipped-files)), so in my Linux distribution (ubuntu server, zsh), it doesn’t work well.

It may be more efficient to simply “cat uniprot\_sprot.dat.gz uniprot\_trembl.dat.gz \> uniprot.dat.gz” to concatenate these two gzipped files instead of decompressing, combining, and then compressing them once more. ([Advanced usage (GNU Gzip)](https://www.gnu.org/software/gzip/manual/html_node/Advanced-usage.html))

Kind regards,  
Stephen

---

<div class="post-metadata">

**Author:** ![YancongZhang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/yancongzhang/32/1176_2.png) [@YancongZhang](https://forum.biobakery.org/u/YancongZhang)\
**Post date:** [June 28, 2024, 3:59pm UTC](https://forum.biobakery.org/t/error-in-database-preparing-the-python-script-first-downloads-uniprot-sprot-dat-gz-and-uniprot-trembl-dat-gz-then-combines-them-into-a-file-called-uniprot-dat-gz-but-the-command-line-for-combining-two-files-does-not-work-well/7200/4 "2024-06-28T15:59:49Z")

</div>

Hi Stephen,

Thanks for this information! I fixed this issue to make it work on more types of Linux distributions (including ubantu). Please check out our latest version on the Github and let me know if you have any other questions.

Best,  
Yancong
