<jupyter_start><jupyter_text>Introduction Goals:   * decrease the learning barrier of new lab students   * implement in this central repo daily useful workflows   * A swiss army knife<jupyter_code>%load_ext autoreload
%autoreload 2
import molsysmt as msmt
import os
dir_examples_pdb = msmt.utils.path_examples_pdb
dir_examples_mol2 = msmt.utils.path_examples_mol2
example_pdb_files=os.listdir(dir_examples_pdb)
print('Files preloaded from the PDB in the examples directory: \n {} \n'.format(example_pdb_files))

example_mol2_files=os.listdir(dir_examples_mol2)
print('Files preloaded from the MOL2 in the examples directory: \n {} \n'.format(example_mol2_files))
PDB_example_file = os.path.join(dir_examples_pdb,"1li2.pdb")
MOL2_example_file = os.path.join(dir_examples_mol2,"caffeine.mol2")<jupyter_output><empty_output><jupyter_text>Lists of engines, files and classes MolSysMT can work with.<jupyter_code>msmt.info_forms()<jupyter_output><empty_output><jupyter_text>Loading systems<jupyter_code>msmt.info_load(to_form='pdb')
msmt.info_load(from_form='pdbfixer')
system_pdbfixer = msmt.load(PDB_example_file,'pdbfixer')

msmt.get_form(system_pdbfixer)<jupyter_output><empty_output><jupyter_text>Fetching molecular systems from the PDBPDB files can be fetched and loaded straight as a PDBFixer (`pdbfixer`), MDTraj (`mdtraj`), OpenMM (`openmm`), ParmED (`parmed`), MDAnalysis (`mdanalysis`) or native (`native`) system. Where the "native" term means the main class take as base object by `MolSysSAK` -Includes a ParmED structure, a YANK topography and an MDTraj or OpenMM Topology-.***I have to include msmt.fetch(item) where item is `pdb:id, and any other id...`***<jupyter_code>PDB_id = 'pdb:1sux'
system_parmed = msmt.fetch(PDB_id,'parmed')
msmt.get_form(system_parmed)
PDB_id = 'pdb:1sux'
out_PDB_file = os.path.join(dir_examples_pdb,'1sux.pdb')
msmt.fetch(PDB_id,out_PDB_file)
os.listdir(dir_examples_pdb)
os.remove(out_PDB_file)<jupyter_output><empty_output><jupyter_text>Getting the form of an item<jupyter_code>system_unknown_form = msmt.load(PDB_example_file,'pdbfixer')
msmt.get_form(system_unknown_form)
msmt.get_form("PDB:1sux")
msmt.get_form(MOL2_example_file)<jupyter_output><empty_output><jupyter_text>Converting items Files can be converted into files:<jupyter_code>MOL2_file=os.path.join(dir_examples_mol2,'foo.mol2')
msmt.convert(PDB_example_file,MOL2_file)
os.listdir(dir_examples_mol2)
os.remove(MOL2_file)<jupyter_output><empty_output><jupyter_text>In general, molecular system's forms can be converted into other forms:<jupyter_code>msmt.info_convert(from_form='parmed')
msmt.info_convert(to_form='pdb')
msmt.info_convert()<jupyter_output>From... to...
openmm :  ['nglview']
mdanalysis :  ['nglview']
native :  []
pdbfixer :  ['mdtraj']
mdtraj :  []
parmed :  ['mol2', 'pdb']
pdbfixer.PDBFixer :  ['mdtraj', 'nglview']
native.Native :  ['nglview', 'openmm.Topology']
mdtraj.Topology :  ['openmm.Topology']
mdtraj.Trajectory :  ['pdb']
mdanalysis.Universe :  ['mdtraj', 'nglview', 'pdb']
openmm.Topology :  ['mdtraj.Topology', 'native', 'yank.Topography']
parmed.Structure :  ['mdtraj', 'nglview']
yank.Topography :  ['openmm.Topology']
sdf :  []
mol2 :  ['nglview', 'parmed', 'pdb']
pdb :  ['mdanalysis', 'mdtraj', 'mdtraj.Topology', 'mol2', 'native', 'native.Native', 'nglview', 'openmm.Positions', 'openmm.Topology', 'parmed', 'parmed.Structure', 'pdbfixer', 'pdbfixer.PDBFixer', 'yank.Topography']
smi :  []
ddb :  []
pdb:id :  ['mdtraj', 'mdtraj.Topology', 'native.Native', 'nglview', 'parmed', 'parmed.Structure', 'pdb', 'pdbfixer', 'yank.Topography']
nglview :  []

To... from...
nglview :  ['mdanalysis', 'mdanalysis.Universe', 'mol[...]<jupyter_text>A second example:<jupyter_code>system_parmed = msmt.load(MOL2_example_file,'parmed')
system_mdtraj = msmt.convert(system_parmed,'mdtraj')
msmt.convert(system_mdtraj,'caffeine.pdb')
os.listdir('.')
os.remove('caffeine.pdb')<jupyter_output><empty_output><jupyter_text>Selection<jupyter_code>system_mdtraj=msmt.load(PDB_example_file,'mdtraj')
system_pdbfixer=msmt.load(PDB_example_file,'pdbfixer')
system_mdanalysis=msmt.load(PDB_example_file,'mdanalysis')
system_parmed=msmt.load(PDB_example_file,'parmed')
msmt.select(system_mdtraj,'name CA and resid 10 to 20')
msmt.select(system_pdbfixer,'name CA and resid 10 to 20')
msmt.select(system_mdanalysis,'name CA and resid 10 to 20')
msmt.select(system_parmed,'name CA and resid 10 to 20')
msmt.select(PDB_example_file,'name CA and resid 10 to 20')
msmt.select("pdb:1li2",'name CA and resid 10 to 20')
msmt.select(system_mdanalysis,'name CA and (resid 10:20)','mdanalysis')
msmt.select(system_parmed,':10-20@CA','parmed')<jupyter_output><empty_output><jupyter_text>Geometric selection  Extract part of a molecular system  Viewing molecular systems<jupyter_code>msmt.info_viewers()
msmt.info_viewers(for_form='pdb')
msmt.info_viewers(to_viewer='nglview')
view=msmt.view(MOL2_example_file)
view
view=msmt.view('pdb:1l2y')
view
system_pdbfixer = msmt.load(PDB_example_file,'pdbfixer')
view=msmt.view(system_pdbfixer)
view<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1411115490737091, 'fraction_numerical': 0.012613322822230981, 'mean_word_length': 8.415584415584416, 'pattern_counts': {'":': 0, '<': 40, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '529294', 'license': 'MIT', 'n_tokens_mistral': 2054, 'n_tokens_neox': 2005, 'n_words': 339, 'path': 'examples/examples_MolSys/Introduction.ipynb', 'repo_name': 'LMMV/MolModMT', 'size': '5074'}