Skip to content

Instantly share code, notes, and snippets.

Avatar

Yang Wu yangwu91

View GitHub Profile
@yangwu91
yangwu91 / sra2fastq.sh
Created Jul 13, 2018
Download data from the SRA database, compatible with downstream Trinity assembly.
View sra2fastq.sh
#!/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
View stringtie_FPKM.py
#!/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/
View matplotlib_common_solutions.py
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:
View timer.py
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