<commit_before>---
layout: post
title: Rotating around a dihedral with MDAnalysis
---

This will give something like this in the notebook itself:

<script src="{{site.js}}/build/ngl.js">
</script>

<script>

  NGL.mainScriptFilePath = "{{site.js}}/build/ngl.js";

  function onInit(){
	  var stage = new NGL.Stage( "viewport" );
	  stage.loadFile( "{{site.data}}/out.pdb", {asTrajectory: true} ).then( function( o ){
	      traj = o.trajList[0].trajectory;
	      var player = new NGL.TrajectoryPlayer( traj, {
		  step: 1,
		  timeout: 700,
		  interpolateStep: 100,
		  start: 0,
		  end: traj.numframes,
		  interpolateType: "linear",
		  mode: "loop",
		  direction: "bounce"
	      } );

              player.play();
              o.removeAllRepresentations();
    	      o.addRepresentation( "ball+stick", { multipleBond: true } );
	      o.autoView();
	  } );
	  stage.setTheme( "light" );

      window.addEventListener( "resize", function( event ){
         stage.handleResize();
      }, false );
      
      stage.viewer.container.addEventListener( "dblclick", function(){
         stage.toggleFullscreen();
      } );
  }

  document.addEventListener( "DOMContentLoaded", function() {
	  NGL.init( onInit );
  } );

</script>

<div id="viewport" style="max-width:100%; height:400px;"></div>
<commit_msg>removed NGL.init<commit_after>---
layout: post
title: Rotating around a dihedral with MDAnalysis
---

This will give something like this in the notebook itself:

<script src="{{site.js}}/build/ngl.js">
</script>

<script>

  NGL.mainScriptFilePath = "{{site.js}}/build/ngl.js";

  document.addEventListener( "DOMContentLoaded", function() {
      var stage = new NGL.Stage( "viewport" );
      stage.loadFile( "{{site.data}}/out.pdb", {asTrajectory: true} ).then( function( o ){
	  traj = o.trajList[0].trajectory;
	  var player = new NGL.TrajectoryPlayer( traj, {
	      step: 1,
	      timeout: 700,
	      interpolateStep: 100,
	      start: 0,
	      end: traj.numframes,
	      interpolateType: "linear",
	      mode: "loop",
	      direction: "bounce"
	  } );

          player.play();
          o.removeAllRepresentations();
    	  o.addRepresentation( "ball+stick", { multipleBond: true } );
	  o.autoView();
      } );
      stage.setTheme( "light" );

      window.addEventListener( "resize", function( event ){
          stage.handleResize();
      }, false );
      
      stage.viewer.container.addEventListener( "dblclick", function(){
          stage.toggleFullscreen();
      } );
  } );

</script>

<div id="viewport" style="max-width:100%; height:400px;"></div>

{'fraction_non_alphanumeric': 0.1598613251155624, 'fraction_numerical': 0.011556240369799691, 'mean_word_length': 2.796783625730994, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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}}
{'dir': 'git-commits-cleaned', 'id': '2825722', 'n_tokens_mistral': 914, 'n_tokens_neox': 834, 'n_words': 181}