Skip to content

Commit

Permalink
new release v.2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ariadnallop committed Jul 19, 2024
1 parent 0048a41 commit 0e53ab7
Show file tree
Hide file tree
Showing 2 changed files with 228 additions and 223 deletions.
44 changes: 12 additions & 32 deletions PDB-CAT.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Install libraries\n",
"# !pip install --quiet rdkit\n",
"# !pip install --quiet pdbecif\n",
"# !pip install --quiet biopython\n",
"# !pip install --quiet time"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -43,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -69,7 +56,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -128,15 +115,10 @@
" covalent_bond_list = data_from_file[\"Covalent_Bond\"].split('\\n')\n",
" ligand_covalents_bond = data_from_file[\"Bond\"].split('\\n')\n",
" descarted_ligands = data_from_file[\"Discarted_Ligands\"].split('\\n')\n",
" branched_molecules = data_from_file[\"Branched\"].split('\\n')\n",
" branched_name = data_from_file[\"Branched_name\"].split('\\n')\n",
" branched_type = data_from_file[\"Branched_type\"].split('\\n')\n",
" branched_covalent = data_from_file[\"Branched_Covalent\"].split('\\n')\n",
" branched_bond = data_from_file[\"Branched_Bond\"].split('\\n')\n",
"\n",
"\n",
" # Find the maximum length among the three lists\n",
" max_length = max(len(ligands), len(ligand_names_list), len(ligand_types_list), len(covalent_bond_list), len(ligand_covalents_bond), len(descarted_ligands), len(branched_molecules))\n",
" max_length = max(len(ligands), len(ligand_names_list), len(ligand_types_list), len(covalent_bond_list), len(ligand_covalents_bond), len(descarted_ligands))\n",
" \n",
" for i in range(max_length):\n",
" ligand_row = {field: data_from_file[field] for field in fields_to_include}\n",
Expand All @@ -159,16 +141,7 @@
" ligand_row_discarded[\"Covalent_Bond\"] = \"\"\n",
" ligand_row_discarded[\"Bond\"] = \"\"\n",
" data_ligands.append(ligand_row_discarded)\n",
" \n",
" # Add a column to the ligands DataFrame and fill it with the corresponding information\n",
" if i < len(branched_molecules) and branched_molecules[i].strip(): \n",
" ligand_row_branched = {field: data_from_file[field] for field in fields_to_include}\n",
" ligand_row_branched[\"Ligand\"] = branched_molecules[i].strip() if i < len(branched_molecules) else \"\"\n",
" ligand_row_branched[\"Ligand_names\"] = branched_name[i].strip() if i < len(branched_name) else \"\"\n",
" ligand_row_branched[\"Ligand_types\"] = \"Branched\"\n",
" ligand_row_branched[\"Covalent_Bond\"] = branched_covalent[i].strip() if i < len(branched_covalent) else \"\"\n",
" ligand_row_branched[\"Bond\"] = branched_bond[i].strip() if i < len(branched_bond) else \"\"\n",
" data_ligands.append(ligand_row_branched)\n",
"\n",
"\n",
"# First csv output. Protein-centered\n",
"df = pd.DataFrame(data) # Create a Pandas df\n",
Expand Down Expand Up @@ -200,6 +173,13 @@
"# Classify depend on the bond\n",
"bond_classification(directory_path, out_file, no_mutated_list, output_path, mutation)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 0e53ab7

Please sign in to comment.