6 die "Usage: $0 <bigger_bam> <sorted_bam> <out>\n" if @ARGV < 3;
7 my ($bam1,$bam2,$out)=@ARGV;
9 open IN1
,"-|","samtools view $bam1" or die "Error opening $bam1: $!\n";
10 open IN2
,"-|","samtools view $bam2" or die "Error opening $bam2: $!\n";
15 my ($id,$flag,$chr,$pos) = split /\t/;
16 #$Dat{$id} = [$chr,$pos];
21 my ($lastCP,@CurrArray)=('');
22 open OUT
,'>',$out or die "Error opening $out: $!\n";
25 my ($id,$flag,$chr,$pos) = split /\t/;
28 push @CurrArray,[$id,$_];
32 for my $t (@CurrArray) {
33 unless (exists $Dat{$t->[0]}) {
35 $t->[1] = '*'.$t->[1];
40 for my $t (@CurrArray) {
45 @CurrArray=([$id,$_]);
52 ./cmp.pl Tiger_aln_bam/pti
096_clean_aln_pe
.bam Tiger_aln_rmdup
/pti096_clean_aln_pe_rmdup
.bam pti096
.cmp.sam
&
54 # http://www.nature.com/nature/journal/v399/n6737/full/399682a0.html
55 # Cultures in chimpanzees