This file contains 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 sys | |
import os | |
from PIL import Image | |
import shutil | |
import numpy as np | |
mask_dir = "/Users/gireeshbogu/Downloads/MSNYD_8_22_17/MSNYD_8_22_17__AB_AXT1_fl2d_inopp_mbh_15/masks_machine/" | |
new_mask_dir = "/Users/gireeshbogu/Downloads/MSNYD_8_22_17__AB_AXT1_fl2d_inopp_mbh_15_masks/" | |
if not os.path.exists(new_mask_dir): |
This file contains 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
# identify images with at least one mask (sum of all pixels > 0) and copy them to a new folder | |
# usage: script.py mask_dir new_mask_dir | |
import sys | |
import os | |
from PIL import Image | |
import shutil | |
import pandas as pd | |
import numpy as np |
This file contains 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
from glob import glob | |
import cv2 | |
jpgs = glob('./*.jpg') | |
for image in jpgs: | |
img = cv2.imread(image) | |
cv2.imwrite(image[:-3] + 'png', img) |
This file contains 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
# Simulate Omics style data for ML | |
import uuid | |
import itertools | |
features = 700 | |
subjects = 40 | |
columns_list = [] |
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.
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
library(ggplot2) | |
# plot volcano plot | |
res <- read.table("Male_vs_Female_Pre", head=TRUE) | |
res$Significant <- ifelse(res$adj.P.Val < 0.05, "adj.P.Val < 0.05", "Not Significant") | |
ggplot(res, aes(x = logFC, y = -log10(P.Value))) + | |
geom_point(aes(color = Significant)) + | |
scale_color_manual(values = c("red", "grey")) + | |
theme_bw(base_size = 12) + theme(legend.position = "bottom") + | |
geom_text_repel( |