Skip to content

Instantly share code, notes, and snippets.

View nsarode's full-sized avatar

Neha Sarode nsarode

  • Harvard University
  • Cambridge, MA
View GitHub Profile
@nsarode
nsarode / gist:d4b39222f1b1f483168188babefbe225
Created March 7, 2018 19:38 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@nsarode
nsarode / Anaconda_conda_basics.md
Last active October 27, 2020 17:24
Conda environment installation, setup, use and tips & tricks. [#conda #anaconda #python]

Most used commands

# Get list of already set up environments
conda env list

# Create an environment with specified python version
conda create -n py36 python=3.6 anaconda

# Create environment without prompting for yes/no and quiet mode
@nsarode
nsarode / pandas_notes.md
Last active July 20, 2024 00:18
Pandas notes : Compiling a reference list of commands relevant to Pandas

Version check

pd.__version__

Summary stats

df.describe()

Rows and column counts

@nsarode
nsarode / JupyterLabNotebook_notes.md
Last active September 18, 2022 05:40
Jupyter lab notebook tips & tricks [#python #jupyter]

Generic

Cell operation shortcuts

❗ capitalization doesn't matter for these shortcuts

  • b to add new cell below
  • m change cell to markdown
  • y change cell to code
  • dd delete cell

Reading

Open file for reading

f = open("somefile.txt", "r")
print(f.read()) # print entire file
print(f.read(4)) # print first 4 characters of the file
@nsarode
nsarode / DatabaseSizeSummary.py
Created April 10, 2018 18:59 — forked from pfdevmuller/DatabaseSizeSummary.py
Python script to output the number of tables, columns and rows in a SQLite database
# <author>Pieter Muller</author>
# <date>2012-11-14</date>
import sys
import sqlite3 as sqlite
tablesToIgnore = ["sqlite_sequence"]
outputFilename = None
@nsarode
nsarode / aws_batch_commands.md
Last active April 19, 2019 15:48
AWS batch

AWS-CLI way

First create a skeleton to edit

aws batch submit-job --generate-cli-skeleton > job.json

Edit the script as needed e.g. for the fetch-and-run job the final file FetchRunClijob.json looks like this

{
@nsarode
nsarode / aws_s3.md
Last active January 24, 2020 14:50
AWS-CLI commands to work with S3 bucket

Login

sudo $(aws ecr get-login --no-include-email --region us-east-1)

AWS Simple Storage Service (s3)

General

List buckets

@nsarode
nsarode / extract_fastq_bam.md
Created July 9, 2019 18:22 — forked from darencard/extract_fastq_bam.md
Extract paired FASTQ reads from a BAM mapping file

Extracting paired FASTQ read data from a BAM mapping file

Sometimes FASTQ data is aligned to a reference and stored as a BAM file, instead of the normal FASTQ read files. This is okay, because it is possible to recreate raw FASTQ files based on the BAM file. The following outlines this process. The useful software samtools and bedtools are both required.

From each bam, we need to extract:

  1. reads that mapped properly as pairs
  2. reads that didn’t map properly as pairs (both didn’t map, or one didn’t map)

For #1, the following command will work. This was taken from this webpage.

@nsarode
nsarode / graph_gist_template.adoc
Created July 16, 2019 13:54 — forked from jexp/graph_gist_template.adoc
CHANGEME: GraphGist Template. Fork to make your own, view source to see instruction comments

REPLACEME: TITLE OF YOUR GRAPHGIST

Introduction