Skip to content

Instantly share code, notes, and snippets.

View zhoujj2013's full-sized avatar

zhoujj zhoujj2013

View GitHub Profile
@zhoujj2013
zhoujj2013 / separate_seq.pl
Last active December 26, 2015 18:09
Given a sequence then separate the sequence to piece with certain overlap.
#!/usr/bin/perl -w
use strict;
#use Data::Dumper;
# Usage:
# perl ./separate_seq.pl <piece length> <ovelap> <input file *.fa>
my ($l,$o,$f) = @ARGV;
open IN,"$f" || die $!;
@zhoujj2013
zhoujj2013 / gtf2refGene.pl
Last active December 17, 2023 14:07
Convert ensembl gtf file to UCSC refGene.txt file.
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
&usage if @ARGV<1;
#open IN,"" ||die "Can't open the file:$\n";
#open OUT,"" ||die "Can't open the file:$\n";
@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
@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 / 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 / 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 / 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 / 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 / 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
args <- commandArgs(TRUE)
dat = read.table(file=args[1])
library(ROCR)
predictions = dat$V2
labels = dat$V3
# perform prediction
pred <- prediction(predictions, labels)