comparison MDSplot/MDSbasedOnIBSmatrix.pl @ 8:6bf69b40365c draft

Uploaded
author dereeper
date Wed, 07 Feb 2018 21:37:59 -0500
parents 3e19d0dfcf3e
children 31c23d943c29
comparison
equal deleted inserted replaced
7:24336e3d3dd8 8:6bf69b40365c
1 #!/usr/bin/perl 1 #!/usr/bin/perl
2 2
3 use strict; 3 use strict;
4 use Switch;
5 use Getopt::Long; 4 use Getopt::Long;
6 use Bio::SeqIO; 5 use Bio::SeqIO;
7 6
8 my $PLINK_EXE= "plink"; 7 my $PLINK_EXE= "plink";
9 8
61 my @i = split(/\s+/,$line); 60 my @i = split(/\s+/,$line);
62 if ($line =~/^ /) 61 if ($line =~/^ /)
63 { 62 {
64 my $ind = $i[1]; 63 my $ind = $i[1];
65 my $pop = "Pop1"; 64 my $pop = "Pop1";
65 #if ($ind=~/^d/){$pop="Pop2";}
66 if ($populations{$ind}) 66 if ($populations{$ind})
67 { 67 {
68 $pop = $populations{$ind}; 68 $pop = $populations{$ind};
69 } 69 }
70 print $OUT "$pop $ind ".$i[4]." ".$i[5]."\n"; 70 print $OUT "$pop $ind ".$i[4]." ".$i[5]."\n";
71 } 71 }
72 if ($line =~/^\w/) 72 if ($line =~/^\w/)
73 { 73 {
74 my $ind = $i[0]; 74 my $ind = $i[0];
75 my $pop = "Pop1"; 75 my $pop = "Pop1";
76 #if ($ind=~/^d/){$pop="Pop2";}
76 if ($populations{$ind}) 77 if ($populations{$ind})
77 { 78 {
78 $pop = $populations{$ind}; 79 $pop = $populations{$ind};
79 } 80 }
80 print $OUT "$pop $ind ".$i[3]." ".$i[4]."\n"; 81 print $OUT "$pop $ind ".$i[3]." ".$i[4]."\n";