Skip to content

Instantly share code, notes, and snippets.

View cnh's full-sized avatar
💊
lets use ml to fight disease, especially cancer

tp53 cnh

💊
lets use ml to fight disease, especially cancer
View GitHub Profile
#1. Loop through all the text files in the directory and store contents in a giant list
import os, glob
path_files_texts = []
path_to_dir_of_path_reports = "/path/to/txt/files"
# Loop through all the text files in the directory and store contents in a giant list
for file in glob.glob(os.path.join(path_to_dir_of_path_reports, "*.txt")):
# Open each file and read its contents into a string
with open(file, "r" , encoding='cp1252') as f:
@cnh
cnh / v0.ipynb
Created April 24, 2023 08:33
text clustering using cohere's embed api
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cnh
cnh / cell_counting_tutorial_v0.ipynb
Created May 27, 2022 02:04
Cell counting tutorial
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cnh
cnh / zshrc
Created February 10, 2021 15:02
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/xeadmin/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 28 12:56:51 2017
@author: tp53
'''
'''
http://biopython.org/DIST/docs/api/Bio.SeqUtils-module.html
@cnh
cnh / pca_v0.py
Last active November 21, 2017 06:49
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 21 08:29:57 2017
@author: tp53
"""
import pandas as pd
import numpy as np
#import data manipulation modules
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.cross_validation import train_test_split
from keras.models import Sequential, load_model #to save , load and persist models
from keras.layers import Activation
from keras.optimizers import SGD
@cnh
cnh / drc_v0.py
Last active November 29, 2017 15:30
#import data manipulation modules
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.cross_validation import train_test_split
from keras.models import Sequential, load_model #to save , load and persist models
from keras.layers import Activation
from keras.optimizers import SGD
  1. General Background and Overview
@cnh
cnh / tweet_dumper.py
Last active August 29, 2015 14:16 — forked from yanofsky/LICENSE
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""