Rosetta  2019.12
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
erraser_util Namespace Reference

Classes

class  ErraserError
 

Functions

def error_exit
 
def rosetta_bin_path
 
def initialize_rna_tools
 
def get_fasta
 
def rosetta_database_path
 
def subprocess_call
 
def subprocess_out
 
def grep
 
def remove
 
def copy
 
def move
 
def get_total_res
 
def find_nearby_res
 
def parse_options
 
def parse_option_int_list
 
def parse_option_string_list
 
def parse_option_chain_res_list
 
def rna_rosetta_ready_set
 
def extract_pdb
 
def phenix_release_tag
 
def phenix_rna_validate
 
def find_error_res
 
def pdb2fasta
 
def pdb_slice
 
def check_path_exist
 
def load_pdb_coord_old
 
def load_pdb_coord
 
def regularize_pdb
 
def regularize_OP1_OP2
 
def rosetta2phenix_merge_back
 
def rosetta2std_pdb
 
def pdb2rosetta
 
def res_num_convert
 
def res_wise_rmsd
 
def pdb_slice_into_chunks
 
def pdb_slice_with_patching
 
def sliced2orig_merge_back
 
def find_chi_angle
 

Variables

tuple file_path = os.path.split( os.path.abspath(__file__) )
 

Function Documentation

def erraser_util.check_path_exist (   path_name)
def erraser_util.copy (   file1,
  dst 
)
def erraser_util.error_exit (   message = "")
def erraser_util.extract_pdb (   silent_file,
  output_folder_name,
  rosetta_bin = "",
  rosetta_database = "",
  extract_first_only = False,
  output_virtual = False,
  rna_prot_erraser = False 
)
def erraser_util.find_chi_angle (   input_pdb,
  res 
)
Find the chi angle value for given residue of the input pdb.

References measure_params.compute_torsion(), error_exit(), ObjexxFCL.len(), basic::database.open(), and binder.replace().

Referenced by erraser_wrapper.SWA_rebuild_erraser().

def erraser_util.find_error_res (   input_pdb)
Return a list of error resdiue in the given pdb file (RNA only).
Use phenix.rna_validate.

References basic::options::OptionKeys::in::file.list, and phenix_rna_validate().

Referenced by erraser_wrapper.erraser().

def erraser_util.find_nearby_res (   input_pdb,
  input_res,
  dist_cutoff,
  reload = True 
)
Find nearby residues to the input residues by a distance_cutoff.
All the residues should be in the same chain with continous numbering starting from 1.

References check_path_exist(), measure_params.compute_dist(), error_exit(), ObjexxFCL.len(), load_pdb_coord(), load_pdb_coord_old(), and basic::options::OptionKeys::relax::range.range.

Referenced by pdb_slice_into_chunks(), and pdb_slice_with_patching().

def erraser_util.get_fasta (   pdb_file,
  out_file,
  rosetta_folder = "" 
)
Gets the FASTA contents using pdb2fasta.py
Note that initialize_rna_tools has been called already

References pyrosetta.tests.distributed.test_dask.format, basic::database.open(), and binder.split().

Referenced by erraser_wrapper.erraser_minimize().

def erraser_util.get_total_res (   pdbname)
def erraser_util.grep (   pattern,
  input_file 
)
Search for the given pattern in the input file.
Return a list of lines containing the pattern.

References check_path_exist(), and basic::database.open().

Referenced by rosetta2std_pdb().

def erraser_util.initialize_rna_tools (   rosetta_folder = "")

References error_exit().

def erraser_util.load_pdb_coord (   input_pdb)
Load in the pdb and return the coordinates for each heavy atom in each residue.
Also return a list of C1' coordinates
AMW: now returns a dict from name (i.e. A:1) to coords.

References check_path_exist(), error_exit(), ObjexxFCL.len(), and basic::database.open().

Referenced by find_nearby_res(), and res_wise_rmsd().

def erraser_util.load_pdb_coord_old (   input_pdb)
Load in the pdb and return the coordinates for each heavy atom in each residue.
Also return a list of C1' coordinates
AMW: old version that supports SWA_rebuild better.

References check_path_exist(), error_exit(), ObjexxFCL.len(), and basic::database.open().

Referenced by find_nearby_res().

def erraser_util.move (   file1,
  dst 
)
Move files to new destination.

References check_path_exist().

Referenced by extract_pdb(), and rna_rosetta_ready_set().

def erraser_util.parse_option_chain_res_list (   argv,
  tag 
)
Parse input cmdline option with the following format:
... -tag A10 B20-22...
Return a list of strings with number expanded:
['A10', 'B20', 'B21', 'B22', ... ]
AMW: we will have to expand this so that it takes seg ID at the end

References error_exit(), ObjexxFCL.len(), and basic::options::OptionKeys::relax::range.range.

def erraser_util.parse_option_int_list (   argv,
  tag 
)
Parse input cmdline option with the following format:
... -tag 1 5 7-20 40 45-60 ...
Return a list of expanded numbers

References error_exit(), ObjexxFCL.len(), and basic::options::OptionKeys::relax::range.range.

def erraser_util.parse_option_string_list (   argv,
  tag 
)
Parse input cmdline option with the following format:
... -tag ss bbb fef ...
Return a list of input strings

References ObjexxFCL.len(), and basic::options::OptionKeys::relax::range.range.

def erraser_util.parse_options (   argv,
  tag,
  default 
)
def erraser_util.pdb2fasta (   input_pdb,
  fasta_out,
  using_protein = False 
)
def erraser_util.pdb2rosetta (   input_pdb,
  out_name,
  alter_conform = 'A',
  PO_dist_cutoff = 2.0,
  use_rs_atom_res_name = False,
  using_protein = False,
  renumbering = True 
)
Convert regular pdb file to rosetta format.
Return a list for converting original residues # into new ones,
a list of residue convalently bonded to removed HETATM so they can be fixed in further refinement,
a list of cutpoints (terminal residues) in the structure,
and the CRYST1 line in the model.

References check_path_exist(), measure_params.compute_dist(), error_exit(), pyrosetta.tests.distributed.test_dask.format, ObjexxFCL.len(), basic::options::OptionKeys::in::file.list, basic::database.open(), ObjexxFCL.rjust(), rosetta_database_path(), binder.split(), and ObjexxFCL.strip().

Referenced by erraser_wrapper.erraser(), and erraser_wrapper.erraser_single_res().

def erraser_util.pdb_slice (   input_pdb,
  out_name,
  segment 
)
Slice the input pdb file with given segment.
Segment format example: '1-3 8 10-30 45 46 40'
Or input a python int list as the segment.
Return list of cut residue

References check_path_exist(), error_exit(), ObjexxFCL.len(), basic::database.open(), and basic::options::OptionKeys::relax::range.range.

Referenced by pdb_slice_with_patching(), and erraser_wrapper.SWA_rebuild_erraser().

def erraser_util.pdb_slice_into_chunks (   input_pdb,
  n_chunk 
)
Slice the pdb into smaller chunks.
Return a list of res_list for each chunk.

References check_path_exist(), find_nearby_res(), get_total_res(), ObjexxFCL.len(), and basic::options::OptionKeys::relax::range.range.

def erraser_util.pdb_slice_with_patching (   input_pdb,
  out_name,
  slice_res_list 
)
Slice the pdb file with given input residue list.
Patch the nearby residues to the sliced pdb.
Return a sorted new residue number list and a list of patched res (in new order).

References check_path_exist(), find_nearby_res(), and pdb_slice().

Referenced by erraser_wrapper.SWA_rebuild_erraser().

def erraser_util.phenix_release_tag ( )

References subprocess_out().

def erraser_util.phenix_rna_validate (   input_pdb,
  outliers_only = True 
)
def erraser_util.regularize_OP1_OP2 (   input_pdb,
  out_name 
)
def erraser_util.regularize_pdb (   input_pdb,
  out_name 
)
Regularize the residue and atom naming of input pdb file (for RNA part).

References check_path_exist(), ObjexxFCL.len(), and basic::database.open().

Referenced by erraser_wrapper.erraser(), and erraser_wrapper.erraser_single_res().

def erraser_util.remove (   pattern,
  ignore_errors = True 
)
def erraser_util.res_num_convert (   res_conversion_list,
  res_pdb 
)
Convert pdb residue number (A15, chainID + resnum) to Rosetta pdb numbering.

References error_exit().

Referenced by erraser_wrapper.erraser(), and erraser_wrapper.erraser_single_res().

def erraser_util.res_wise_rmsd (   pdb1,
  pdb2 
)
Compute the rmsd of each residue from two pdb file. No extra alignment is performed.
Return a list of rmsd of each residue.
Assuming the pdb files have the same ordering of res name / atom name.

References check_path_exist(), measure_params.compute_squared_dist(), error_exit(), ObjexxFCL.len(), load_pdb_coord(), fmt.print(), and basic::options::OptionKeys::relax::range.range.

Referenced by erraser_wrapper.erraser().

def erraser_util.rna_rosetta_ready_set (   input_pdb,
  out_name,
  option,
  rosetta_bin = "",
  rosetta_database = "",
  rna_prot_erraser = False 
)
Call Rosetta to read in a pdb and output the model right away.
Can be used to ensure the file have the rosetta format for atom name, ordering and phosphate OP1/OP2.

References check_path_exist(), extract_pdb(), pyrosetta.tests.distributed.test_dask.format, utility.lower(), move(), rosetta_bin_path(), rosetta_database_path(), and subprocess_call().

def erraser_util.rosetta2phenix_merge_back (   orig_pdb,
  rs_pdb,
  out_name 
)
def erraser_util.rosetta2std_pdb (   input_pdb,
  out_name,
  cryst1_line = "" 
)
Convert the rosetta pdb file to standard pdb format. (RNA only)
Prepend the CRYST1 line if found in the pdb file or given in input.

References check_path_exist(), grep(), ObjexxFCL.len(), and basic::database.open().

Referenced by erraser_wrapper.erraser().

def erraser_util.rosetta_bin_path (   exe_file,
  rosetta_folder = "" 
)
Return the absolute path to the given executable file in Rosetta.
If no input is given, return the Rosetta bin folder path.
Only the prefix should be given. Rosetta will figure out the rest.
User can provides either the Rosetta root path or the binary path as optional input,
or the function will search for $ROSETTA environment variable.

References check_path_exist(), error_exit(), and ObjexxFCL.len().

Referenced by erraser_wrapper.erraser_minimize(), extract_pdb(), rna_rosetta_ready_set(), erraser_wrapper.seq_rebuild_new(), and erraser_wrapper.SWA_rebuild_erraser().

def erraser_util.rosetta_database_path (   rosetta_folder = "")
Return the absolute path to the Rosetta database.
If no input is given, return the Rosetta bin folder path.
User can provides either the Rosetta root path or the database path as optional input,
or the function will search for $ROSETTA environment variable.

References check_path_exist(), and error_exit().

Referenced by erraser_wrapper.erraser_minimize(), extract_pdb(), pdb2rosetta(), rna_rosetta_ready_set(), rosetta2phenix_merge_back(), and erraser_wrapper.SWA_rebuild_erraser().

def erraser_util.sliced2orig_merge_back (   orig_pdb,
  new_pdb,
  out_name,
  res_list 
)
Merge processed sliced segment back to original pdb (Rosetta format).

References check_path_exist(), ObjexxFCL.len(), and basic::database.open().

Referenced by erraser_wrapper.erraser_single_res(), erraser_wrapper.SWA_rebuild_erraser(), and erraser_wrapper.SWA_rebuild_erraser_postproc().

def erraser_util.subprocess_call (   command,
  out = sys.stdout,
  err = sys.stderr,
  is_append_file = False 
)
def erraser_util.subprocess_out (   command,
  err = sys.stderr 
)
Execute the given commands in /usr/bin/sh.
Error exit if failed.
Return the output as a list of each lines.

References basic::database.open(), binder.split(), and DRRAFTER.type.

Referenced by phenix_release_tag(), phenix_rna_validate(), and erraser_wrapper.SWA_rebuild_erraser().

Variable Documentation

tuple erraser_util.file_path = os.path.split( os.path.abspath(__file__) )