Skip to content

Instantly share code, notes, and snippets.

View fomightez's full-sized avatar

Wayne's Bioinformatics Code Portal fomightez

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fomightez
fomightez / For SO question about viewing tabs in HTML embedded using ipywidgets.ipynb
Last active April 1, 2024 19:49
For SO question about viewing tabs in HTML embedded using ipywidgets, see [here](https://stackoverflow.com/q/78256901/8508004)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fomightez
fomightez / SO Plot with trend line simple.ipynb
Created March 15, 2024 21:11
Adding a trend line after the fact in a different cell of a notebook.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fomightez
fomightez / SO Plot with trend line.ipynb
Last active March 15, 2024 21:04
Example adding trend line later in a different cell
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fomightez
fomightez / guess_number_script_with reset_v1.py
Created March 11, 2024 00:28
Guessing game using ipywidgets to enter guesses and not legacy-from-consoles `input()`, related to https://discourse.jupyter.org/t/input-function-not-working/2290/13?u=fomightez
import ipywidgets as widgets
import random
max_secret = 10
secret = random.randint(1, max_secret)
guesses_allowed = 3
guesses_made = 0
game_still_going = True
# to leave out the quotes around strings sent to `ouptut.update()`, based on https://stackoverflow.com/a/70130979/8508004
@fomightez
fomightez / demo_Fasta2Stucture.md
Last active February 23, 2024 22:14
Using mybinder dekstop to demo use of Fasta2Stucture that uses tkinter

Walkthrough for installation and trial use of Fasta2Structure in your browser in temporary remote sessions served via MyBinder

Benefits:

  • Runs remotely so nothing modified on your machine yet you can test Fasta2Structure use hands-on.
  • Almost everything is already prepared, only need to install one package (Biopython) and get the Fasta2Structure material to be demonstrated.
  • No login required.
@fomightez
fomightez / demo_directions.md
Last active February 23, 2024 20:15
Using MyBinder to demo use of PySimpleGUI

Using MyBinder to demo use of PySimpleGUI

Walkthrough for installation of PySimpleGUI and example use of PySimpleGUI in your browser in temporary remote sessions served via MyBinder

Benefits:

  • Runs remotely so nothing modified on your machine.
  • Everything is already prepared, except for installation of the one package to be demonstrated.
@fomightez
fomightez / try_Pylustrator_via_MyBinder.md
Last active February 23, 2024 19:47
Try Pylustrator right in your browser without installing anything on your system via temporary sessions served by MyBinder.org.

Walkthrough for installation and trial use of Pylustrator in your browser in temporary remote sessions served via MyBinder

Benefits:

  • Runs remotely so nothing modified on your machine yet you can test Pylustrator use hands-on.
  • Everything is already prepared, except for installation of the one package to be demonstrated.
  • No login required.

Options:

@fomightez
fomightez / Answer_text.md
Last active February 22, 2024 18:15
How to use nbformat to see a cell has been run - answer to SO https://stackoverflow.com/q/78038479/8508004

The code below scans an .ipynb file where the first two and fifth cells were run (named example_nb_saved_first_two_cells_run_plus_last.ipynb) and then makes a new notebook out of the executed cells:

import nbformat as nbf
ntbk = nbf.read("example_nb_saved_first_two_cells_run_plus_last.ipynb", nbf.NO_CONVERT)
cells_executed_previously = []
for cell in ntbk.cells:
    if cell.execution_count != None:
        cells_executed_previously.append(cell)
new_ntbk = ntbk