Skip to content

Instantly share code, notes, and snippets.

Avatar

Saket Choudhary saketkc

View GitHub Profile
View test_rapids_ai_hcu_lung.py
import numpy as np
import scanpy as sc
import anndata
import sys
import time
import os
View activate_rapids_ai.py
import sys, os
dist_package_index = sys.path.index('/usr/local/lib/python3.6/dist-packages')
sys.path = sys.path[:dist_package_index] + ['/usr/local/lib/python3.6/site-packages'] + sys.path[dist_package_index:]
sys.path
exec(open('rapidsai-csp-utils/colab/update_modules.py').read(), globals())
View CDF.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@saketkc
saketkc / view.py
Created Dec 6, 2011
Prevent multiple form submission for Django Forms
View view.py
import hashlib
def register(request):
if request.method == 'POST':
request_post = request.POST
registration_form = RegistrationFormUniqueEmail(request_post)
hashstring=hashlib.sha1(str(request.POST.get('csrf_token'))) ## This is going to be unique ! A unique has
if request.session.get('sesionform')!=hashstring:
if registration_form.is_valid():
username = registration_form.cleaned_data['username']
email = registration_form.cleaned_data['email']
@saketkc
saketkc / dotplot_barplot_goseq.R
Last active Aug 1, 2019
clusterProfiler inspiredbarplot and dotplot for GOSeq
View dotplot_barplot_goseq.R
barplot <- function(df, showCategory=15){
df <- df[with(df, order(ratio, padj, decreasing = c(TRUE, FALSE))),]
df <- head(df, n=showCategory)
breaks <- round( c(0, 1/4, 2/4, 3/4, 1) * max(df[['ratio']]) , 2)
p_plot <- ggplot(df, aes_string(x="term", y="ratio", fill="padj")) +
geom_col() +
scale_y_continuous(expand=c(0, 0), breaks=breaks, limits=c(0, max(df[["ratio"]]+0.05))) +
scale_x_discrete(name='GO term') +
scale_fill_continuous(low="#00dbde", high="#FFF94C") +
theme(text=ggplot2::element_text(size=9)) +
View riboHMM_env.yaml
name: ribohmm
channels:
- conda-forge
- bioconda
- r
- defaults
dependencies:
- bcftools=1.9=h4da6232_0
- htslib=1.9=hc238db4_4
- libdeflate=1.0=h470a237_0
@saketkc
saketkc / python_slideshare_api.py
Created Jun 6, 2012
Python file for slideShare API
View python_slideshare_api.py
import urllib, urllib2
import time
import sha
import sys
import mimetools, mimetypes
from cStringIO import StringIO
from BeautifulSoup import BeautifulSoup
class Callable:
def __init__(self, anycallable):
@saketkc
saketkc / Pix-Plot-Demo.ipynb
Created Jul 5, 2018
Demo of Pix-plot with progress bars
View Pix-Plot-Demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Sequence logo using matplotlib.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View CCA--ggvegan.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.