Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 49 lines (39 sloc) 1.005 kb
6a26c0b establishing github repository for MSCC tag matching and read counting c...
Madeleine Ball authored
1 #!/usr/bin/perl
2
3 # usage:
4 # ./CountMatches.pl subset_variants_matched_sorted > subset_matches
5
6 use warnings;
7 use strict;
8
9 my $matchfile = $ARGV[0];
10
11 open(MATCH,$matchfile);
12
13 my $tagseq = "";
14 my $unique = 0;
15 my $mm1 = 0;
16 my $mm2 = 0;
17 my @lastmatchdata = ();
18 while (<MATCH>) {
19 my @matchdata = split;
20 if (@lastmatchdata and ($lastmatchdata[8] eq $matchdata[8]) and ($lastmatchdata[9] eq $matchdata[9]) and ($lastmatchdata[10] eq $matchdata[10])) {
21 if ($matchdata[16] == 0) {
22 $unique++;
23 } elsif ($matchdata[16] == 1) {
24 $mm1++;
25 } elsif ($matchdata[16] == 2) {
26 $mm2++;
27 }
28 } else {
29 if (@lastmatchdata) {
30 my @printdata = @lastmatchdata[8..14];
31 print "$tagseq @printdata $unique $mm1 $mm2\n";
32 }
33 $tagseq = $matchdata[0];
34 if ($matchdata[16] == 0) {
35 $unique = 1;
36 $mm1 = $mm2 = 0;
37 } else {
38 die;
39 }
40 }
41 @lastmatchdata = @matchdata;
42 }
43 my @printdata = @lastmatchdata[8..14];
44 print "$tagseq @printdata $unique $mm1 $mm2\n";
45
46
47
48
Something went wrong with that request. Please try again.