-
Go to my fork of the VPython Binder repository in your browser.
-
That will take you to a new page and trigger deploying version of the jupyter notebook environment from the correct repository. You shouldn't need to do anything as this takes place; you can watch the progress bar roughly in the middle of the screen, just below the
Launchbutton. It may take about a minute. After it boots up, it should bring you to the dashboard that will look like below
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # List unique values in a DataFrame column | |
| df['Column Name'].unique() # Note, `NaN` is included as a unique value. If you just want the number, use `nunique()` which stands | |
| # for 'number of unique values'; By default, it excludes `NaN`. `.nunique(dropna=False)` will include `NaN` in the count of unique values. | |
| # To extract a specific column (subset the dataframe), you can use [ ] (brackets) or attribute notation. | |
| df.height | |
| df['height'] | |
| # are same thing!!! (from http://www.stephaniehicks.com/learnPython/pages/pandas.html | |
| # -or- | |
| # http://www.datacarpentry.org/python-ecology-lesson/02-index-slice-subset/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Updated 2025-01-17 thanks to Yemster's comment. | |
| This should work on any architecture of Amazon Linux 2. | |
| (_Although not tested , should also work for Amazon Linux 2023_). | |
| **Prereq** | |
| - visit https://johnvansickle.com/ffmpeg/ to grab the link to the relevant tarball for your specific server architecture. | |
| - Use `uname -a` to find out your arch if unknown | |
| ### TL;DR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from functools import lru_cache | |
| from collections import defaultdict | |
| # Read in the taxonomy | |
| class NCBITaxonomy(): | |
| def __init__(self, folder): | |
| self.tax = defaultdict(dict) | |
| # Read in the file of taxid information | |
| names_fp = os.path.join(folder, 'names.dmp') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int[][] result; | |
| float t, c; | |
| float ease(float p) { | |
| return 3*p*p - 2*p*p*p; | |
| } | |
| float ease(float p, float g) { | |
| if (p < 0.5) | |
| return 0.5 * pow(2*p, g); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %matplotlib notebook | |
| # use `%matplotlib notebook` if you are using current JupyterLab | |
| from vpython import * | |
| import matplotlib.pyplot as plt | |
| plt.style.use('ggplot') | |
| # based on "AtomicSolid" by Bruce Sherwood | |
| # adapted to include realtime matplotlib by Wayne Decatur |
- Go to VPython.org in your browser. The landing page will look like below.
-
Click on
Binder packagelink on that page. That link is near the very bottom of the part of the page that is showing above; it is just below Demo Programs. -
A notebook will then launch. (Sometimes first times they hang, just hit
reloadin your browser.)
After it loads fully it will look like below with a URL different from what you see but similar.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """Sequence-based structural alignment of two proteins.""" | |
| import argparse | |
| import pathlib | |
| from Bio.PDB import FastMMCIFParser, MMCIFIO, PDBParser, PDBIO, Superimposer | |
| from Bio.PDB.Polypeptide import is_aa |

