5 die "Usage: $0 <mergedfa> <inputfa>\n" if @ARGV != 2;
7 warn "From [$in] to [$out]\n";
12 if ($filename=~/.bz2$/) {
13 open( $infile,"-|","bzip2 -dc $filename") or die "Error opening $filename: $!\n";
14 } elsif ($filename=~/.gz$/) {
15 open( $infile,"-|","gzip -dc $filename") or die "Error opening $filename: $!\n";
16 } else {open( $infile,"<",$filename) or die "Error opening $filename: $!\n";}
20 my $fh=&openfile
($in);
27 #print STDERR " >$seqname ...";
34 my $n=($genome=~s/[^ATCG]/A/ig);
36 #print STDERR "\b\b\b \t",length $genome,".\n";
40 open OUT
,'>',$out or die "Error opening $out: $!\n";
41 print OUT
">merged $Ncnt\n$SEQ\n";
45 ./bwa aln -n 3 -o 0 -I ./ant
/ant_meg_free.fa ./ant
/ant_error_free_100_500_1.fa >./ant
/ant_meg_free.3.sai 2>./ant
/ant_meg_free
.3.sai
.log
46 ./bwa samse -n 5 -f ./ant
/ant_meg_free.3.sam ./ant
/ant_meg_free.fa ./ant
/ant_meg_free.3.sai ./ant
/ant_error_free_100_500_1.fa 2>./ant
/ant_meg_free
.3.sam
.log
50 XA
:Z
:merged
,+10484501,100M
,0;
51 XA
:Z
:merged
,-15123200,100M
,1;
53 find
. -name
'*meg*.fa'|perl
-lane
'/\/(\w+)\//;next if /ant/;system "./bwa index $_"'
54 find
. -name
'*_1.fa'|perl
-lane
'/\/(\w+)\//;$p=$1;$n=$_;s/_error_([^_]+)_.+/_err_$1/;$err=$1;$m=$_;print STDERR "${m}_?";print "./bwa aln -n $_ -o 0 -N -I ./$p/${p}_meg_$err.fa $n >$m.$_.sai 2>$m.$_.sai.log" for (3,6,10,2,5,1,20)' > sai
.cmd
56 find
. -name
'*_1.fa'|perl
-lane
'/\/(\w+)\//;$p=$1;$n=$_;s/_error_([^_]+)_.+/_err_$1/;$err=$1;$m=$_;print STDERR "${m}_?";print "./bwa samse -n 500 -f $m.$_.sam ./$p/${p}_meg_$err.fa $m.$_.sai $n 2>$m.$_.sam.log" for (3,6,10,2,5,1,20)' > sam
.cmd
58 SAMFILE
=$(echo
$SEED|awk
'{print $6}')
60 grep -P
'\tXT:A:R\t' $SAMFILE >$SAMFILE.r
62 ./bwa aln -n 6 -o 0 -I ./ant
/ant_meg_free.fa ./ant
/ant_error_free_100_500_1.fa >./ant
/ant_meg_free.6.sai 2>./ant
/ant_meg_free
.6.sai
.log
63 ./bwa aln -n 10 -o 0 -I ./ant
/ant_meg_free.fa ./ant
/ant_error_free_100_500_1.fa >./ant
/ant_meg_free.10.sai 2>./ant
/ant_meg_free
.10.sai
.log
65 ./bwa samse -n 500 -f ./ant
/ant_err_1%.3.sam ./ant
/ant_meg_1%.fa ./ant
/ant_err_1%.3.sai ./ant
/ant_error_1%_100_500_1.fa 2>./ant
/ant_err_1
%.3.sam
.log