Skip to content

Commit

Permalink
Merge pull request #5 from shervinea/syntax-cleanup
Browse files Browse the repository at this point in the history
Readability and syntax cleanup
  • Loading branch information
shervinea authored Sep 7, 2021
2 parents bec8ca3 + cd06ad1 commit fcf6aab
Show file tree
Hide file tree
Showing 24 changed files with 1,109 additions and 1,287 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Mac.
**/.DS_Store

# Notebooks.
**/.ipynb_checkpoints

# PDB caching.
*.pdb

# Code execution.
**/__pycache__
**/.pyc
.idea/**

# Package.
*.egg-info

# Virtual environment.
venv/**
20 changes: 0 additions & 20 deletions datasets/charge.csv

This file was deleted.

2 changes: 1 addition & 1 deletion datasets/download_pdb.txt

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions datasets/hydropathy.csv

This file was deleted.

20 changes: 0 additions & 20 deletions datasets/isoelectric.csv

This file was deleted.

37 changes: 0 additions & 37 deletions datasets/make_files/charge.py

This file was deleted.

23 changes: 9 additions & 14 deletions datasets/make_files/download_pdb.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
'Converts list of PDB enzymes in a text file'
"""Converts list of PDB enzymes in a text file."""

# Authors: Afshine Amidi <[email protected]>
# Shervine Amidi <[email protected]>

# MIT License

import pandas as pa
import csv
from enzynet.tools import read_dict
import pandas as pd


# Read csv files
df = pa.read_csv('../dataset_all.csv', header=None)
def create_download_file() -> None:
"""Creates the RCSB download file containing all relevant PDB IDs."""
df = pd.read_csv('../dataset_all.csv', header=None)
with open('../download_pdb.txt', 'w') as file:
file.write(", ".join(df[0].tolist()))

# Only keep PDB IDs
df = df[0]+', '
df = df.tolist()

# Save to text file with one PDB ID per line
file = open('../download_pdb.txt','w')
for i in range(len(df)):
file.write(df[i])
file.close()
if __name__ == "__main__":
create_download_file()
Loading

0 comments on commit fcf6aab

Please sign in to comment.