Skip to content

Instantly share code, notes, and snippets.

View yangwu91's full-sized avatar

Yang Wu yangwu91

View GitHub Profile
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Written by Wu, Yang <wuyang@vt.edu>
'''
Usage:
python stringtie_FPKM.py <stringtie_output_dir>|<sample_list>
For example:
python stringtie_FPKM.py /foo/stringtie_output/
@yangwu91
yangwu91 / sra2fastq.sh
Created July 13, 2018 20:26
Download data from the SRA database, compatible with downstream Trinity assembly.
#!/bin/bash
if [ -f $1 ]; then
for SRA in `grep -o "SRR[0-9]\{7\}" $1`; do
echo $SRA
fastq-dump --defline-seq '@$sn[_$rn]/$ri' --split-files $SRA &
done
else
fastq-dump --defline-seq '@$sn[_$rn]/$ri' --split-files $1
fi
import matplotlib
# To solve remote session issues:
matplotlib.use("Agg")
# To make fonts editable (Type 3 to Type 2):
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
plt.savefig("foo.pdf", transparent = True) # PDF is the best.
# subplots settings:
@yangwu91
yangwu91 / timer.py
Last active October 31, 2017 16:01
import datetime
start_time = datetime.datetime.now()
end_time = datetime.datetime.now()
cost_time = (end_time - start_time).seconds
print "Done in %ss." % cost_time