Rosetta
Classes | Functions | Variables
erraser_util Namespace Reference

Classes

class  ErraserError
 

Functions

def error_exit (message="")
 
def rosetta_bin_path (exe_file, rosetta_folder="")
 
def initialize_rna_tools (rosetta_folder="")
 
def get_fasta (pdb_file, out_file, rosetta_folder="")
 
def rosetta_database_path (rosetta_folder="")
 
def subprocess_call (command, out=sys.stdout, err=sys.stderr, is_append_file=False)
 
def subprocess_out (command, err=sys.stderr)
 
def grep (pattern, input_file)
 
def remove (pattern, ignore_errors=True)
 
def copy (file1, dst)
 
def move (file1, dst)
 
def get_total_res (pdbname)
 
def find_nearby_res (input_pdb, input_res, dist_cutoff, reload=True)
 
def parse_options (argv, tag, default)
 
def parse_option_int_list (argv, tag)
 
def parse_option_string_list (argv, tag)
 
def parse_option_chain_res_list (argv, tag)
 
def rna_rosetta_ready_set (input_pdb, out_name, option, rosetta_bin="", rosetta_database="", rna_prot_erraser=False)
 
def extract_pdb (silent_file, output_folder_name, rosetta_bin="", rosetta_database="", extract_first_only=False, output_virtual=False, rna_prot_erraser=False)
 
def phenix_release_tag ()
 
def phenix_rna_validate (input_pdb, outliers_only=True)
 
def find_error_res (input_pdb)
 
def pdb2fasta (input_pdb, fasta_out, using_protein=False)
 
def pdb_slice (input_pdb, out_name, segment)
 
def check_path_exist (path_name)
 
def load_pdb_coord_old (input_pdb)
 
def load_pdb_coord (input_pdb)
 
def regularize_pdb (input_pdb, out_name)
 
def regularize_OP1_OP2 (input_pdb, out_name)
 
def rosetta2phenix_merge_back (orig_pdb, rs_pdb, out_name)
 
def rosetta2std_pdb (input_pdb, out_name, cryst1_line="")
 
def pdb2rosetta (input_pdb, out_name, alter_conform='A', PO_dist_cutoff=2.0, use_rs_atom_res_name=False, using_protein=False, renumbering=True)
 
def res_num_convert (res_conversion_list, res_pdb)
 
def res_wise_rmsd (pdb1, pdb2)
 
def pdb_slice_into_chunks (input_pdb, n_chunk)
 
def pdb_slice_with_patching (input_pdb, out_name, slice_res_list)
 
def sliced2orig_merge_back (orig_pdb, new_pdb, out_name, res_list)
 
def find_chi_angle (input_pdb, res)
 

Variables

 file_path = os.path.split( os.path.abspath(__file__) ) [0]
 

Function Documentation

◆ check_path_exist()

def erraser_util.check_path_exist (   path_name)

◆ copy()

def erraser_util.copy (   file1,
  dst 
)
Copy files to new destination. Replace with new one if the two overlaped.

References check_path_exist().

Referenced by UBQ_E2Mover.analyze_and_filter(), UBQ_GTPase_disulfide_Mover.analyze_and_filter(), InterfaceStrandFinderMover.apply(), detail::bigint.assign(), utility::graph::RingDetection< Graph >.CombinePaths(), detail.copy_str(), detail.copy_unit(), erraser_wrapper.erraser(), erraser_wrapper.erraser_minimize(), basic_printf_context< OutputIt, Char >.format(), formatter< arg_join< It, Sentinel, Char >, Char >.format(), formatter< std::tm, Char >.format(), detail::fallback_formatter< T, Char, enable_if_t< is_streamable< T, Char >::value > >.format(), detail::chrono_formatter< FormatContext, OutputIt, Rep, Period >.format_localized(), pyrosetta.tests.protocols.indexed_structure_store.test_search.fragment_start_indicies_from_residue_array(), pyrosetta.tests.protocols.indexed_structure_store.test_search.TestStructureSearch.gen_test_set(), main(), numeric::MathMatrix< T >.MathMatrix(), numeric::MathNTensor< T, N >.MathNTensor(), numeric::MathTensor< T >.MathTensor(), numeric::MathVector< T >.MathVector(), detail::chrono_formatter< FormatContext, OutputIt, Rep, Period >.on_text(), numeric::MathMatrix< T >.operator=(), numeric::MathVector< T >.operator=(), numeric::MathNTensor< T, N >.operator=(), numeric::MathTensor< T >.operator=(), erraser_wrapper.outlier_rebuild_if_necessary(), erraser_wrapper.rmsd_rebuild_if_necessary(), ChallengeMover.sample(), erraser_wrapper.seq_rebuild(), erraser_wrapper.seq_rebuild_new(), zinc1_homodimer_design.setup_metalsite_constraints(), split_chains(), erraser_wrapper.SWA_rebuild_erraser(), erraser_wrapper.SWA_rebuild_erraser_async(), erraser_wrapper.SWA_rebuild_erraser_postproc(), pyrosetta.tests.protocols.indexed_structure_store.test_search.TestStructureSearch.test_rep_search(), tokenize_string(), trim_redundant_local_minima(), detail.write(), and detail::arg_formatter_base< OutputIt, Char, ErrorHandler >.write().

◆ error_exit()

def erraser_util.error_exit (   message = "")

◆ extract_pdb()

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 
)

◆ find_chi_angle()

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(), run_backbone.float, ObjexxFCL.len(), basic::database.open(), and binder.replace().

Referenced by erraser_wrapper.SWA_rebuild_erraser().

◆ find_error_res()

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 run_backbone.float, enumerate_junctions.int, basic::options::OptionKeys::in::file.list, phenix_rna_validate(), and set().

Referenced by erraser_wrapper.erraser().

◆ find_nearby_res()

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 range.

Referenced by pdb_slice_into_chunks(), and pdb_slice_with_patching().

◆ get_fasta()

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().

◆ get_total_res()

def erraser_util.get_total_res (   pdbname)

◆ grep()

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().

◆ initialize_rna_tools()

def erraser_util.initialize_rna_tools (   rosetta_folder = "")

References error_exit().

◆ load_pdb_coord()

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(), run_backbone.float, ObjexxFCL.len(), and basic::database.open().

Referenced by find_nearby_res(), and res_wise_rmsd().

◆ load_pdb_coord_old()

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(), run_backbone.float, enumerate_junctions.int, ObjexxFCL.len(), and basic::database.open().

Referenced by find_nearby_res().

◆ move()

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

References check_path_exist().

Referenced by extract_pdb(), and rna_rosetta_ready_set().

◆ parse_option_chain_res_list()

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(), enumerate_junctions.int, ObjexxFCL.len(), and range.

◆ parse_option_int_list()

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(), enumerate_junctions.int, ObjexxFCL.len(), and range.

◆ parse_option_string_list()

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 range.

◆ parse_options()

def erraser_util.parse_options (   argv,
  tag,
  default 
)

◆ pdb2fasta()

def erraser_util.pdb2fasta (   input_pdb,
  fasta_out,
  using_protein = False 
)

◆ pdb2rosetta()

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(), run_backbone.float, pyrosetta.tests.distributed.test_dask.format, ObjexxFCL.len(), basic::options::OptionKeys::in::file.list, basic::database.open(), ObjexxFCL.rjust(), rosetta_database_path(), binder.split(), str(), and ObjexxFCL.strip().

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

◆ pdb_slice()

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(), enumerate_junctions.int, ObjexxFCL.len(), basic::database.open(), and range.

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

◆ pdb_slice_into_chunks()

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(), enumerate_junctions.int, ObjexxFCL.len(), and range.

◆ pdb_slice_with_patching()

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().

◆ phenix_release_tag()

def erraser_util.phenix_release_tag ( )

◆ phenix_rna_validate()

def erraser_util.phenix_rna_validate (   input_pdb,
  outliers_only = True 
)

◆ regularize_OP1_OP2()

def erraser_util.regularize_OP1_OP2 (   input_pdb,
  out_name 
)

◆ regularize_pdb()

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().

◆ remove()

def erraser_util.remove (   pattern,
  ignore_errors = True 
)

◆ res_num_convert()

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().

◆ res_wise_rmsd()

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(), print(), and range.

Referenced by erraser_wrapper.erraser().

◆ rna_rosetta_ready_set()

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(), pyrosetta.tests.distributed.test_dask.format, test_terpenes.lower, move(), rosetta_bin_path(), rosetta_database_path(), str(), and subprocess_call().

◆ rosetta2phenix_merge_back()

def erraser_util.rosetta2phenix_merge_back (   orig_pdb,
  rs_pdb,
  out_name 
)

◆ rosetta2std_pdb()

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().

◆ rosetta_bin_path()

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().

◆ rosetta_database_path()

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().

◆ sliced2orig_merge_back()

def erraser_util.sliced2orig_merge_back (   orig_pdb,
  new_pdb,
  out_name,
  res_list 
)

◆ subprocess_call()

def erraser_util.subprocess_call (   command,
  out = sys.stdout,
  err = sys.stderr,
  is_append_file = False 
)

◆ subprocess_out()

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(), and binder.split().

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

Variable Documentation

◆ file_path

erraser_util.file_path = os.path.split( os.path.abspath(__file__) ) [0]