Skip to content

Commit

Permalink
flattened function access
Browse files Browse the repository at this point in the history
  • Loading branch information
glycojones committed Nov 25, 2024
1 parent 05f3e8a commit 11ccdea
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 29 deletions.
5 changes: 3 additions & 2 deletions src/fletcher/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .fletcher import find_structural_motifs
from .coot_scripting import create_script_file
from .fletcher import plddt_to_rmsd
from .fletcher import plddt_to_bfact

__all__ = [ find_structural_motifs ]
__all__ = [ "find_structural_motifs", "plddt_to_rmsd", "plddt_to_bfact" ]

18 changes: 0 additions & 18 deletions src/fletcher/coot_scripting.py

This file was deleted.

29 changes: 29 additions & 0 deletions src/fletcher/fletcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@
import argparse
import json
from pathlib import Path
from math import exp

def plddt_to_rmsd ( plddt = 0.0 ) :
frac_lddt = plddt / 100.0
rmsd_estimation = 1.5 * exp(4.0*(0.7-frac_lddt))
return rmsd_estimation


def plddt_to_bfact ( plddt = 0.0 ) :
return min ( 999.99, 26.318945069571623 * (plddt_to_rmsd ( plddt ))**2)


def create_script_file ( filename = "", list_of_hits = [ ] ) :
with open ( filename.split('.')[0] + '.py', 'w' ) as file_out :
file_out.write ( "# File programmatically created by Fletcher\n" )
file_out.write ( 'handle_read_draw_molecule_with_recentre ("%s", 1)\n' % filename )
file_out.write ( 'interesting_things_gui ("Results from Fletcher",[\n')
for hit in list_of_hits :
file_out.write ( '["%s %s", %.3f, %.3f, %.3f, ]' \
% ( hit[0].get('name'), \
hit[0].get('seqid'), \
hit[0].get('coordinates')[0], \
hit[0].get('coordinates')[1], \
hit[0].get('coordinates')[2] ))
if hit is not list_of_hits[-1] :
file_out.write(',\n')
file_out.write ( '])\n')
file_out.close ( )


def find_structural_motifs ( filename = "",
residue_lists = [ ],
Expand Down
9 changes: 0 additions & 9 deletions src/fletcher/plddt.py

This file was deleted.

0 comments on commit 11ccdea

Please sign in to comment.