Skip to content

Instantly share code, notes, and snippets.

View zhoujj2013's full-sized avatar

zhoujj zhoujj2013

View GitHub Profile
setwd('WGCNA/')
# 56 breast cancer cell lines were profiled to identify patterns of gene expression associated with subtype and response to therapeutic compounds.
if(F){
## https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE48213
#wget -c ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE48nnn/GSE48213/suppl/GSE48213_RAW.tar
#tar -xf GSE48213_RAW.tar
#gzip -d *.gz
## 首先在GSE48213_RAW目录里面生成tmp.txt文件,使用shell脚本
# awk '{print FILENAME"\t"$0}' * |grep -v EnsEMBL_Gene_ID >tmp.txt
## 然后把tmp.txt导入R语言里面用reshape2处理即可
args <- commandArgs(TRUE)
prefix = args[1]
#print(args[c(2:length(args))])
pdf(paste(prefix,".density.pdf",sep=""))
color = rainbow(length(args) - 1)
for (i in 2:length(args)){
dat = read.table(args[i],header=F)
args <- commandArgs(TRUE)
dat = read.table(file=args[1])
library(ROCR)
predictions = dat$V2
labels = dat$V3
# perform prediction
pred <- prediction(predictions, labels)
@zhoujj2013
zhoujj2013 / gist:d05aeeec1e5286bbd15b
Last active August 29, 2015 14:21
rocr_score_label_data.txt
Plekhg2 10.63065 1
Plekhg3 6.576155 1
Plekhg1 4.555775 1
Plekhg6 0.9426185 1
4930592I03Rik 0.02947105 1
Plekhg4 0.7554405 1
Plekhg5 25.47185 1
Nsa2 38.0276 1
Nampt 27.66735 1
Ndc1 24.23355 1
@zhoujj2013
zhoujj2013 / sam2wig.pl
Created July 16, 2014 08:11
convert sam to wig format
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
use Getopt::Long;
# Written by [email protected]
# convert sam to wig format
my ($bin,$mq,$normalize, $chunk_size);
@zhoujj2013
zhoujj2013 / import_gff3_by_chr.pl
Last active August 29, 2015 14:04
import gff3 file to jbrowser by chr
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
## Written by [email protected]
# import gff3 file to jbrowser by chr
# default jbrowser installation diretory is /var/www/jbrowser/
my ($gff3_f,$outdir) = @ARGV;
@zhoujj2013
zhoujj2013 / gtf2gff3.pl
Created July 16, 2014 02:59
gtf2gff3.pl: convert ensembl gtf to gff3 format, just for JBrowser
#/usr/bin/perl -w
use strict;
use Data::Dumper;
## Written by [email protected]
## convert ensembl gtf to gff3 format, just for JBrowser
my ($gtf_f, $chr_list_f) = @ARGV; # ensembl gtf file, gtf from different source are different.
@zhoujj2013
zhoujj2013 / StandardizeGeneBankFaFormat.pl
Created July 1, 2014 15:56
Standardize GeneBank Fasta Format
#!/usr/bin/perl -w
use strict;
my $f = shift; # input fasta file download from batch Entrez (http://www.ncbi.nlm.nih.gov/sites/batchentrez)
open IN,"$f" || die $!;
$/ = ">"; <IN>; $/ = "\n";
while(<IN>){
chomp;
my $id = $_;
@zhoujj2013
zhoujj2013 / extract_multialign_block.pl
Last active August 29, 2015 14:03
extract_multialign_block from t-coffee fasta msa result
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
my ($file, $max_gap, $min_block) = @ARGV;
my %fa;
my @id;
@zhoujj2013
zhoujj2013 / NewDebian4Bioinfo.sh
Created June 7, 2014 13:00
Some commons for set up a debian linux for bioinformatics analysis.(Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.57-3+deb7u2 x86_64 GNU/Linux)
# install debian linux from official website (with web server, ssh server application)
# source.lst for different district:
# update the source.lst and then update debian linux
su root
# input the password
cp new_source.lst /etc/apt/source.lst
apt-get update
# or edit by vi /etc/apt/source.lst, then update