Skip to content

Instantly share code, notes, and snippets.

View saliksyed's full-sized avatar

Salik Syed saliksyed

  • California
View GitHub Profile
@saliksyed
saliksyed / vit.py
Created October 29, 2023 14:12
ViT encoder/decoder
import random
import torchvision
import torch
import torch.nn as nn
import skimage
from torch.utils.data import Dataset
from typing import Callable
from collections import OrderedDict
from functools import partial
import torchvision.transforms as transforms
HEADER 01-JUN-22
TITLE ALPHAFOLD MONOMER V2.0 PREDICTION FOR D(1C) DOPAMINE RECEPTOR
TITLE 2 (P42291)
COMPND MOL_ID: 1;
COMPND 2 MOLECULE: D(1C) DOPAMINE RECEPTOR;
COMPND 3 CHAIN: A
SOURCE MOL_ID: 1;
SOURCE 2 ORGANISM_SCIENTIFIC: XENOPUS LAEVIS;
SOURCE 3 ORGANISM_TAXID: 8355
REMARK 1
atom_index color
1 22.96100353908328
2 3.3231057511876716
3 16.622375590042605
4 93.3939981948933
5 25.316478839814806
6 78.86077758685197
7 37.4916379822561
8 64.38356710739292
9 33.67297273730202
from tensorflow.keras.applications.vgg16 import VGG16
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Model
import tensorflow as tf
import matplotlib.pyplot as plt
def add_prefix(model, prefix: str, custom_objects=None):
config = model.get_config()
old_to_new = {}
import pyvista
from PIL import Image
import shutil
import os
import numpy as np
import random
OUTPUT_DIR = 'extruded_polygons'
NUM_IMAGES = 10000

3.2.2 Run initial mongo shell

mongo admin

you should get a mongo shell like

3. Setup local MongoDB server as a Docker container

3.1. Download and launch local mongo docker image.

sudo docker run -p 27017:27017 --name some-mongo -d mongo --auth

This will download the official mongo Docker image and run it in detached mode with auth turned on.

@saliksyed
saliksyed / fibonacci.js
Created January 8, 2020 21:56
Fibonacci sequence algorithm in Javascript
function fibonacci(num){
var a = 1, b = 0, temp;
while (num >= 0){
temp = a;
a = a + b;
b = temp;
num--;
}
@saliksyed
saliksyed / parse_immune_atlas_data.py
Created November 1, 2018 19:53
Immune Atlas data parser
"""
Downloaded from: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE118189
"""
with open('GSE118189_ATAC_counts.txt', 'r') as f:
cell_files = None
for line in f.readlines():
line = line.rstrip()
if not cell_files:
cell_types = line.split('\t')
cell_files = [open('./ImmuneAtlasBed/' + cell + '.bed' , 'w') for cell in cell_types]
@saliksyed
saliksyed / improved_api_interface.py
Last active November 1, 2018 14:19
Improving the API interface
class Pathway:
def __init__(self, api):
self.api = api
def datasets(self):
""" Returns the list of all pathway datasets available"""
pass
def getPathways(self, datasets=[Dataset.KEGG]):