Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FASTA input for split in two dimensions and How to save the results of split in 2D #11

Open
EasternCaveMan opened this issue Jan 26, 2024 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@EasternCaveMan
Copy link

EasternCaveMan commented Jan 26, 2024

Hi Roman I hope you are doing well,
You have given a example in DatatSAIL web site how to prepare the target for split as bellow:
Preparation of Targets:
you copy all pdb files into one folder. This is a requirement of FoldSeek, the internally used algorithm to cluster PDB data.

os.makedirs("pdbs", exist_ok=True)
for name, filename in df[["ids", "Target"]].values.tolist():
    shutil.copyfile(filename, f"pdbs/{name}.pdb")

I am trying to do the same when the target are protein seqences:
here is my data structure:
Screenshot 2024-01-26 at 11 58 53

and use this code to save each sequnce in a fasta file with ids as ID

sequences_dir = os.path.abspath(os.path.join(CURRENT_DIR, ".." ,"data", "enzyme_substrate_data","sequences"))
os.makedirs(sequences_dir, exist_ok=True)

for name, sequence in final_df_UID_MID[["ids", "Sequence"]].values.tolist():
    filename = os.path.join(sequences_dir, f"{name}.fasta")
    with open(filename, 'w') as f:
        f.write(f">{name}\n")
        f.write(sequence + "\n")

Best,
Vahid

@EasternCaveMan
Copy link
Author

EasternCaveMan commented Jan 26, 2024

I have saved all sequences in one file and didnt get any error related to sequence file. Is this correct or should each sequence be saved in seperate file and if so, should >ids to first line or just add idsto file name?
Input structure for fasta file

>ID0
FFEGKNIFVTGGTGLLGKVLVEKILRSTPIGKIYVLVKADDQEAAVDRITKELINSELFRCLKEKHGKYYQAYIRETLIPIVGNICEPNLGMDSDSAHAIMEDVNVIIESAAITTLNERYDVSLEANVNSPQQLMRFAKTCKN
>ID1
MDPHNKGVAEAEFFTEYGEASRYEIQEVIGKGSYGIVGSVIDTHTGERVAIKKINDVFEHVSDATRILREIKKADP

@Old-Shatterhand
Copy link
Member

Hi @atabaigi ,
You cannot use FoldSeek for protein sequences. FoldSeek is based on 3d structures. For sequences, can use MMseqs2 or CD-HIT. But as input for MMseqs or CD-HIT, your fasta file looks good.

@Old-Shatterhand Old-Shatterhand added the question Further information is requested label Jan 29, 2024
@Old-Shatterhand
Copy link
Member

Note to my-self: Recheck input validation and raise an error in these cases.

@Old-Shatterhand Old-Shatterhand added the enhancement New feature or request label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants