-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upload entire 400 proteins script (#102)
* feat: upload all script * feat: delete script too * feat: delete too * docs: add command to docs for upload * fix: right alpha fold link
- Loading branch information
Showing
10 changed files
with
76 additions
and
4,492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.pdb |
1,087 changes: 0 additions & 1,087 deletions
1,087
backend/src/data/pdbAlphaFold/Gh_comp271_c0_seq1.pdb
This file was deleted.
Oops, something went wrong.
1,646 changes: 0 additions & 1,646 deletions
1,646
backend/src/data/pdbAlphaFold/Lb17_comp535_c2_seq1.pdb
This file was deleted.
Oops, something went wrong.
1,709 changes: 0 additions & 1,709 deletions
1,709
backend/src/data/pdbAlphaFold/Lh14_comp2336_c0_seq1.pdb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import requests | ||
import os | ||
|
||
DIR = "../backend/src/data/pdbAlphaFold" | ||
|
||
|
||
def delete_protein_files(): | ||
os.system(f"rm -fr {DIR}") | ||
os.system(f"mkdir {DIR}") | ||
os.system(f"echo *.pdb > {DIR}/.gitignore") | ||
|
||
|
||
delete_protein_files() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import requests | ||
import os | ||
|
||
CONTENT = "From the [Venom Biochemistry & Molecular Biology Laboratory](https://venombiochemistrylab.weebly.com/) and predicted using [AlphaFold](https://github.com/google-deepmind/alphafold)." | ||
REFS = "" | ||
DIR = "./master_venom_galaxy" | ||
|
||
|
||
def unzip_box(): | ||
os.system(f"unzip {DIR}.zip") | ||
|
||
|
||
def remove_box(): | ||
os.system(f"rm -rf {DIR}") | ||
|
||
|
||
def upload_protein_file(path, name, species_name, content="", refs=""): | ||
with open(path, "r") as f: | ||
pdb_file_str = f.read() | ||
|
||
payload = { | ||
"name": name, | ||
"species_name": species_name, | ||
"content": content, | ||
"refs": refs, | ||
"pdb_file_str": pdb_file_str, | ||
} | ||
out = requests.post("http://localhost:8000/protein-upload", json=payload) | ||
return out | ||
|
||
|
||
def upload_all(): | ||
unzip_box() | ||
available_species = { | ||
"Gh": "ganaspis hookeri", | ||
"Lb": "leptopilina boulardi", | ||
"Lh": "leptopilina heterotoma", | ||
"*": "unknown", | ||
} | ||
for fn in os.listdir(DIR): | ||
if fn.endswith(".pdb"): | ||
full_path = os.path.join(DIR, fn) | ||
name = fn.split(".")[0].replace("_", " ") | ||
species_name = available_species[fn[:2]] | ||
upload_protein_file( | ||
full_path, name, species_name, content=CONTENT, refs=REFS | ||
) | ||
print("uploaded", full_path, name, species_name) | ||
remove_box() | ||
|
||
|
||
upload_all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters