Skip to content

Instantly share code, notes, and snippets.

View raivivek's full-sized avatar
👋

Vivek Rai raivivek

👋
View GitHub Profile
@raivivek
raivivek / de_analysis.R
Created August 27, 2024 01:39
Share with Kehinde / raivivek / DeSeq2 analysis of raw bulk RNA-seq
[...]
run_differential <- function(counts_mat, metadata,
design = "Disease.Status + Age + Sex + BMI",
min_reads_per_sample = 5,
min_fraction_of_sample = .25) {
sample_ids <- colnames(counts_mat)
message(glue("info: counts matrix: {paste(dim(counts_mat), collapse = ', ')} \t Covariate matrix: {paste(dim(metadata), collapse = ', ')}"))
message("info: preparing colData..")
colData <- metadata %>%
mutate(Sample.ID = factor(Sample.ID, levels = sample_ids, ordered = T),
@raivivek
raivivek / bash-snippets.md
Created December 21, 2021 01:35 — forked from putnamhill/bash-snippets.md
bash snippets - these are mostly just notes for myself; some I've found and some I've made

git

list files in another branch

git ls-files --with-tree=another-branch

grep through all revisions of a repo

git grep -B1 -A2 AWSLambdaBasicExecutionRole $(git rev-list --all) -- *.tf
@raivivek
raivivek / readme-howto.md
Last active November 29, 2021 19:33
Instructions for updating and deploying theparkerlab.org

Structure

The website is hosted from the repository scjparker.github.io. The repo has two branches:

  • master where the deployed website lives
  • source where the source code for the website lives

The content pushed to the master branch is automatically shown on the theparkerlab.org homepage by the GitHub.

Making changes

@raivivek
raivivek / slope_vs_starting.md
Created August 14, 2021 20:06 — forked from gtallen1187/slope_vs_starting.md
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

@raivivek
raivivek / wayback.py
Created June 22, 2020 06:01 — forked from wcaleb/wayback.py
Pandoc filter to replace Link URLs with Wayback Machine URLs
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
# Usage: pandoc --filter=wayback.py input
# Install pandocfilters and requests with pip before using
# Warning: may take a while to process input with lots of links
# Note: Links that can't be saved to WBM or already point to WBM are left as is
from pandocfilters import toJSONFilter, Link
import requests
@raivivek
raivivek / Kobo Reader Highlights & Annotations
Created December 31, 2019 03:27 — forked from ozgurkalan/Kobo Reader Highlights & Annotations
Kobo eReader - KoboReader.sqlite - SQL statement for listing books, highlights and annotations per chapter
'''''list highlights and annotations by ISBN and book:
select
ISBN, title,
text, annotation
from bookmark
left outer join content
on (content.contentID=bookmark.VolumeID and content.ContentType=6)
where
text is not null;

Bedtools Cheatsheet

General:

Tools Description
flank Create new intervals from the flanks of existing intervals.
slop Adjust the size of intervals.
shift Adjust the position of intervals.
subtract Remove intervals based on overlaps b/w two files.
@raivivek
raivivek / fast_ai_mooc_important_points.md
Created March 4, 2019 16:31 — forked from bhavikngala/fast_ai_mooc_important_points.md
This gist contains a list of important points from fast.ai "practical deep learning for coders" and "cutting edge deep learning for coders" MOOC

This gist contains a list of points I found very useful while watching the fast.ai "Practical deep learning for coders" and "Cutting edge deep learning for coders" MOOC by Jeremy Howard and team. This list may not be complete as I watched the video at 1.5x speed on marathon but I did write down as many things I found to be very useful to get a model working. A fair warning the points are in no particular order, you may find the topics are all jumbled up.

Before beginning, I want to thank Jeremy Howard, Rachel Thomas, and the entire fast.ai team in making this awesome practically oriented MOOC.

  1. Progressive image resolution training: Train the network on lower res first and then increase the resolution to get better performance. This can be thought of as transfer learning from the same dataset but at a different resolution. There is one paper by NVIDIA as well that used such an approach to train GANs.

  2. Cyclical learning rates: Gradually increasing the learning rate initially helps to avoid getting stuc

@raivivek
raivivek / theme_ms.R
Created June 12, 2018 19:56 — forked from wpetry/theme_ms.R
ggplot2 theme for publication figures
library(ggplot2)
library(grid)
# define consistent ggplot theme to apply to all figures
theme_ms <- function(base_size=12, base_family="Helvetica") {
library(grid)
(theme_bw(base_size = base_size, base_family = base_family)+
theme(text=element_text(color="black"),
axis.title=element_text(face="bold", size = rel(1.3)),
axis.text=element_text(size = rel(1), color = "black"),
legend.title=element_text(face="bold"),

Flash Asus TM-AC1900 to Asus RT-AC68U

Asus TM-AC1900 is a T-Mobile rebranded router but exactly the same hardware as a RT-AC68U. It is touted as one of the best available routers in the market and is highly rated. However, TM-AC1900 contains a T-Mobile firmware which runs several years behind the official Asus firmware available for the hardware. Thus, it is of interest to "flash" the offical firmware with a newer one.

NOTE: The router works smoothly even without flashing. Don't flash if you don't need to.

Steps

Depending on the pre-installed firmware on the CellSpot router, many instructions below may or may not work for everyone. Howevery, they worked for mine.

Files needed