No intermediate file for FDR and multi-group variance analysis (no homogeneity test)

Source: Internet
Author: User

No intermediate file calculation for FDR

#!perluse warnings;use Strict;die "perl $ <pvalue file> <outprefix>\n" if @ARGV! = 2;my (%va,%out); open FA, $ARGV [0] or Die $!; while (<FA>) {<span style= "white-space:pre" ></span>chomp;<span style= "White-space:pre" > </span>my @tmp = Split;<span style= "White-space:pre" ></span> $va {$tmp [0]} = $tmp [7];<span style=] White-space:pre "></span> $out {$tmp [0]} = $_;} My @arr, my $n = 0;foreach my $i (sort {$va {$a} <=> $va {$b}} keys%va) {<span style= "White-space:pre" &GT;&LT;/SPAN&G t; $arr [$n]{$i} = $va {$i};<span style= "White-space:pre" ></span> $n + +;} Open out, "> $ARGV [1].FDR] or Die $!; for (my $i = 0; $i < @arr; $i + +) {<span style= "white-space:pre" ></span>foreach my $j (keys%{$arr [$i]}) <sp An style= "White-space:pre" ></span>{<span style= "White-space:pre" ></span>my $fdr = ($arr [$i]{$j } * ($n + 1))/($i + 1); <span style= "White-space:pre" ></span>print out "$out {$j}\t$fdr\n "; <span style=" White-space:pre "&GT;&LT;/SPAN&GT;}} 
Perl's sort is still not ripe ...

Multi-group Variance analysis (no homogeneity test)

Args<-commandargs (T) Mat <-read.table (args[1], sep= "\ T") column <-C (Rep (0, Nrow (MAT))) for (I in 1:nrow (MAT)) { DAT <-as.numeric (mat[i, 2:ncol (MAT)]) groups <-factor (Rep (letters[1:3], each = 2)) Fit <-lm (formula = Dat ~ Grou PS) Column[i] <-Anova (FIT) [1,5]}f = Cbind (Mat, column) write.table (f, file=args[2], Sep = "\ t", quote=false,row.names= FALSE, Col.names=f)


No intermediate file for FDR and multi-group variance analysis (no homogeneity test)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.