Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

[BUG] Fasta header with special characters alter output path #691

Open
jspaezp opened this issue Jun 11, 2024 · 0 comments
Open

[BUG] Fasta header with special characters alter output path #691

jspaezp opened this issue Jun 11, 2024 · 0 comments

Comments

@jspaezp
Copy link

jspaezp commented Jun 11, 2024

Bug description

Fasta headers with special characters generate inconsistent paths when using the extract entry point.

https://github.com/facebookresearch/esm/blob/2b369911bb5b4b0dda914521b9475cad1656b2ac/scripts/extract.py#L105C1-L105C67

Reproduction steps

If a fasta file with this input is used as an input:

>sp|Q99966|CITE1_HUMAN Cbp/p300-interacting transactivator 1 OS=Homo sapiens OX=9606 GN=CITED1 PE=1 SV=2
MPTTSRPALDVKGGTSPAKEDANQEMSSVAYSNLAVKDRKAVAILHYPGVASNGTKASGA
PTSSSGSPIGSPTTTPPTKPPSFNLHPAPHLLASMHLQKLNSQYQGMAAATPGQPGEAGP
LQNWDFGAQAGGAESLSPSAGAQSPAIIDSDPVDEEVLMSLVVELGLDRANELPELWLGQ
NEFDFTADFPSSC

Then it generates a pt like this -> embeds/sp|Q99966|CITE1_HUMAN Cbp/p300-interacting transactivator 1 OS=Homo sapiens OX=9606 GN=CITED1 PE=1 SV=2.pt

Expected behavior

The expected behavior would be that the special character is handled correctly and the output .pt
is in the top level, and not broken into a directory.

GOT -> embeds / sp|Q99966|CITE1_HUMAN Cbp / p300-interacting transactivator 1 OS=Homo sapiens OX=9606 GN=CITED1 PE=1 SV=2.pt
EXPECTED -> embeds / sp|Q99966|CITE1_HUMAN Cbp/p300-interacting transactivator 1 OS=Homo sapiens OX=9606 GN=CITED1 PE=1 SV=2.pt OR throw a warning and generate embeds / sp|Q99966|CITE1_HUMAN Cbp_p300-interacting transactivator 1 OS=Homo sapiens OX=9606 GN=CITED1 PE=1 SV=2.pt

LMK if you would like a PR for it!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant