annotate NEUMA-1.2.1/NIR2LVKM.pl @ 0:c44c43d185ef draft default tip

NEUMA-1.2.1 Uploaded
author chawhwa
date Thu, 08 Aug 2013 00:46:13 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
1 #!/usr/bin/perl
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
2
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
3
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
4 # This version (v.12) has an option of datatype (Refseq vs Ensembl).
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
5
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
6 if(@ARGV<13) { print "usage: $0 sample_name readcount_dir midrefix(samplename.midrefix.i.all.gMA) EUMA_out_dir FVKM_out_dir LVKM_out_dir EUMA_cut mapping_stat_column mapping_stat_file presence_of_i_at_end_of_midrefix[1/0] final_adjustment_option[1:average & rescaling/2:max & no rescaling] gene2NM_file gene2symbol_file datatype(R(Refseq)_or_E(Ensembl)) scriptdir\n"; exit; }
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
7
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
8 my $sample = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
9 my $readcount_dir = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
10 my $midrefix = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
11 my $EUMA_out_dir = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
12 my $FVKM_out_dir = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
13 my $LVKM_out_dir = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
14 my $EUMA_cut = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
15 my $mapping_stat_column = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
16 my $mapping_stat_file = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
17 my $i_after_midrefix = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
18 my $final_adjustment_option = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
19 my $gene2NM_file = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
20 my $gene2symbol_file = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
21 my $datatype = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
22 my $scriptdir = shift @ARGV;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
23
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
24 if(!-d $EUMA_out_dir) { `mkdir -p $EUMA_out_dir`; }
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
25 if(!-d $FVKM_out_dir) { `mkdir -p $FVKM_out_dir`; }
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
26 if(!-d $LVKM_out_dir) { `mkdir -p $LVKM_out_dir`;}
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
27
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
28 #$perlcommand = "perl -I $scriptdir";
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
29 $perlcommand = "perl";
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
30
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
31 $gNIR2gFVKM_script = "$scriptdir/gNIR2gFVKM.pl";
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
32 $iNIR2iFVKM_script = "$scriptdir/iNIR2iFVKM.pl";
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
33
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
34 $combine_gFVKM_iFVKM_script = "$scriptdir/combine_gFVKM_iFVKM_max.pl";
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
35
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
36 $normalize_gFVKM_script = "$scriptdir/normalize_gFVKM_5.pl";
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
37 $normalize_iFVKM_script = "$scriptdir/normalize_iFVKM_6.pl";
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
38 $NR_filter_script = "$scriptdir/filter_exclusive_NRgene_from_gene_table.pl";
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
39
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
40
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
41 #computing gFVKM and iFVKM, from EUMA/iEUMA and gMA/iMA files.
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
42 #`$perlcommand $gNIR2gFVKM_script $readcount_dir/$sample.$midrefix.gNIR $EUMA_out_dir/$sample.$midrefix.gEUMA > $FVKM_out_dir/$sample.$midrefix.gFVKM`;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
43 #`$perlcommand $iNIR2iFVKM_script $readcount_dir/$sample.$midrefix.iNIR $EUMA_out_dir/$sample.$midrefix.iEUMA > $FVKM_out_dir/$sample.$midrefix.iFVKM`;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
44
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
45 `$gNIR2gFVKM_script $readcount_dir/$sample.$midrefix.gNIR $EUMA_out_dir/$sample.$midrefix.gEUMA > $FVKM_out_dir/$sample.$midrefix.gFVKM`;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
46 `$iNIR2iFVKM_script $readcount_dir/$sample.$midrefix.iNIR $EUMA_out_dir/$sample.$midrefix.iEUMA > $FVKM_out_dir/$sample.$midrefix.iFVKM`;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
47
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
48 #updating gFVKM & iFVKM baed on each other
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
49 `$perlcommand $combine_gFVKM_iFVKM_script $FVKM_out_dir/$sample.$midrefix.gFVKM $FVKM_out_dir/$sample.$midrefix.iFVKM $gene2NM_file $EUMA_cut $FVKM_out_dir/$sample.$midrefix.$EUMA_cut.final.gFVKM $FVKM_out_dir/$sample.$midrefix.$EUMA_cut.final.iFVKM`;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
50
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
51 #normalize and compute LGPM/LTPM
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
52 #`$perlcommand $normalize_gFVKM_script $FVKM_out_dir/$sample.$midrefix.$EUMA_cut.final.gFVKM $mapping_stat_file $gene2symbol_file $mapping_stat_column $sample $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.gLVKM`;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
53 #`$perlcommand $normalize_iFVKM_script $FVKM_out_dir/$sample.$midrefix.$EUMA_cut.final.iFVKM $mapping_stat_file $gene2symbol_file $mapping_stat_column $sample $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.iLVKM`;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
54
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
55 `$normalize_gFVKM_script $FVKM_out_dir/$sample.$midrefix.$EUMA_cut.final.gFVKM $mapping_stat_file $gene2symbol_file $mapping_stat_column $sample $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.gLVKM`;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
56 `$normalize_iFVKM_script $FVKM_out_dir/$sample.$midrefix.$EUMA_cut.final.iFVKM $mapping_stat_file $gene2symbol_file $mapping_stat_column $sample $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.iLVKM`;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
57
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
58 #filter NR-only genes
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
59 if($datatype eq 'R'){
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
60 `$perlcommand $NR_filter_script $gene2NM_file $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.gLVKM > $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.-NR.gLVKM`;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
61 `$perlcommand $NR_filter_script $gene2NM_file $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.iLVKM > $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.-NR.iLVKM`;
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
62 }
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
63
c44c43d185ef NEUMA-1.2.1 Uploaded
chawhwa
parents:
diff changeset
64