TorchRef

Getting Started

  • Installation
    • Requirements
    • Installing via pip
    • Installing from Source
    • Verifying Installation
    • GPU Support
  • Quick Start
    • Basic Refinement
    • Loading Data
    • Parameter Freezing
    • Computing Structure Factors
    • Running Refinement
    • Writing Output Files
    • Geometry Restraints
    • Custom Target Functions
    • LossState Workflow
    • Saving and Loading State
    • GPU Acceleration
    • Command Line Interface
    • Next Steps

User Guide

  • Refinement Guide
    • Overview
    • Basic Usage
    • Refinement Parameters
    • Parameter Selection
    • Monitoring Progress
  • Target Functions
    • Built-in Targets
      • X-ray Targets
      • Geometry Targets
      • ADP Targets
      • Stats functionality
    • Using Targets
    • Custom Targets
    • LossState
  • Geometry Restraints
    • Overview
    • Restraint Setup
    • Restraint Storage
    • Restraint Types
      • Bond Restraints
      • Angle Restraints
      • Torsion Restraints
      • Planarity Restraints
    • Accessing Restraint Statistics
  • Scaling
    • Overview
    • Basic Usage
    • Bin wise scaling
    • Bulk Solvent Model
    • Anisotropic Scaling
  • Naming Conventions
    • General Principles
    • Structure Factors
    • Atomic Displacement Parameters
    • Coordinates
    • Unit Cell
    • Uncertainties
    • Space Group
    • Resolution
  • Command-Line Tools
    • Standard Refinement
      • torchref.refine
    • Difference Refinement
      • torchref.difference-refine
    • Map & Validation Utilities
      • torchref.mtz2map
      • torchref.validate-ded
      • torchref.phased-difference-map

API Reference

  • torchref.cli package
    • Submodules
      • torchref.cli.add_metadata module
        • main()
      • torchref.cli.collection_difference_refine module
        • Output
        • setup_model_collection()
        • setup_dataset_collection()
        • setup_scaler()
        • compute_rfactors()
        • setup_loss_state()
        • compute_bayes_extrapolated_amplitudes()
        • write_results_mtz()
        • optimize_lbfgs()
        • main()
      • torchref.cli.mtz2map module
        • main()
      • torchref.cli.phased_difference_map module
        • main()
      • torchref.cli.refine module
        • main()
      • torchref.cli.strip_altlocs module
        • Usage
        • strip_altlocs()
        • main()
      • torchref.cli.validate_ded module
        • build_atom_mask()
        • compute_correlation()
        • compute_map_from_coefficients()
        • generate_plots()
        • setup_ded_context()
        • compute_ded_maps()
        • run_validation()
        • main()
  • torchref.io package
    • High-level API
    • CrystalDataset
      • CrystalDataset.hkl
      • CrystalDataset.F
      • CrystalDataset.F_sigma
      • CrystalDataset.I
      • CrystalDataset.I_sigma
      • CrystalDataset.rfree_flags
      • CrystalDataset.resolution
      • CrystalDataset.bin_indices
      • CrystalDataset.outlier_flags
      • CrystalDataset.phase
      • CrystalDataset.fom
      • CrystalDataset.E
      • CrystalDataset.E_squared
      • CrystalDataset.F_squared_corrected
      • CrystalDataset.U_aniso
      • CrystalDataset.radial_shell_indices
      • CrystalDataset.cell
      • CrystalDataset.spacegroup
      • CrystalDataset.device
      • CrystalDataset.verbose
      • CrystalDataset.rfree_source
      • CrystalDataset.amplitude_source
      • CrystalDataset.intensity_source
      • CrystalDataset.phase_source
      • CrystalDataset.wilson_b
      • CrystalDataset.wilson_b_structure
      • CrystalDataset.wilson_b_solvent
      • CrystalDataset.wilson_k_sol
      • CrystalDataset.outlier_detection_params
      • CrystalDataset.__post_init__()
      • CrystalDataset.save_state()
      • CrystalDataset.load_state()
      • CrystalDataset.__len__()
      • CrystalDataset.__repr__()
      • CrystalDataset.spacegroup_name
      • CrystalDataset.spacegroup_hm
      • CrystalDataset.spacegroup_number
      • CrystalDataset.__init__()
    • ReflectionData
      • ReflectionData.hkl
      • ReflectionData.F
      • ReflectionData.F_sigma
      • ReflectionData.I
      • ReflectionData.I_sigma
      • ReflectionData.rfree_flags
      • ReflectionData.cell
      • ReflectionData.spacegroup
      • ReflectionData.resolution
      • ReflectionData.wilson_b
      • ReflectionData.source
      • ReflectionData.dataset
      • ReflectionData.last_op
      • ReflectionData.reader
      • ReflectionData.__post_init__()
      • ReflectionData.load()
      • ReflectionData.from_tensors()
      • ReflectionData.load_mtz()
      • ReflectionData.load_cif()
      • ReflectionData.list_cif_data_blocks()
      • ReflectionData.get_bins()
      • ReflectionData.mean_res_per_bin()
      • ReflectionData.mean_F_per_bin()
      • ReflectionData.mean_sigma_per_bin()
      • ReflectionData.regenerate_rfree_flags()
      • ReflectionData.get_structure_factors()
      • ReflectionData.get_structure_factors_with_sigma()
      • ReflectionData.get_hkl()
      • ReflectionData.filter_by_resolution()
      • ReflectionData.get_mask()
      • ReflectionData.cut_res()
      • ReflectionData.get_rfree_masks()
      • ReflectionData.get_work_set()
      • ReflectionData.get_test_set()
      • ReflectionData.get_max_res()
      • ReflectionData.get_min_res()
      • ReflectionData.__len__()
      • ReflectionData.d_min
      • ReflectionData.__repr__()
      • ReflectionData.get_valid_mask()
      • ReflectionData.data_indexed()
      • ReflectionData.__call__()
      • ReflectionData.data_fill_masked()
      • ReflectionData.__getitem__()
      • ReflectionData.__select__()
      • ReflectionData.sanitize_F()
      • ReflectionData.check_all_data_types()
      • ReflectionData.validate_hkl()
      • ReflectionData.find_outliers()
      • ReflectionData.get_log_ratio()
      • ReflectionData.get_outlier_statistics()
      • ReflectionData.unpack_one()
      • ReflectionData.flag_suspicious_sigma()
      • ReflectionData.dump()
      • ReflectionData.write_mtz()
      • ReflectionData.centric
      • ReflectionData.calc_patterson()
      • ReflectionData.possible_hkl()
      • ReflectionData.remap()
      • ReflectionData.fill()
      • ReflectionData.expand_to_p1()
      • ReflectionData.reduce_to_spacegroup()
      • ReflectionData.canonicalize()
      • ReflectionData.get_scattering_vectors()
      • ReflectionData.get_radial_shells()
      • ReflectionData.fit_anisotropy()
      • ReflectionData.setup_anisotropy()
      • ReflectionData.apply_anisotropy_correction()
      • ReflectionData.compute_e_values()
      • ReflectionData.setup_scale()
      • ReflectionData.get_corrected_data()
      • ReflectionData.parameters()
      • ReflectionData.__init__()
    • DatasetCollection
      • DatasetCollection.hkl
      • DatasetCollection.n_datasets
      • DatasetCollection.add_dataset()
      • DatasetCollection.hkl
      • DatasetCollection.datasets
      • DatasetCollection.n_datasets
      • DatasetCollection.reference_dataset
      • DatasetCollection.spacegroup
      • DatasetCollection.__getitem__()
      • DatasetCollection.__iter__()
      • DatasetCollection.__len__()
      • DatasetCollection.__contains__()
      • DatasetCollection.__call__()
      • DatasetCollection.scale()
      • DatasetCollection.keys()
      • DatasetCollection.values()
      • DatasetCollection.items()
      • DatasetCollection.__init__()
      • DatasetCollection.get()
      • DatasetCollection.__repr__()
    • FcalcDataset
      • FcalcDataset.spacegroup
      • FcalcDataset.fcalc
      • FcalcDataset.fcalc_amp
      • FcalcDataset.fcalc_phase
      • FcalcDataset.from_cell_and_resolution()
      • FcalcDataset.set_fcalc()
      • FcalcDataset.write_mtz()
      • FcalcDataset.write_mtz_as_fobs()
      • FcalcDataset.__repr__()
      • FcalcDataset.spacegroup_name
      • FcalcDataset.spacegroup_hm
      • FcalcDataset.spacegroup_number
      • FcalcDataset.__init__()
    • MTZReader
      • MTZReader.verbose
      • MTZReader.data
      • MTZReader.cell
      • MTZReader.spacegroup
      • MTZReader.AMPLITUDE_PRIORITY
      • MTZReader.INTENSITY_PRIORITY
      • MTZReader.RFREE_FLAG_NAMES
      • MTZReader.__init__()
      • MTZReader.read()
      • MTZReader.__call__()
    • PDBReader
      • PDBReader.verbose
      • PDBReader.dataframe
      • PDBReader.cell
      • PDBReader.spacegroup
      • PDBReader.__init__()
      • PDBReader.read()
      • PDBReader.__call__()
    • CIFReader
      • CIFReader.data
      • CIFReader.filepath
      • CIFReader.available_blocks
      • CIFReader.__init__()
      • CIFReader.from_string()
      • CIFReader.load()
      • CIFReader.write()
      • CIFReader.__getitem__()
      • CIFReader.__setitem__()
      • CIFReader.__contains__()
      • CIFReader.__len__()
      • CIFReader.keys()
      • CIFReader.values()
      • CIFReader.items()
      • CIFReader.get()
      • CIFReader.__repr__()
      • CIFReader.summary()
    • ReflectionCIFReader
      • ReflectionCIFReader.__init__()
      • ReflectionCIFReader.read()
      • ReflectionCIFReader.__call__()
      • ReflectionCIFReader.get_reflection_data()
      • ReflectionCIFReader.has_miller_indices()
      • ReflectionCIFReader.has_amplitudes()
      • ReflectionCIFReader.has_intensities()
      • ReflectionCIFReader.has_phases()
      • ReflectionCIFReader.has_rfree_flags()
      • ReflectionCIFReader.get_miller_indices()
      • ReflectionCIFReader.get_amplitudes()
      • ReflectionCIFReader.get_intensities()
      • ReflectionCIFReader.get_cell_parameters()
      • ReflectionCIFReader.get_space_group()
    • ModelCIFReader
      • ModelCIFReader.__init__()
      • ModelCIFReader.read()
      • ModelCIFReader.__call__()
      • ModelCIFReader.get_atom_data()
      • ModelCIFReader.get_atom_data_by_model()
      • ModelCIFReader.get_cell_parameters()
      • ModelCIFReader.get_space_group()
      • ModelCIFReader.has_coordinates()
      • ModelCIFReader.has_cell_parameters()
      • ModelCIFReader.has_space_group()
      • ModelCIFReader.has_occupancy()
      • ModelCIFReader.has_bfactor()
      • ModelCIFReader.has_anisotropic_data()
      • ModelCIFReader.get_coordinates()
      • ModelCIFReader.get_atom_info()
    • RestraintCIFReader
      • RestraintCIFReader.__init__()
      • RestraintCIFReader.get_all_restraints()
      • RestraintCIFReader.get_compound_restraints()
      • RestraintCIFReader.get_bond_restraints()
      • RestraintCIFReader.get_compound_id()
      • RestraintCIFReader.has_bond_restraints()
      • RestraintCIFReader.has_angle_restraints()
      • RestraintCIFReader.has_torsion_restraints()
      • RestraintCIFReader.has_plane_restraints()
      • RestraintCIFReader.has_chirality_restraints()
    • DataRouter
      • DataRouter.filepath
      • DataRouter.verbose
      • DataRouter.data_type
      • DataRouter.file_format
      • DataRouter.reader
      • DataRouter.MTZ_EXTENSIONS
      • DataRouter.PDB_EXTENSIONS
      • DataRouter.CIF_EXTENSIONS
      • DataRouter.__init__()
      • DataRouter.get_reader()
      • DataRouter.get_data()
      • DataRouter.route()
      • DataRouter.__repr__()
      • DataRouter.__str__()
    • DataRouterError
    • IHMEnsembleMapping
      • IHMEnsembleMapping.states
      • IHMEnsembleMapping.model_groups
      • IHMEnsembleMapping.cell
      • IHMEnsembleMapping.spacegroup
      • IHMEnsembleMapping.atom_data_per_state
      • IHMEnsembleMapping.get_state_ids()
      • IHMEnsembleMapping.get_timepoint_names()
      • IHMEnsembleMapping.get_fractions_for_group()
      • IHMEnsembleMapping.identify_dark_group()
      • IHMEnsembleMapping.get_state_by_id()
      • IHMEnsembleMapping.get_group_by_name()
      • IHMEnsembleMapping.validate()
      • IHMEnsembleMapping.__init__()
    • IHMStateInfo
      • IHMStateInfo.state_id
      • IHMStateInfo.name
      • IHMStateInfo.details
      • IHMStateInfo.model_num
      • IHMStateInfo.__init__()
    • IHMModelGroupInfo
      • IHMModelGroupInfo.group_id
      • IHMModelGroupInfo.name
      • IHMModelGroupInfo.state_fractions
      • IHMModelGroupInfo.time_delay
      • IHMModelGroupInfo.time_delay_units
      • IHMModelGroupInfo.__init__()
    • RefinementMetadata
      • RefinementMetadata.program
      • RefinementMetadata.program_version
      • RefinementMetadata.refinement_method
      • RefinementMetadata.resolution_high
      • RefinementMetadata.resolution_low
      • RefinementMetadata.n_reflections_work
      • RefinementMetadata.n_reflections_test
      • RefinementMetadata.n_reflections_all
      • RefinementMetadata.percent_free
      • RefinementMetadata.r_work
      • RefinementMetadata.r_free
      • RefinementMetadata.b_mean_overall
      • RefinementMetadata.b_min
      • RefinementMetadata.b_max
      • RefinementMetadata.rmsd_bond_lengths
      • RefinementMetadata.rmsd_bond_angles
      • RefinementMetadata.n_atoms_total
      • RefinementMetadata.n_atoms_protein
      • RefinementMetadata.n_atoms_solvent
      • RefinementMetadata.solvent_model_ksol
      • RefinementMetadata.solvent_model_bsol
      • RefinementMetadata.cell
      • RefinementMetadata.spacegroup
      • RefinementMetadata.title
      • RefinementMetadata.authors
      • RefinementMetadata.passthrough_pdb_remarks
      • RefinementMetadata.passthrough_cif_categories
      • RefinementMetadata.custom_remarks
      • RefinementMetadata.to_dict()
      • RefinementMetadata.from_dict()
      • RefinementMetadata.from_refinement()
      • RefinementMetadata.from_pdb_file()
      • RefinementMetadata.from_cif_file()
      • RefinementMetadata.merge()
      • RefinementMetadata.render_pdb_header()
      • RefinementMetadata.render_cif_categories()
      • RefinementMetadata.__init__()
    • MTZ
    • PDB
    • Subpackages
      • torchref.io.datasets package
        • CrystalDataset
        • ReflectionData
        • FcalcDataset
        • DatasetCollection
        • Submodules
    • Submodules
      • torchref.io.cif module
        • Functions
        • Classes
        • read_reflections()
        • read_model()
        • read_restraints()
        • list_data_blocks()
        • write_map()
        • dataframe_to_gemmi_structure()
        • write_model()
        • read()
      • torchref.io.cif_readers module
        • CIFReader
        • ReflectionCIFReader
        • ModelCIFReader
        • RestraintCIFReader
      • torchref.io.data_router module
        • DataRouterError
        • DataRouter
      • torchref.io.ihm module
        • IHMReader
        • IHMWriter
      • torchref.io.ihm_mapping module
        • Concept Mapping
        • IHMStateInfo
        • IHMModelGroupInfo
        • IHMEnsembleMapping
      • torchref.io.metadata module
        • RefinementMetadata
      • torchref.io.mtz module
        • Functions
        • Classes
        • MTZReader
        • read()
        • write()
        • MTZ
      • torchref.io.pdb module
        • Functions
        • Classes
        • find_header_length()
        • read_crystallographic_info()
        • load_as_dataframe()
        • PDBReader
        • read()
        • extract_pdb_headers()
        • extract_link_records()
        • write()
        • write_multi_model()
        • PDB
        • find_header_length_pdb_file()
        • load_pdb_as_pd()
  • torchref.model package
    • Classes
    • FFT()
    • SfFFT
      • SfFFT.cell
      • SfFFT.spacegroup
      • SfFFT.symmetry
      • SfFFT.max_res
      • SfFFT.radius_angstrom
      • SfFFT.gridsize
      • SfFFT.real_space_grid
      • SfFFT.voxel_size
      • SfFFT.map_symmetry
      • SfFFT.__init__()
      • SfFFT.cell
      • SfFFT.spacegroup
      • SfFFT.symmetry
      • SfFFT.fractional_matrix
      • SfFFT.inv_fractional_matrix
      • SfFFT.set_cell_and_spacegroup()
      • SfFFT.compute_optimal_gridsize()
      • SfFFT.compute_real_space_grid()
      • SfFFT.setup_grid()
      • SfFFT.build_density_map()
      • SfFFT.map_to_structure_factors()
      • SfFFT.compute_structure_factors()
      • SfFFT.reset_cache()
      • SfFFT.copy()
    • SfDS
      • SfDS.cell
      • SfDS.spacegroup
      • SfDS.__init__()
      • SfDS.cell
      • SfDS.spacegroup
      • SfDS.fractional_matrix
      • SfDS.inv_fractional_matrix
      • SfDS.set_cell_and_spacegroup()
      • SfDS.compute_structure_factors()
      • SfDS.reset_cache()
      • SfDS.copy()
    • InternalCoordinateTensor
      • InternalCoordinateTensor.n_atoms
      • InternalCoordinateTensor.n_chains
      • InternalCoordinateTensor.max_depth
      • InternalCoordinateTensor.bond_lengths
      • InternalCoordinateTensor.angles
      • InternalCoordinateTensor.torsions
      • InternalCoordinateTensor.chain_positions
      • InternalCoordinateTensor.chain_orientations
      • InternalCoordinateTensor.__init__()
      • InternalCoordinateTensor.dtype
      • InternalCoordinateTensor.device
      • InternalCoordinateTensor.to()
      • InternalCoordinateTensor.cuda()
      • InternalCoordinateTensor.cpu()
      • InternalCoordinateTensor.forward_slow()
      • InternalCoordinateTensor.forward()
      • InternalCoordinateTensor.shake()
      • InternalCoordinateTensor.fix()
      • InternalCoordinateTensor.freeze()
      • InternalCoordinateTensor.refine()
      • InternalCoordinateTensor.unfreeze()
      • InternalCoordinateTensor.fix_all()
      • InternalCoordinateTensor.freeze_all()
      • InternalCoordinateTensor.refine_all()
      • InternalCoordinateTensor.unfreeze_all()
      • InternalCoordinateTensor.n_refinable
      • InternalCoordinateTensor.n_fixed
      • InternalCoordinateTensor.forward_parallel()
    • MixedModel
      • MixedModel.models
      • MixedModel.fraction_params
      • MixedModel.__init__()
      • MixedModel.fractions
      • MixedModel.cell
      • MixedModel.spacegroup
      • MixedModel.device
      • MixedModel.dtype_float
      • MixedModel.real_space_grid
      • MixedModel.fft
      • MixedModel.gridsize
      • MixedModel.map_symmetry
      • MixedModel.inv_fractional_matrix
      • MixedModel.fractional_matrix
      • MixedModel.setup_grid()
      • MixedModel.get_radius()
      • MixedModel.build_complete_map()
      • MixedModel.freeze_fractions()
      • MixedModel.unfreeze_fractions()
      • MixedModel.forward()
      • MixedModel.get_individual_fcalc()
      • MixedModel.copy()
      • MixedModel.__repr__()
      • MixedModel.write_ihm()
      • MixedModel.get_vdw_radii()
      • MixedModel.xyz()
    • Model
      • Model.xyz
      • Model.adp
      • Model.u
      • Model.occupancy
      • Model.pdb
      • Model.cell
      • Model.spacegroup
      • Model.symmetry
      • Model.initialized
      • Model.__init__()
      • Model.__bool__()
      • Model.exclude_H_from_sf
      • Model.cell
      • Model.spacegroup
      • Model.symmetry
      • Model.inv_fractional_matrix
      • Model.fractional_matrix
      • Model.recB
      • Model.Z
      • Model.get_P1_parameters_iso()
      • Model.get_MD_parameters()
      • Model.parametrization
      • Model.get_scattering_params_iso()
      • Model.get_scattering_params_aniso()
      • Model.set_restraints_cif()
      • Model.restraints
      • Model.bond_deviations()
      • Model.angle_deviations()
      • Model.torsion_deviations_with_sigmas()
      • Model.load()
      • Model.load_pdb()
      • Model.load_cif()
      • Model.chain_sequences
      • Model.get_chain_residues()
      • Model.update_pdb()
      • Model.get_vdw_radii()
      • Model.to()
      • Model.copy()
      • Model.write_pdb()
      • Model.write_cif()
      • Model.get_iso()
      • Model.set_default_masks()
      • Model.PARAM_TYPES
      • Model.parameters_of_types()
      • Model.freeze()
      • Model.freeze_all()
      • Model.unfreeze_all()
      • Model.unfreeze()
      • Model.update_mask_from_selection()
      • Model.apply_mask_to_parameter()
      • Model.freeze_selection()
      • Model.unfreeze_selection()
      • Model.get_aniso()
      • Model.parameters()
      • Model.named_mixed_tensors()
      • Model.print_parameters_info()
      • Model.register_alternative_conformations()
      • Model.shake_coords()
      • Model.shake_adp()
      • Model.generate_hydrogens()
      • Model.strip_altlocs()
      • Model.strip_hydrogens()
      • Model.hydrogenate()
      • Model.adp_loss()
      • Model.adp_nll_loss()
      • Model.adp_nll_loss_per_atom()
      • Model.adp_kl_divergence_loss()
      • Model.state_dict()
      • Model.save_state()
      • Model.load_state()
      • Model.create_from_state_dict()
      • Model.get_selection_mask()
      • Model.select()
      • Model.xyz_fractional()
      • Model.rotate()
      • Model.translate()
      • Model.get_centroid()
      • Model.use_internal_coordinates()
    • ModelFT
      • ModelFT.max_res
      • ModelFT.radius_angstrom
      • ModelFT.wavelength
      • ModelFT.anomalous_threshold
      • ModelFT.gridsize
      • ModelFT.real_space_grid
      • ModelFT.map
      • ModelFT.parametrization
      • ModelFT.map_symmetry
      • ModelFT.__init__()
      • ModelFT.cell
      • ModelFT.spacegroup
      • ModelFT.load_pdb()
      • ModelFT.select()
      • ModelFT.load_cif()
      • ModelFT.setup_gridsize()
      • ModelFT.A
      • ModelFT.B
      • ModelFT.gridsize
      • ModelFT.real_space_grid
      • ModelFT.voxel_size
      • ModelFT.map_symmetry
      • ModelFT.get_iso()
      • ModelFT.get_aniso()
      • ModelFT.setup_grid()
      • ModelFT.get_radius()
      • ModelFT.build_complete_map()
      • ModelFT.build_initial_map()
      • ModelFT.save_map()
      • ModelFT.get_map_statistics()
      • ModelFT.rebuild_map()
      • ModelFT.update_pdb()
      • ModelFT.reset_cache()
      • ModelFT.invalidate_cache()
      • ModelFT.get_structure_factor()
      • ModelFT.fft
      • ModelFT.forward()
      • ModelFT.copy()
      • ModelFT.state_dict()
      • ModelFT.create_from_state_dict()
    • MixedTensor
      • MixedTensor.refinable_mask
      • MixedTensor.fixed_mask
      • MixedTensor.fixed_values
      • MixedTensor.refinable_params
      • MixedTensor.__init__()
      • MixedTensor.forward()
      • MixedTensor.__getitem__()
      • MixedTensor.__setitem__()
      • MixedTensor.set()
      • MixedTensor.shape
      • MixedTensor.dtype
      • MixedTensor.device
      • MixedTensor.get_refinable_count()
      • MixedTensor.get_fixed_count()
      • MixedTensor.update_fixed_values()
      • MixedTensor.update_refinable_mask()
      • MixedTensor.detach()
      • MixedTensor.clone()
      • MixedTensor.copy()
      • MixedTensor.clip()
      • MixedTensor.to()
      • MixedTensor.refine()
      • MixedTensor.fix()
      • MixedTensor.refine_all()
      • MixedTensor.fix_all()
      • MixedTensor.name
      • MixedTensor.__str__()
      • MixedTensor.parameters()
    • PositiveMixedTensor
      • PositiveMixedTensor.__init__()
      • PositiveMixedTensor.forward()
      • PositiveMixedTensor.fix()
      • PositiveMixedTensor.refine()
      • PositiveMixedTensor.set()
      • PositiveMixedTensor.get_log_values()
      • PositiveMixedTensor.update_refinable_mask()
      • PositiveMixedTensor.copy()
      • PositiveMixedTensor.__str__()
    • PassThroughTensor
      • PassThroughTensor.__init__()
      • PassThroughTensor.forward()
    • OccupancyTensor
      • OccupancyTensor.expansion_mask
      • OccupancyTensor.linked_occ_sizes
      • OccupancyTensor.collapse_counts
      • OccupancyTensor.__init__()
      • OccupancyTensor.forward()
      • OccupancyTensor.shape
      • OccupancyTensor.collapsed_shape
      • OccupancyTensor.clamp()
      • OccupancyTensor.set_group_occupancy()
      • OccupancyTensor.get_group_occupancy()
      • OccupancyTensor.freeze()
      • OccupancyTensor.unfreeze()
      • OccupancyTensor.freeze_all()
      • OccupancyTensor.unfreeze_all()
      • OccupancyTensor.get_refinable_atoms()
      • OccupancyTensor.get_frozen_atoms()
      • OccupancyTensor.get_refinable_count()
      • OccupancyTensor.get_fixed_count()
      • OccupancyTensor.update_refinable_mask()
      • OccupancyTensor.from_residue_groups()
      • OccupancyTensor.copy()
    • SegmentedInternalCoordinateTensor
      • SegmentedInternalCoordinateTensor.n_atoms
      • SegmentedInternalCoordinateTensor.n_segments
      • SegmentedInternalCoordinateTensor.max_depth
      • SegmentedInternalCoordinateTensor.bond_lengths
      • SegmentedInternalCoordinateTensor.angles
      • SegmentedInternalCoordinateTensor.torsions
      • SegmentedInternalCoordinateTensor.segment_positions
      • SegmentedInternalCoordinateTensor.segment_orientations
      • SegmentedInternalCoordinateTensor.AA_NAMES
      • SegmentedInternalCoordinateTensor.__init__()
      • SegmentedInternalCoordinateTensor.dtype
      • SegmentedInternalCoordinateTensor.device
      • SegmentedInternalCoordinateTensor.forward()
      • SegmentedInternalCoordinateTensor.shake()
      • SegmentedInternalCoordinateTensor.fix()
      • SegmentedInternalCoordinateTensor.freeze()
      • SegmentedInternalCoordinateTensor.refine()
      • SegmentedInternalCoordinateTensor.unfreeze()
      • SegmentedInternalCoordinateTensor.fix_all()
      • SegmentedInternalCoordinateTensor.freeze_all()
      • SegmentedInternalCoordinateTensor.refine_all()
      • SegmentedInternalCoordinateTensor.unfreeze_all()
      • SegmentedInternalCoordinateTensor.n_refinable
      • SegmentedInternalCoordinateTensor.n_fixed
    • ClosedSegmentedInternalCoordinateTensor
      • ClosedSegmentedInternalCoordinateTensor.__init__()
      • ClosedSegmentedInternalCoordinateTensor.dtype
      • ClosedSegmentedInternalCoordinateTensor.device
      • ClosedSegmentedInternalCoordinateTensor.forward()
      • ClosedSegmentedInternalCoordinateTensor.shake()
      • ClosedSegmentedInternalCoordinateTensor.fix()
      • ClosedSegmentedInternalCoordinateTensor.freeze()
      • ClosedSegmentedInternalCoordinateTensor.refine()
      • ClosedSegmentedInternalCoordinateTensor.unfreeze()
      • ClosedSegmentedInternalCoordinateTensor.fix_all()
      • ClosedSegmentedInternalCoordinateTensor.freeze_all()
      • ClosedSegmentedInternalCoordinateTensor.refine_all()
      • ClosedSegmentedInternalCoordinateTensor.unfreeze_all()
      • ClosedSegmentedInternalCoordinateTensor.n_refinable
      • ClosedSegmentedInternalCoordinateTensor.n_fixed
      • ClosedSegmentedInternalCoordinateTensor.closure_residuals
      • ClosedSegmentedInternalCoordinateTensor.max_closure_gap
    • ModelCollection
      • ModelCollection.__init__()
      • ModelCollection.add_timepoint()
      • ModelCollection.add_dark()
      • ModelCollection.from_kinetics()
      • ModelCollection.from_ihm()
      • ModelCollection.write_ihm()
      • ModelCollection.keys()
      • ModelCollection.values()
      • ModelCollection.items()
      • ModelCollection.get()
      • ModelCollection.dark_key
      • ModelCollection.dark_model
      • ModelCollection.base_models
      • ModelCollection.n_base_models
      • ModelCollection.timepoint_names
      • ModelCollection.cell
      • ModelCollection.spacegroup
      • ModelCollection.device
      • ModelCollection.get_all_fractions()
      • ModelCollection.get_fractions_matrix()
      • ModelCollection.freeze_all_fractions()
      • ModelCollection.unfreeze_all_fractions()
      • ModelCollection.freeze_structures()
      • ModelCollection.unfreeze_structures()
      • ModelCollection.write_pdbs()
    • Submodules
      • torchref.model.closed_segmented_internal_coordinates module
        • ClosedSegmentedInternalCoordinateTensor
      • torchref.model.internal_coordinates module
        • InternalCoordinateTensor
      • torchref.model.mixed_model module
        • MixedModel
      • torchref.model.model module
        • Model
      • torchref.model.model_collection module
        • ModelCollection
      • torchref.model.model_ft module
        • ModelFT
      • torchref.model.parameter_wrappers module
        • MixedTensor
        • PositiveMixedTensor
        • CholeskyMixedTensor
        • OccupancyTensor
        • PassThroughTensor
      • torchref.model.segmented_internal_coordinates module
        • SegmentedInternalCoordinateTensor
      • torchref.model.sf_ds module
        • SfDS
      • torchref.model.sf_fft module
        • SfFFT
        • FFT()
  • torchref.refinement package
    • Refinement
      • Refinement.device
      • Refinement.verbose
      • Refinement.reflection_data
      • Refinement.model
      • Refinement.scaler
      • Refinement.weighter
      • Refinement.__init__()
      • Refinement.set_xray_target_mode()
      • Refinement.data
      • Refinement.loss_state
      • Refinement.logger
      • Refinement.reset_loss_state()
      • Refinement.get_scales()
      • Refinement.setup_scaler()
      • Refinement.parameters()
      • Refinement.get_fcalc()
      • Refinement.get_fcalc_scaled()
      • Refinement.adp_loss()
      • Refinement.get_F_calc()
      • Refinement.get_F_calc_scaled()
      • Refinement.nll_xray()
      • Refinement.xray_loss_work()
      • Refinement.xray_loss_test()
      • Refinement.bond_loss()
      • Refinement.angle_loss()
      • Refinement.torsion_loss()
      • Refinement.geometry_loss()
      • Refinement.loss()
      • Refinement.setup_component_weighting()
      • Refinement.populate_state_meta()
      • Refinement.update_weights()
      • Refinement.create_loss_state()
      • Refinement.complete_loss_state()
      • Refinement.xray_loss()
      • Refinement.restraints_loss()
      • Refinement.collect_metrics()
      • Refinement.add_target_info_to_state()
      • Refinement.get_rfactor()
      • Refinement.update_outliers()
      • Refinement.plot_fcalc_vs_fobs()
      • Refinement.write_out_mtz()
      • Refinement.collect_deposition_metadata()
      • Refinement.write_out_pdb()
      • Refinement.write_out_cif()
      • Refinement.save_state()
      • Refinement.load_state()
      • Refinement.create_from_state_dict()
    • LBFGSRefinement
      • LBFGSRefinement.target_mode
      • LBFGSRefinement.LBFGS_DEFAULTS
      • LBFGSRefinement.__init__()
      • LBFGSRefinement.xray_loss()
      • LBFGSRefinement.refine_scaler()
      • LBFGSRefinement.refine_xyz()
      • LBFGSRefinement.refine_adp()
      • LBFGSRefinement.refine_joint()
      • LBFGSRefinement.run_training_trajectory()
      • LBFGSRefinement.run_training_trajectory_joint()
      • LBFGSRefinement.refine()
      • LBFGSRefinement.refine_everything()
    • LossState
      • LossState.device
      • LossState.targets
      • LossState.weights
      • LossState.history
      • LossState.meta
      • LossState.device
      • LossState.targets
      • LossState.weights
      • LossState.history
      • LossState.meta
      • LossState.__getitem__()
      • LossState.__contains__()
      • LossState.get()
      • LossState.cache_losses()
      • LossState.update_meta()
      • LossState.register_target()
      • LossState.register_targets()
      • LossState.set_weight()
      • LossState.set_weights()
      • LossState.get_weight()
      • LossState.get_effective_weight()
      • LossState.mark_compilable()
      • LossState.compile_aggregate()
      • LossState.reset_compiled_aggregate()
      • LossState.log()
      • LossState.new_entry()
      • LossState.get_history()
      • LossState.aggregate()
      • LossState.get_loss()
      • LossState.active_parameters()
      • LossState.refresh_loss_leaves()
      • LossState.reset_caches()
      • LossState.restore_loss_leaf_grads()
      • LossState.run()
      • LossState.step()
      • LossState.get_breakdown()
      • LossState.get_group_totals()
      • LossState.format_breakdown()
      • LossState.summary()
      • LossState.to()
      • LossState.clear()
      • LossState.clear_history()
      • LossState.__init__()
    • Logger
      • Logger.state
      • Logger.verbose
      • Logger.pattern
      • Logger.record()
      • Logger.compare()
      • Logger.current()
      • Logger.get_record()
      • Logger.clear()
      • Logger.history
      • Logger.__init__()
    • Target
      • Target.name
      • Target.verbose
      • Target.name
      • Target.__init__()
      • Target.forward()
      • Target.add_to_state()
      • Target.maintenance()
    • DataTarget
      • DataTarget.name
      • DataTarget._model
      • DataTarget._data
      • DataTarget._scaler
      • DataTarget.verbose
      • DataTarget.name
      • DataTarget.__init__()
      • DataTarget.model
      • DataTarget.data
      • DataTarget.scaler
      • DataTarget.has_model
      • DataTarget.get_fcalc()
      • DataTarget.get_fcalc_scaled()
      • DataTarget.get_F_calc_scaled()
      • DataTarget.get_rfactor()
    • ModelTarget
      • ModelTarget.name
      • ModelTarget._model
      • ModelTarget.verbose
      • ModelTarget.name
      • ModelTarget.__init__()
      • ModelTarget.model
      • ModelTarget.restraints
    • Subpackages
      • torchref.refinement.optimizers package
        • AdamWithAdaptiveNoise
        • ExploratoryLBFGS
        • LangevinSA
        • MomentumStochasticSA
        • Submodules
      • torchref.refinement.targets package
        • Target
        • ModelTarget
        • DataTarget
        • gaussian_nll()
        • von_mises_nll()
        • adp_similarity_nll()
        • XrayTarget
        • GaussianXrayTarget
        • MaximumLikelihoodXrayTarget
        • LeastSquaresXrayTarget
        • create_xray_target()
        • DifferenceXrayTarget
        • PhaseInformedDifferenceTarget
        • RiceDifferenceTarget
        • TaylorCorrectedDifferenceTarget
        • GeometryTarget
        • BondTarget
        • AngleTarget
        • TorsionTarget
        • PlanarityTarget
        • ChiralTarget
        • NonBondedTarget
        • NonBondedHTarget
        • RamachandranTarget
        • ADPTarget
        • ADPSimilarityTarget
        • RigidBondTarget
        • ADPEntropyTarget
        • ADPLocalityTarget
        • CombinedTargets
        • TotalGeometryTarget
        • TotalADPTarget
        • ForceFieldTarget
        • AmberTarget
        • OccupancyFloorDiagnostic
        • NegativeDensityPenalty
        • DisplacementRegularizer
        • DifferenceAmplitudeRegularizer
        • SampledMLPhaseTarget
        • SampledMLDifferenceTarget
        • create_sampled_ml_target()
        • create_sampled_ml_difference_target()
        • RealSpaceTarget
        • RealSpaceCorrelationTarget
        • RealSpaceDifferenceTarget
        • RealSpaceExtrapolatedTarget
        • CoordinateSimilarityTarget
        • Subpackages
        • Submodules
      • torchref.refinement.weighting package
        • BaseWeighting
        • WeightingScheme
        • ResolutionWeighting
        • OverfittingWeighting
        • ManualWeighting
        • ComponentWeighting
        • Submodules
    • Submodules
      • torchref.refinement.base_refinement module
        • Refinement
      • torchref.refinement.lbfgs_refinement module
        • LBFGSRefinement
      • torchref.refinement.logger module
        • Logger
      • torchref.refinement.loss_state module
        • LossState
        • create_loss_state()
  • torchref.restraints package
    • Classes
    • Restraints
    • ResidueIterator
      • ResidueIterator.pdb
      • ResidueIterator.groups
      • ResidueIterator.__init__()
      • ResidueIterator.__iter__()
      • ResidueIterator.__len__()
      • ResidueIterator.get_consecutive_pairs()
    • RestraintBuilder
      • RestraintBuilder._indices
      • RestraintBuilder._references
      • RestraintBuilder._sigmas
      • RestraintBuilder._count
      • RestraintBuilder.restraint_type
      • RestraintBuilder.atom_columns
      • RestraintBuilder.n_atoms
      • RestraintBuilder.__init__()
      • RestraintBuilder.reset()
      • RestraintBuilder.process_residue()
      • RestraintBuilder.finalize()
      • RestraintBuilder.count
    • BondRestraintBuilder
      • BondRestraintBuilder.restraint_type
      • BondRestraintBuilder.atom_columns
      • BondRestraintBuilder.n_atoms
      • BondRestraintBuilder.process_residue()
    • AngleRestraintBuilder
      • AngleRestraintBuilder.restraint_type
      • AngleRestraintBuilder.atom_columns
      • AngleRestraintBuilder.n_atoms
      • AngleRestraintBuilder.process_residue()
    • TorsionRestraintBuilder
      • TorsionRestraintBuilder._periods
      • TorsionRestraintBuilder.restraint_type
      • TorsionRestraintBuilder.atom_columns
      • TorsionRestraintBuilder.n_atoms
      • TorsionRestraintBuilder.__init__()
      • TorsionRestraintBuilder.reset()
      • TorsionRestraintBuilder.process_residue()
      • TorsionRestraintBuilder.finalize()
    • PlaneRestraintBuilder
      • PlaneRestraintBuilder._planes_by_count
      • PlaneRestraintBuilder.restraint_type
      • PlaneRestraintBuilder.atom_columns
      • PlaneRestraintBuilder.n_atoms
      • PlaneRestraintBuilder.__init__()
      • PlaneRestraintBuilder.reset()
      • PlaneRestraintBuilder.process_residue()
      • PlaneRestraintBuilder.finalize()
    • ChiralRestraintBuilder
      • ChiralRestraintBuilder._ideal_volumes
      • ChiralRestraintBuilder.ideal_volume
      • ChiralRestraintBuilder.sigma
      • ChiralRestraintBuilder.restraint_type
      • ChiralRestraintBuilder.atom_columns
      • ChiralRestraintBuilder.n_atoms
      • ChiralRestraintBuilder.__init__()
      • ChiralRestraintBuilder.reset()
      • ChiralRestraintBuilder.process_residue()
      • ChiralRestraintBuilder.finalize()
    • InterResidueBondBuilder
      • InterResidueBondBuilder._indices
      • InterResidueBondBuilder._references
      • InterResidueBondBuilder._sigmas
      • InterResidueBondBuilder.__init__()
      • InterResidueBondBuilder.reset()
      • InterResidueBondBuilder.process_peptide_bond()
      • InterResidueBondBuilder.process_disulfide_bond()
      • InterResidueBondBuilder.finalize()
      • InterResidueBondBuilder.count
    • InterResidueAngleBuilder
      • InterResidueAngleBuilder.__init__()
      • InterResidueAngleBuilder.reset()
      • InterResidueAngleBuilder.process_peptide_angles()
      • InterResidueAngleBuilder.process_disulfide_angles()
      • InterResidueAngleBuilder.finalize()
      • InterResidueAngleBuilder.count
    • InterResidueTorsionBuilder
      • InterResidueTorsionBuilder.__init__()
      • InterResidueTorsionBuilder.reset()
      • InterResidueTorsionBuilder.process_peptide_torsions()
      • InterResidueTorsionBuilder.process_disulfide_torsions()
      • InterResidueTorsionBuilder.finalize_phi()
      • InterResidueTorsionBuilder.finalize_psi()
      • InterResidueTorsionBuilder.finalize_omega()
      • InterResidueTorsionBuilder.finalize_disulfide()
    • InterResiduePlaneBuilder
      • InterResiduePlaneBuilder.__init__()
      • InterResiduePlaneBuilder.reset()
      • InterResiduePlaneBuilder.process_peptide_planes()
      • InterResiduePlaneBuilder.finalize()
      • InterResiduePlaneBuilder.count
    • get_library_manager()
    • Submodules
      • torchref.restraints.builders module
        • Classes
        • ResidueIterator
        • RestraintBuilder
        • BondRestraintBuilder
        • AngleRestraintBuilder
        • TorsionRestraintBuilder
        • PlaneRestraintBuilder
        • ChiralRestraintBuilder
        • InterResidueBondBuilder
        • InterResidueAngleBuilder
        • InterResidueTorsionBuilder
        • InterResiduePlaneBuilder
      • torchref.restraints.builders_fast module
        • PreprocessedPDB
        • PreprocessedCIF
        • RestraintBuilder
        • BondRestraintBuilder
        • AngleRestraintBuilder
        • TorsionRestraintBuilder
        • PlaneRestraintBuilder
        • ChiralRestraintBuilder
        • build_all_restraints()
        • PreprocessedLinkData
        • InterResidueBondBuilder
        • InterResidueAngleBuilder
        • InterResidueTorsionBuilder
        • InterResiduePlaneBuilder
        • ResidueIterator
      • torchref.restraints.builders_numba module
        • find_atom_index()
        • match_bonds_numba()
        • match_angles_numba()
        • match_torsions_numba()
        • match_chirals_numba()
        • PreprocessedPDB
        • PreprocessedCIF
        • FastResidueIterator
        • FastBondBuilder
        • FastAngleBuilder
        • FastTorsionBuilder
        • FastPlaneBuilder
        • FastChiralBuilder
        • build_all_restraints_fast()
      • torchref.restraints.hydrogen_topology module
        • HydrogenTopology
        • build_hydrogen_topology()
        • place_riding_hydrogens()
        • build_h_candidate_pairs()
      • torchref.restraints.library module
        • MonomerLibraryManager
        • get_library_manager()
      • torchref.restraints.neighbor_search module
        • prefilter_symop_offsets()
        • assign_to_grid()
        • build_cell_list()
        • find_pairs_periodic_grid()
        • find_pairs_periodic_grid_v2()
        • exclusion_set_to_hash()
        • filter_pairs()
        • build_vdw_restraints_gpu()
        • find_h_vdw_pairs_gpu()
      • torchref.restraints.ramachandran module
        • Surface types
        • load_nll_surfaces()
        • classify_residue()
      • torchref.restraints.restraints module
        • RestraintsNew
      • torchref.restraints.restraints_helper module
        • validate_restraint_data()
        • read_cif()
        • split_respecting_quotes()
        • find_cif_file_in_library()
        • read_link_definitions()
        • build_restraints_bondlength()
        • build_restraints_angles()
        • build_restraints_torsion()
        • build_restraints_planes()
        • build_restraints()
        • calculate_restraints_bondlength()
        • calculate_restraints_angles()
        • calculate_restraints_torsion()
        • calculate_restraints_all()
        • read_for_component()
        • read_comp_list()
  • torchref.scaling package
    • Classes
    • Scaler
      • Scaler.device
      • Scaler.nbins
      • Scaler.__init__()
      • Scaler.model
      • Scaler.set_model_and_data()
      • Scaler.initialize()
      • Scaler.compute_fcalc()
      • Scaler.calc_initial_scale()
      • Scaler.fit_anisotropy()
      • Scaler.setup_solvent()
      • Scaler.fit_all_scales()
      • Scaler.screen_solvent_params()
      • Scaler.refine_lbfgs()
      • Scaler.rfactor()
      • Scaler.bin_wise_rfactor()
      • Scaler.get_binwise_mean_intensity()
      • Scaler.state_dict()
      • Scaler.load_state_dict()
    • ScalerBase
      • ScalerBase.device
      • ScalerBase.nbins
      • ScalerBase.__init__()
      • ScalerBase.set_data()
      • ScalerBase.initialize()
      • ScalerBase.hkl
      • ScalerBase.calc_initial_scale()
      • ScalerBase.setup_anisotropy_correction()
      • ScalerBase.anisotropy_correction()
      • ScalerBase.fit_anisotropy()
      • ScalerBase.set_solvent_model()
      • ScalerBase.setup_binwise_solvent_scale()
      • ScalerBase.fit_all_scales()
      • ScalerBase.fit_simple()
      • ScalerBase.get_scale()
      • ScalerBase.rfactor()
      • ScalerBase.bin_wise_rfactor()
      • ScalerBase.setup_bin_wise_bfactor()
      • ScalerBase.bin_wise_bfactor_correction()
      • ScalerBase.get_binwise_mean_intensity()
      • ScalerBase.screen_solvent_params()
      • ScalerBase.refine_lbfgs()
      • ScalerBase.estimate_sigma_eff()
      • ScalerBase.forward()
      • ScalerBase.state_dict()
      • ScalerBase.load_state_dict()
      • ScalerBase.save_state()
      • ScalerBase.load_state()
    • SolventModel
      • SolventModel.model
      • SolventModel.device
      • SolventModel.verbose
      • SolventModel.float_type
      • SolventModel.solvent_radius
      • SolventModel.erosion_radius
      • SolventModel.optimize_phase
      • SolventModel.log_k_solvent
      • SolventModel.b_solvent
      • SolventModel.phase_offset
      • SolventModel.__init__()
      • SolventModel.get_solvent_mask()
      • SolventModel.update_solvent()
      • SolventModel.smooth_solvent_mask()
      • SolventModel.get_rec_solvent()
      • SolventModel.forward()
      • SolventModel.parameters()
    • CollectionScaler
      • CollectionScaler.__init__()
      • CollectionScaler.initialize()
      • CollectionScaler.get_mixed_solvent_raw()
      • CollectionScaler.forward_mixed()
      • CollectionScaler.refine_lbfgs_joint()
      • CollectionScaler.screen_solvent_params_joint()
      • CollectionScaler.update_all_solvent()
      • CollectionScaler.invalidate_solvent_cache()
      • CollectionScaler.component_solvent_models
    • Submodules
      • torchref.scaling.collection_scaler module
        • CollectionScaler
      • torchref.scaling.scaler module
        • Scaler
      • torchref.scaling.scaler_base module
        • ScalerBase
      • torchref.scaling.solvent module
        • SolventModel
  • torchref.symmetry package
    • Cell
      • Cell.__init__()
      • Cell.reset_cache()
      • Cell.detach()
      • Cell.clone()
      • Cell.device
      • Cell.dtype
      • Cell.data
      • Cell.requires_grad
      • Cell.a
      • Cell.b
      • Cell.c
      • Cell.alpha
      • Cell.beta
      • Cell.gamma
      • Cell.fractional_matrix
      • Cell.inv_fractional_matrix
      • Cell.volume
      • Cell.reciprocal_basis_matrix
      • Cell.compute_grid_size()
      • Cell.tolist()
      • Cell.fractional_to_cartesian()
      • Cell.cartesian_to_fractional()
      • Cell.__repr__()
      • Cell.__getitem__()
      • Cell.__len__()
    • SpaceGroup
      • SpaceGroup.matrices
      • SpaceGroup.translations
      • SpaceGroup.n_ops
      • SpaceGroup.__init__()
      • SpaceGroup.n_ops
      • SpaceGroup.name
      • SpaceGroup.hm
      • SpaceGroup.xhm
      • SpaceGroup.number
      • SpaceGroup.gemmi
      • SpaceGroup.point_group
      • SpaceGroup.crystal_system
      • SpaceGroup.centrosymmetric
      • SpaceGroup.dtype
      • SpaceGroup.device
      • SpaceGroup.spacegroup
      • SpaceGroup.space_group
      • SpaceGroup.space_group_name
      • SpaceGroup.space_group_number
      • SpaceGroup.short_name()
      • SpaceGroup.operations()
      • SpaceGroup.apply()
      • SpaceGroup.apply_to_hkl()
      • SpaceGroup.expand_coords_to_P1()
      • SpaceGroup.forward()
      • SpaceGroup.get_grid_requirements()
      • SpaceGroup.check_grid_compatibility()
      • SpaceGroup.suggest_grid_size()
      • SpaceGroup.__hash__()
      • SpaceGroup.__eq__()
      • SpaceGroup.copy()
    • spacegroup_to_str()
    • get_symmetry_operations()
    • get_operations_as_tensors()
    • is_same_spacegroup()
    • get_point_group()
    • get_crystal_system()
    • is_centrosymmetric()
    • n_operations()
    • Symmetry
    • MapSymmetry()
    • MapSymmetryDirect
      • MapSymmetryDirect.__init__()
      • MapSymmetryDirect.get_symmetry_mate()
      • MapSymmetryDirect.forward()
      • MapSymmetryDirect.__call__()
      • MapSymmetryDirect.get_symmetry_info()
    • ReciprocalSymmetry()
    • ReciprocalSymmetryGrid
      • ReciprocalSymmetryGrid.space_group
      • ReciprocalSymmetryGrid.grid_shape
      • ReciprocalSymmetryGrid.symmetry
      • ReciprocalSymmetryGrid.n_ops
      • ReciprocalSymmetryGrid.__init__()
      • ReciprocalSymmetryGrid.apply_to_indices()
      • ReciprocalSymmetryGrid.get_phase_shift()
      • ReciprocalSymmetryGrid.get_symmetry_mate()
      • ReciprocalSymmetryGrid.get_all_symmetry_mates()
      • ReciprocalSymmetryGrid.symmetry_average()
      • ReciprocalSymmetryGrid.expand_to_p1()
      • ReciprocalSymmetryGrid.apply_friedel()
      • ReciprocalSymmetryGrid.is_systematic_absence()
      • ReciprocalSymmetryGrid.is_centric()
      • ReciprocalSymmetryGrid.get_epsilon()
      • ReciprocalSymmetryGrid.forward()
      • ReciprocalSymmetryGrid.__call__()
      • ReciprocalSymmetryGrid.get_symmetry_info()
    • expand_hkl()
    • complete_hkl()
    • reduce_hkl()
    • canonicalize_hkl()
    • expand_reflections()
    • expand_reciprocal_grid()
    • get_symmetry_grid_requirements()
    • check_grid_compatibility()
    • recommend_grid_size()
    • find_fft_friendly_size()
    • is_fft_friendly()
    • calculate_optimal_grid_size()
    • Submodules
      • torchref.symmetry.cell module
        • Cell
        • CellTensor
      • torchref.symmetry.grid_utils module
        • get_symmetry_grid_requirements()
        • find_fft_friendly_size()
        • is_fft_friendly()
        • calculate_optimal_grid_size()
        • check_grid_compatibility()
        • recommend_grid_size()
      • torchref.symmetry.map_symmetry module
        • MapSymmetry()
        • MapSymmetryDirect
      • torchref.symmetry.map_symmetry_interpolation module
        • MapSymmetry
      • torchref.symmetry.reciprocal_symmetry module
        • ReciprocalSymmetry()
        • ReciprocalSymmetryGrid
        • expand_hkl()
        • complete_hkl()
        • expand_reflections()
        • reduce_hkl()
        • canonicalize_hkl()
        • expand_reciprocal_grid()
      • torchref.symmetry.spacegroup module
        • spacegroup_to_str()
        • get_symmetry_operations()
        • get_operations_as_tensors()
        • is_same_spacegroup()
        • get_point_group()
        • get_crystal_system()
        • is_centrosymmetric()
        • n_operations()
        • is_fft_friendly()
        • find_fft_friendly_size()
        • get_grid_requirements()
        • check_grid_compatibility()
        • suggest_grid_size()
        • SpaceGroup
      • torchref.symmetry.symmetry module
        • Usage
        • Symmetry
  • torchref.base package
    • Submodules (New Organization)
    • Legacy Submodules (For Backward Compatibility)
    • FrenchWilson
      • FrenchWilson.hkl
      • FrenchWilson.d_spacings
      • FrenchWilson.is_centric
      • FrenchWilson.__init__()
      • FrenchWilson.forward()
    • CachedRadiusMask
      • CachedRadiusMask._cache
      • CachedRadiusMask.__init__()
      • CachedRadiusMask.get_offsets()
    • ReciprocalSymmetryExtractor
      • ReciprocalSymmetryExtractor.__init__()
      • ReciprocalSymmetryExtractor.__call__()
      • ReciprocalSymmetryExtractor.extract()
      • ReciprocalSymmetryExtractor.extract_from_grid()
    • cartesian_to_fractional_torch()
    • fractional_to_cartesian_torch()
    • get_fractional_matrix()
    • get_inv_fractional_matrix_torch()
    • cartesian_to_fractional()
    • fractional_to_cartesian()
    • get_inv_fractional_matrix()
    • convert_coords_to_fractional()
    • smallest_diff()
    • smallest_diff_aniso()
    • reciprocal_basis_matrix()
    • reciprocal_basis_matrix_numpy()
    • get_scattering_vectors()
    • get_scattering_vectors_numpy()
    • get_s()
    • get_d_spacing()
    • compute_d_spacing_batch()
    • generate_possible_hkl()
    • place_on_grid()
    • extract_structure_factor_from_grid()
    • apply_translation_phase()
    • interpolate_structure_factor_from_grid()
    • interpolate_complex_from_grid()
    • trilinear_interpolate_patterson()
    • compute_symmetry_equivalent_hkls()
    • compute_translation_phases()
    • extract_structure_factors_with_symmetry()
    • interpolate_for_rotation()
    • smooth_reciprocal_grid()
    • iso_structure_factor_torched()
    • iso_structure_factor_torched_no_complex()
    • aniso_structure_factor_torched()
    • aniso_structure_factor_torched_no_complex()
    • anharmonic_correction()
    • anharmonic_correction_no_complex()
    • core_deformation()
    • multiplication_quasi_complex_tensor()
    • vectorized_add_to_map()
    • vectorized_add_to_map_aniso()
    • scatter_add_nd()
    • scatter_add_nd_super_slow()
    • find_relevant_voxels()
    • excise_angstrom_radius_around_coord()
    • add_to_solvent_mask()
    • add_to_phenix_mask()
    • find_solvent_voids()
    • fft()
    • ifft()
    • get_real_grid()
    • find_grid_size()
    • get_real_grid_numpy()
    • get_grids()
    • put_hkl_on_grid()
    • get_scattering_factors()
    • get_scattering_factors_unique()
    • get_parametrization_for_elements()
    • calc_scattering_factors_paramtetrization()
    • compute_radial_shells()
    • assign_to_shells()
    • compute_anisotropy_correction()
    • compute_shell_cv()
    • fit_anisotropy_correction()
    • apply_anisotropy_correction()
    • F_squared_to_E_values()
    • rotate_coords_torch()
    • rotate_coords_numpy()
    • axis_angle_to_rotation_matrix()
    • rotation_matrix_to_axis_angle()
    • quaternion_to_rotation_matrix()
    • random_rotation_uniform()
    • superpose_vectors_robust_torch()
    • superpose_vectors_robust()
    • align_torch()
    • align_pdbs()
    • get_alignment_matrix()
    • apply_transformation()
    • apply_transformation_numpy()
    • invert_transformation_matrix()
    • get_rfactor_torch()
    • get_rfactor()
    • rfactor()
    • get_rfactors()
    • bin_wise_rfactors()
    • calc_outliers()
    • calc_outliers_numpy()
    • nll_xray()
    • nll_xray_sum()
    • nll_xray_lognormal()
    • log_loss()
    • estimate_sigma_I()
    • estimate_sigma_F()
    • gaussian_to_lognormal_sigma()
    • gaussian_to_lognormal_mu()
    • compute_metric_tensor()
    • precompute_fractional_coords()
    • warmup()
    • get_cache_dir()
    • clear_cache()
    • warmup_cuda_operations()
    • get_cached_radius_offsets()
    • Subpackages
      • torchref.base.alignment package
        • superpose_vectors_robust_torch()
        • superpose_vectors_robust()
        • align_torch()
        • get_alignement_matrix()
        • align_pdbs()
        • get_alignment_matrix()
        • apply_transformation()
        • apply_transformation_numpy()
        • invert_transformation_matrix()
        • rotate_coords_torch()
        • rotate_coords_numpy()
        • axis_angle_to_rotation_matrix()
        • rotation_matrix_to_axis_angle()
        • quaternion_to_rotation_matrix()
        • random_rotation_uniform()
        • rotation_matrix_euler_zyz()
        • compute_radial_shells()
        • assign_to_shells()
        • compute_anisotropy_correction()
        • compute_shell_cv()
        • fit_anisotropy_correction()
        • apply_anisotropy_correction()
        • F_squared_to_E_values()
        • Submodules
      • torchref.base.chain_closure package
        • identify_backbone_atoms()
        • get_chain_residues()
        • compute_backbone_torsions()
        • estimate_secondary_structure()
        • plan_junction_placement()
        • get_junction_backbone_indices()
        • backbone_fk_junction()
        • closure_residual()
        • JunctionClosure
        • JunctionSolver
        • Submodules
      • torchref.base.coordinates package
        • cartesian_to_fractional_torch()
        • fractional_to_cartesian_torch()
        • get_fractional_matrix()
        • get_inv_fractional_matrix_torch()
        • cartesian_to_fractional()
        • fractional_to_cartesian()
        • get_fractional_matrix_numpy()
        • get_inv_fractional_matrix()
        • convert_coords_to_fractional()
        • smallest_diff()
        • smallest_diff_aniso()
        • Submodules
      • torchref.base.direct_summation package
        • iso_structure_factor_torched()
        • iso_structure_factor_torched_no_complex()
        • aniso_structure_factor_torched()
        • aniso_structure_factor_torched_no_complex()
        • anharmonic_correction()
        • anharmonic_correction_no_complex()
        • core_deformation()
        • multiplication_quasi_complex_tensor()
        • Submodules
      • torchref.base.electron_density package
        • vectorized_add_to_map()
        • vectorized_add_to_map_aniso()
        • scatter_add_nd()
        • scatter_add_nd_super_slow()
        • find_relevant_voxels()
        • excise_angstrom_radius_around_coord()
        • add_to_solvent_mask()
        • add_to_phenix_mask()
        • find_solvent_voids()
        • build_electron_density()
        • Submodules
      • torchref.base.fourier package
        • fft()
        • ifft()
        • get_real_grid()
        • find_grid_size()
        • get_real_grid_numpy()
        • get_grids()
        • put_hkl_on_grid()
        • Submodules
      • torchref.base.kernels package
        • vectorized_add_to_map()
        • build_electron_density()
        • compute_metric_tensor()
        • precompute_fractional_coords()
        • warmup()
        • get_cache_dir()
        • clear_cache()
        • warmup_cuda_operations()
        • CachedRadiusMask
        • get_cached_radius_offsets()
        • vectorized_add_to_map_optimized()
        • fused_add_to_map_gpu()
        • fused_find_and_place_atoms()
        • separable_density_gpu()
        • Submodules
      • torchref.base.metrics package
        • get_rfactor_torch()
        • get_rfactor()
        • rfactor()
        • get_rfactors()
        • bin_wise_rfactors()
        • calc_outliers()
        • calc_outliers_numpy()
        • nll_xray()
        • nll_xray_sum()
        • nll_xray_lognormal()
        • log_loss()
        • estimate_sigma_I()
        • estimate_sigma_F()
        • gaussian_to_lognormal_sigma()
        • gaussian_to_lognormal_mu()
        • Submodules
      • torchref.base.reciprocal package
        • reciprocal_basis_matrix()
        • reciprocal_basis_matrix_numpy()
        • get_scattering_vectors()
        • get_scattering_vectors_numpy()
        • get_s()
        • generate_possible_hkl()
        • get_d_spacing()
        • compute_d_spacing_batch()
        • place_on_grid()
        • extract_structure_factor_from_grid()
        • apply_translation_phase()
        • interpolate_structure_factor_from_grid()
        • interpolate_complex_from_grid()
        • trilinear_interpolate_patterson()
        • interpolate_for_rotation()
        • smooth_reciprocal_grid()
        • compute_symmetry_equivalent_hkls()
        • compute_translation_phases()
        • extract_structure_factors_with_symmetry()
        • ReciprocalSymmetryExtractor
        • Submodules
      • torchref.base.scattering package
        • get_scattering_factors_unique()
        • get_scattering_factors()
        • get_scattering_itc92()
        • calc_scattering_factors_paramtetrization()
        • get_parameterization()
        • get_parameterization_extended()
        • get_parametrization_for_elements()
        • get_parametrization_atom()
        • linear_interpolation()
        • load_scattering_table()
        • get_scattering_params_by_z()
        • get_element_to_z_mapping()
        • get_z_to_element_mapping()
        • get_scattering_params_for_ion()
        • elements_to_z()
        • get_anomalous_correction()
        • get_significant_elements()
        • get_anomalous_corrections_by_indices()
        • Submodules
      • torchref.base.targets package
        • Mapping
        • adp_kl_math()
        • adp_locality_math()
        • adp_simu_math()
        • angle_math()
        • bhattacharyya_xray_loss_math()
        • bond_math()
        • chiral_math()
        • gaussian_xray_loss_math()
        • ls_xray_loss_math()
        • ml_xray_loss_math()
        • nonbonded_heavy_math()
        • planarity_math()
        • ramachandran_math()
        • torsion_omega_math()
        • torsion_unimodal_math()
        • Subpackages
        • Submodules
    • Submodules
      • torchref.base.CCTBX_related module
        • calculate_scattering_factor_cctbx()
      • torchref.base.french_wilson module
        • interpolate_table()
        • french_wilson_acentric()
        • french_wilson_centric()
        • french_wilson()
        • is_centric_from_hkl()
        • get_centric_acentric_masks()
        • estimate_mean_intensity_by_resolution()
        • french_wilson_auto()
        • FrenchWilson
      • torchref.base.get_scattering_factor_torch module
        • get_scattering_factors_unique()
        • get_scattering_factors()
        • linear_interpolation()
        • get_scattering_itc92()
        • calc_scattering_factors_paramtetrization()
        • get_parameterization()
        • get_parameterization_extended()
        • get_parametrization_for_elements()
        • get_parametrization_atom()
      • torchref.base.math_numpy module
        • cartesian_to_fractional()
        • fractional_to_cartesian()
        • get_fractional_matrix()
        • get_inv_fractional_matrix()
        • convert_coords_to_fractional()
        • reciprocal_basis_matrix()
        • get_scattering_vectors()
        • get_s()
        • get_real_grid()
        • get_grids()
        • put_hkl_on_grid()
        • rotate_coords_numpy()
        • superpose_vectors_robust()
        • align_pdbs()
        • get_alignment_matrix()
        • apply_transformation()
        • invert_transformation_matrix()
        • get_rfactor()
        • calc_outliers()
        • get_res_for_dataset()
      • torchref.base.math_torch module
        • cartesian_to_fractional_torch()
        • fractional_to_cartesian_torch()
        • get_fractional_matrix()
        • get_inv_fractional_matrix_torch()
        • smallest_diff()
        • smallest_diff_aniso()
        • reciprocal_basis_matrix()
        • get_scattering_vectors()
        • get_d_spacing()
        • place_on_grid()
        • extract_structure_factor_from_grid()
        • apply_translation_phase()
        • interpolate_structure_factor_from_grid()
        • interpolate_complex_from_grid()
        • trilinear_interpolate_patterson()
        • iso_structure_factor_torched()
        • iso_structure_factor_torched_no_complex()
        • aniso_structure_factor_torched()
        • aniso_structure_factor_torched_no_complex()
        • anharmonic_correction()
        • anharmonic_correction_no_complex()
        • core_deformation()
        • multiplication_quasi_complex_tensor()
        • vectorized_add_to_map()
        • vectorized_add_to_map_aniso()
        • scatter_add_nd()
        • scatter_add_nd_super_slow()
        • find_relevant_voxels()
        • excise_angstrom_radius_around_coord()
        • add_to_solvent_mask()
        • add_to_phenix_mask()
        • find_solvent_voids()
        • fft()
        • ifft()
        • get_real_grid()
        • find_grid_size()
        • rotate_coords_torch()
        • axis_angle_to_rotation_matrix()
        • rotation_matrix_to_axis_angle()
        • quaternion_to_rotation_matrix()
        • random_rotation_uniform()
        • superpose_vectors_robust_torch()
        • align_torch()
        • get_alignement_matrix()
        • apply_transformation()
        • get_rfactor_torch()
        • rfactor()
        • get_rfactors()
        • bin_wise_rfactors()
        • calc_outliers()
        • nll_xray()
        • nll_xray_sum()
        • nll_xray_lognormal()
        • log_loss()
        • estimate_sigma_I()
        • estimate_sigma_F()
        • gaussian_to_lognormal_sigma()
        • gaussian_to_lognormal_mu()
        • U_to_matrix()
        • deterministic_tensor_digest()
        • hash_tensors()
        • french_wilson_conversion()
  • torchref.utils package
    • ParameterFingerprint
      • ParameterFingerprint.__init__()
      • ParameterFingerprint.matches()
    • CachedForwardMixin
      • CachedForwardMixin.__call__()
      • CachedForwardMixin.reset_forward_cache()
    • DeviceMixin
      • DeviceMixin.to()
      • DeviceMixin.cuda()
      • DeviceMixin.cpu()
    • DeviceMovementMixin
    • resolve_device()
    • TensorMasks
      • TensorMasks.__init__()
      • TensorMasks.__setitem__()
      • TensorMasks.reset_cache()
      • TensorMasks.__call__()
    • TensorDict
      • TensorDict.__init__()
      • TensorDict.keys()
      • TensorDict.values()
      • TensorDict.items()
    • ModuleReference
      • ModuleReference._wrapped_module
      • ModuleReference.__init__()
      • ModuleReference.module
      • ModuleReference.__getattr__()
      • ModuleReference.__call__()
    • save_map()
    • sanitize_pdb_dataframe()
    • parse_phenix_selection()
    • create_selection_mask()
    • DebugMixin
      • DebugMixin.print_debug_summary()
      • DebugMixin.debug_on_error()
    • print_module_summary()
    • StatEntry
      • StatEntry.value
      • StatEntry.verbosity
      • StatEntry.value
      • StatEntry.verbosity
      • StatEntry.__json__()
      • StatEntry.__init__()
    • stat()
    • filter_stats()
    • flatten_stats()
    • format_stats_table()
    • HyperparameterMixin
      • HyperparameterMixin.__init__()
      • HyperparameterMixin.register_hyperparameter()
      • HyperparameterMixin.get_hyperparameter()
      • HyperparameterMixin.set_hyperparameter()
      • HyperparameterMixin.hyperparameters()
      • HyperparameterMixin.named_hyperparameters()
      • HyperparameterMixin.hyperparameter_state_dict()
      • HyperparameterMixin.load_hyperparameter_state_dict()
      • HyperparameterMixin.hyperparameter_dict()
      • HyperparameterMixin.print_hyperparameters()
    • convert_to_serializable()
    • gradnorm()
    • validate_loss()
    • NonFiniteLossError
    • reset_diagnostic_budget()
    • collect_loss_leaves()
    • Submodules
      • torchref.utils.autograd_introspection module
        • collect_loss_leaves()
      • torchref.utils.autograd_ops module
        • gather_with_index_add()
      • torchref.utils.caching module
        • ParameterFingerprint
        • CachedForwardMixin
      • torchref.utils.debug_utils module
        • DebugMixin
        • print_module_summary()
      • torchref.utils.device_mixin module
        • DeviceMixin
        • DeviceMovementMixin
      • torchref.utils.device_resolution module
        • resolve_device()
      • torchref.utils.gradnorm module
        • gradnorm()
      • torchref.utils.hyperparameters module
        • HyperparameterMixin
        • create_hyperparameter_property()
      • torchref.utils.loss_validation module
        • Exports
        • Usage
        • NonFiniteLossError
        • reset_diagnostic_budget()
        • validate_loss()
      • torchref.utils.pse module
      • torchref.utils.serialization module
        • convert_to_serializable()
      • torchref.utils.stats module
        • Verbosity Levels
        • Usage
        • StatEntry
        • stat()
        • filter_stats()
        • flatten_stats()
        • format_stats_table()
      • torchref.utils.timing module
        • register_timing()
      • torchref.utils.utils module
        • ModuleReference
        • CIFReader
        • save_map()
        • TensorDict
        • TensorMasks
        • sanitize_pdb_dataframe()
        • parse_phenix_selection()
        • create_selection_mask()
        • state_dict_to_json_serializable()
        • dict_to_state_dict()
        • json_to_state_dicts_separate()
        • disable_grad_outside_optimizer()

Development

  • Contributing
    • Development Setup
    • Code Style
    • Docstring Format
    • Running Tests
    • Submitting Changes
  • Changelog
    • Version 0.5.3.3
    • Version 0.5.3.2
    • Version 0.5.3.1
    • Version 0.5.3
    • Version 0.5.2
    • Version 0.5.1
    • Version 0.5.0
    • Version 0.4.3
    • Version 0.4.2
    • Version 0.4.1
    • Version 0.4.0
    • Version 0.3.2
    • Version 0.3.0
    • Version 0.2.0
    • Version 0.1.0
TorchRef
  • torchref.cli package
  • View page source

torchref.cli package

Command-line interface for torchref.

Submodules

  • torchref.cli.add_metadata module
    • main()
  • torchref.cli.collection_difference_refine module
    • Output
    • setup_model_collection()
    • setup_dataset_collection()
    • setup_scaler()
    • compute_rfactors()
    • setup_loss_state()
    • compute_bayes_extrapolated_amplitudes()
    • write_results_mtz()
    • optimize_lbfgs()
    • main()
  • torchref.cli.mtz2map module
    • main()
  • torchref.cli.phased_difference_map module
    • main()
  • torchref.cli.refine module
    • main()
  • torchref.cli.strip_altlocs module
    • Usage
    • strip_altlocs()
    • main()
  • torchref.cli.validate_ded module
    • build_atom_mask()
    • compute_correlation()
    • compute_map_from_coefficients()
    • generate_plots()
    • setup_ded_context()
    • compute_ded_maps()
    • run_validation()
    • main()
Previous Next

© Copyright 2026, Hans Peter Seidel.

Built with Sphinx using a theme provided by Read the Docs.