Skip to content

Instantly share code, notes, and snippets.

View nilesh-tawari's full-sized avatar
🏠
Working from home

Nilesh Tawari nilesh-tawari

🏠
Working from home
View GitHub Profile
@nilesh-tawari
nilesh-tawari / featureCountsDEseq2
Last active May 8, 2019 09:55
featureCountsDEseq2
#!/usr/bin/env Rscript
################################################
################################################
## REQUIREMENTS ##
################################################
################################################
## DIFFERENTIAL ANALYSIS, SCATTERPLOTS AND PCA FOR SAMPLES IN FEATURECOUNTS FILE
## - FIRST SIX COLUMNS OF FEATURECOUNTS_FILE SHOULD BE INTERVAL INFO. REMAINDER OF COLUMNS SHOULD BE SAMPLES-SPECIFIC COUNTS.
@nilesh-tawari
nilesh-tawari / merge_fastq.sh
Created December 14, 2018 08:54
Merge fastq files from multiple lanes using shell script
#!/bin/bash
# $1 is PATH
args=("$@")
input_dir=${args[0]}
output_dir=${args[1]}
main() {
set -e -x -o pipefail
# get R1
declare -a fastq1=($(ls -d $input_dir/*R1*.fastq.gz)) #($(ls *_R1_001.fastq.gz))
@nilesh-tawari
nilesh-tawari / deseq2-analysis-template.R
Created December 11, 2018 13:51 — forked from stephenturner/deseq2-analysis-template.R
Template for analysis with DESeq2
## RNA-seq analysis with DESeq2
## Stephen Turner, @genetics_blog
# RNA-seq data from GSE52202
# http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=gse52202. All patients with
# ALS, 4 with C9 expansion ("exp"), 4 controls without expansion ("ctl")
# Import & pre-process ----------------------------------------------------
# Import data from featureCounts
@nilesh-tawari
nilesh-tawari / vepvcf_to_pandas.py
Last active July 29, 2019 06:55
Convert vep annotated vcf file to pandas dataframe
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 5 14:21:42 2018
@author: nilesh-tawari
email: tawari.nilesh@gmail.com
GitHub: https://github.com/nilesh-tawari
"""
from __future__ import print_function
import os
@nilesh-tawari
nilesh-tawari / compare_excel.py
Last active March 13, 2018 03:29
check_excel
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 13 09:40:36 2018
@author: rameshtn
"""
from __future__ import print_function
import os
import argparse
@nilesh-tawari
nilesh-tawari / DNAnexus_useful_snippets.sh
Created February 23, 2018 04:25
Code snippets for DNAnexus
# Deploy a python package on DNAnexus
## Step 1: find installation path of module
python
import imp
imp.find_module("pandas")
## Step 2: copy module and put in tarball
cp -r /mnt/software/unstowable/anaconda/lib/python2.7/site-packages/pandas .
@nilesh-tawari
nilesh-tawari / Git_repository.sh
Last active January 21, 2019 09:07
Git Repository
# Create git repository and push to remote
cd workspace/Clinical_genomics_framework/
git init
git add .
git commit -m "Clinical genomics framework"
echo "# Clinical_genomics_framework" >> README.md
git add README.md
git commit -m "Readme file"
Create a repo online using browser then push local to remote
@nilesh-tawari
nilesh-tawari / General
Created February 5, 2018 03:47
General_utils.txt
# Install cyvcf2 in ubuntu 16.04
sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev libssl-dev
sudo easy_install greenlet
sudo easy_install gevent
@nilesh-tawari
nilesh-tawari / Pandas_cheatsheet.py
Last active March 1, 2023 07:43
Pandas_cheatsheet.py
import pandas as pd
# fix SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Either of following
pd.options.mode.chained_assignment = None # default='warn'
df.is_copy = False
# read big csv
df = pd.read_csv(FILE_PATH, sep='\t', comment = '#', chunksize=1000, \
low_memory=False, iterator = True, compression='gzip')
@nilesh-tawari
nilesh-tawari / VEP_install.txt
Last active December 5, 2021 17:56
VEP installation
https://asia.ensembl.org/info/docs/tools/vep/script/vep_options.html
# Instructions for installing and running new VEP
## 1. Install new version of VEP:
git clone https://github.com/Ensembl/ensembl-vep.git
cd ensembl-vep
perl INSTALL.pl
## 2. Install merged cache