comparison NEUMA-1.2.1/NIR2LVKM_SE.pl @ 0:c44c43d185ef draft default tip

NEUMA-1.2.1 Uploaded
author chawhwa
date Thu, 08 Aug 2013 00:46:13 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c44c43d185ef
1 #!/usr/bin/perl
2
3 if(@ARGV<13) { print "usage: $0 sample_name readcount_dir midrefix(samplename.midrefix.i.all.gMA) EUMAprefix(before .gEUMA or .iEUMA) gFVKM_out_dir LGPM_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; }
4
5 my $sample = shift @ARGV;
6 my $readcount_dir = shift @ARGV;
7 my $midrefix = shift @ARGV;
8 my $EUMAprefix = shift @ARGV;
9 my $FVKM_out_dir = shift @ARGV;
10 my $LVKM_out_dir = shift @ARGV;
11 my $EUMA_cut = shift @ARGV;
12 my $mapping_stat_column = shift @ARGV;
13 my $mapping_stat_file = shift @ARGV;
14 my $i_after_midrefix = shift @ARGV;
15 my $final_adjustment_option = shift @ARGV;
16 my $gene2NM_file = shift @ARGV;
17 my $gene2symbol_file = shift @ARGV;
18 my $datatype = shift @ARGV;
19 my $scriptdir = shift @ARGV;
20
21 if(!-d $FVKM_out_dir) { `mkdir -p $FVKM_out_dir`; }
22 if(!-d $LVKM_out_dir) { `mkdir -p $LVKM_out_dir`;}
23
24 #$perlcommand= "perl -I $scriptdir";
25 $perlcommand= "perl";
26
27 $gNIR2gFVKM_script = "$scriptdir/gNIR2gFVKM.pl";
28 $iNIR2iFVKM_script = "$scriptdir/iNIR2iFVKM.pl";
29 $combine_gFVKM_iFVKM_script = "$scriptdir/combine_gFVKM_iFVKM_max.pl";
30 $normalize_gFVKM_script = "$scriptdir/normalize_gFVKM_5.pl";
31 $normalize_iFVKM_script = "$scriptdir/normalize_iFVKM_6.pl";
32 $NR_filter_script = "$scriptdir/filter_exclusive_NRgene_from_gene_table.pl";
33
34
35 #computing gFVKM and iFVKM, from EUMA/iEUMA and gMA/iMA files.
36 if($i_after_midrefix eq '1'){ $MA_midrefix = "$midrefix.i";}
37 else { $MA_midrefix = $midrefix; }
38 #`$perlcommand $gNIR2gFVKM_script $readcount_dir/$sample.$midrefix.gNIR $EUMAprefix.gEUMA > $FVKM_out_dir/$sample.$midrefix.gFVKM`;
39 #`$perlcommand $iNIR2iFVKM_script $readcount_dir/$sample.$midrefix.iNIR $EUMAprefix.iEUMA > $FVKM_out_dir/$sample.$midrefix.iFVKM`;
40
41 `$gNIR2gFVKM_script $readcount_dir/$sample.$midrefix.gNIR $EUMAprefix.gEUMA > $FVKM_out_dir/$sample.$midrefix.gFVKM`;
42 `$iNIR2iFVKM_script $readcount_dir/$sample.$midrefix.iNIR $EUMAprefix.iEUMA > $FVKM_out_dir/$sample.$midrefix.iFVKM`;
43
44 #updating gFVKM & iFVKM baed on each other
45 `$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`;
46
47 #normalize and compute LGPM/LTPM
48 #`$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`;
49 #`$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`;
50
51 `$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`;
52 `$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`;
53
54 #filter NR-only genes
55 if($datatype eq 'R'){
56 `$perlcommand $NR_filter_script $gene2NM_file $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.gLVKM > $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.-NR.gLVKM`;
57 `$perlcommand $NR_filter_script $gene2NM_file $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.iLVKM > $LVKM_out_dir/$sample.$midrefix.$EUMA_cut.-NR.iLVKM`;
58 }
59
60