Skip to content

Instantly share code, notes, and snippets.

View ravila4's full-sized avatar

Ricardo Avila ravila4

View GitHub Profile
@ravila4
ravila4 / intro_biopython.ipynb
Created April 29, 2018 15:52
Introduction to Biopython
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ravila4
ravila4 / linear_regression.ipynb
Created April 29, 2018 16:29
Linear regression example with sklearn and statsmodels
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ravila4
ravila4 / Surface_plots.ipynb
Created April 29, 2018 16:32
Molecular surface plots with oddt
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ravila4
ravila4 / nglview.ipynb
Created April 29, 2018 22:25
NGLView - Basics
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ravila4
ravila4 / BioservicesUniProt.ipynb
Created July 7, 2018 17:37
Getting UniProt Annotations
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ravila4
ravila4 / .tmux.conf
Created August 5, 2019 18:26
Tmux configuration
# $Id: vim-keys.conf,v 1.2 2010-09-18 09:36:15 nicm Exp $
#
# vim-keys.conf, v1.2 2010/09/12
#
# By Daniel Thau. Public domain.
#
# This configuration file binds many vi- and vim-like bindings to the
# appropriate tmux key bindings. Note that for many key bindings there is no
# tmux analogue. This is intended for tmux 1.3, which handles pane selection
# differently from the previous versions
blastp -db fasta.fa -query database.fa \
-outfmt "6 std stitle qcovs" -num_threads 10 -out out.blast
#!/bin/bash
TYPE=${TYPE:-prot}
[[ ! -z ${1} ]] && INFILE=${1} || exit 1
shift
makeblastdb -in ${INFILE} -dbtype ${TYPE} -parse_seqids ${@} -blastdb_version 5
#!/usr/bin/env python
import pandas as pd
import click
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio import SeqIO
@click.command()
@ravila4
ravila4 / pandas_snippets.py
Created August 31, 2019 15:56
Chris's useful pandas snippets.
# List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
# Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
# Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(valuelist)]