fine tune the wrapper scripts

This commit is contained in:
Heng Li 2014-11-18 15:40:58 -05:00
parent 80e4ecfa79
commit 61ab329639
4 changed files with 17 additions and 15 deletions

View File

@ -9,9 +9,9 @@ mapping, we start to provide a wrapper script and precompiled binaries since
this release. Please check README-alt.md for details. this release. Please check README-alt.md for details.
Another major addition to BWA-MEM is HLA typing, which made possible with the Another major addition to BWA-MEM is HLA typing, which made possible with the
new ALT mapping strategy. Necessary data and programs are also included in new ALT mapping strategy. Necessary data and programs are included in the
the binary release. The wrapper script also performs HLA typing when HLA genes binary release. The wrapper script also performs HLA typing when HLA genes are
are also included in the reference genome as additional ALT contigs. also included in the reference genome as additional ALT contigs.
Other notable changes to BWA-MEM: Other notable changes to BWA-MEM:

7
bwa.1
View File

@ -1,4 +1,4 @@
.TH bwa 1 "19 May 2014" "bwa-0.7.9-r783" "Bioinformatics tools" .TH bwa 1 "18 November 2014" "bwa-0.7.11-r999" "Bioinformatics tools"
.SH NAME .SH NAME
.PP .PP
bwa - Burrows-Wheeler Alignment Tool bwa - Burrows-Wheeler Alignment Tool
@ -233,8 +233,9 @@ more aggressive read pair. [17]
.B INPUT/OUTPUT OPTIONS: .B INPUT/OUTPUT OPTIONS:
.TP .TP
.B -p .B -p
Assume the first input query file is interleaved paired-end FASTA/Q. See the Smart pairing. If two adjacent reads have the same name, they are considered
command description for details. to form a read pair. This way, paired-end and single-end reads can be mixed
in a single FASTA/Q stream.
.TP .TP
.BI -R \ STR .BI -R \ STR
Complete read group header line. '\\t' can be used in Complete read group header line. '\\t' can be used in

View File

@ -4,8 +4,8 @@ use strict;
use warnings; use warnings;
use Getopt::Std; use Getopt::Std;
my %opts = (t=>1, n=>64); my %opts = (t=>1);
getopts("Sadsko:R:x:t:", \%opts); getopts("SadskHo:R:x:t:", \%opts);
die(' die('
Usage: run-bwamem [options] <idxbase> <file1> [file2] Usage: run-bwamem [options] <idxbase> <file1> [file2]
@ -22,6 +22,7 @@ Options: -o STR prefix for output files [inferred from
-d mark duplicate (via samblaster) -d mark duplicate (via samblaster)
-S for SAM/BAM input, don\'t shuffle -S for SAM/BAM input, don\'t shuffle
-s sort the output alignment (requring more RAM) -s sort the output alignment (requring more RAM)
-H skip HLA typing
-k keep temporary files generated by typeHLA -k keep temporary files generated by typeHLA
Examples: Examples:
@ -31,15 +32,15 @@ Examples:
run-bwamem -o prefix -t8 -R"@RG\tID:foo\tSM:bar" hs38d6.fa read1.fq.gz read2.fq.gz run-bwamem -o prefix -t8 -R"@RG\tID:foo\tSM:bar" hs38d6.fa read1.fq.gz read2.fq.gz
* Remap coordinate-sorted BAM, trim Illumina PE adapters and sort the output. The BAM * Remap coordinate-sorted BAM, trim Illumina PE adapters and sort the output. The BAM
may contain single-end or paired-end reads, or a mixture of the two types. The read may contain single-end or paired-end reads, or a mixture of the two types. Read groups
groups are not transferred to the output BAM. are not transferred to the output BAM, though.
run-bwamem -sao prefix hs38d6.fa old-srt.bam run-bwamem -sao prefix hs38d6.fa old-srt.bam
* Remap name-grouped BAM and mark duplicates. Note that in this case, all reads from * Remap name-grouped BAM and mark duplicates. Note that in this case, all reads from
a single library should be aligned at the same time. Paired-end only. a single library should be aligned at the same time. Paired-end only.
run-bwamem -Sdo prefix hs38d6.fa old-unsrt.bam run-bwamem -Sdo prefix hs38d6.fa old-unsrt.bam
Output files: Output files:
@ -119,7 +120,7 @@ if ($is_sam || $is_bam) {
my $bwa_opts = "-p " . ($opts{t} > 1? "-t$opts{t} " : "") . (defined($opts{x})? "-x $opts{x} " : "") . (defined($opts{R})? "-R'$opts{R}' " : ""); my $bwa_opts = "-p " . ($opts{t} > 1? "-t$opts{t} " : "") . (defined($opts{x})? "-x $opts{x} " : "") . (defined($opts{R})? "-R'$opts{R}' " : "");
$cmd .= " | $root/trimadap \\\n" if defined($opts{a}); $cmd .= " | $root/trimadap 2> $prefix.log.trim \\\n" if defined($opts{a});
$cmd .= " | $root/bwa mem $bwa_opts$ARGV[0] - 2> $prefix.log.bwamem \\\n"; $cmd .= " | $root/bwa mem $bwa_opts$ARGV[0] - 2> $prefix.log.bwamem \\\n";
$cmd .= " | $root/samblaster 2> $prefix.log.dedup \\\n" if defined($opts{d}); $cmd .= " | $root/samblaster 2> $prefix.log.dedup \\\n" if defined($opts{d});
@ -138,8 +139,8 @@ if (-f "$ARGV[0].alt") {
my $t_sort = $opts{t} < 4? $opts{t} : 4; my $t_sort = $opts{t} < 4? $opts{t} : 4;
$cmd .= defined($opts{s})? " | $root/samtools sort -@ $t_sort -m1G - $prefix.aln;\n" : " | $root/samtools view -1 - > $prefix.aln.bam;\n"; $cmd .= defined($opts{s})? " | $root/samtools sort -@ $t_sort -m1G - $prefix.aln;\n" : " | $root/samtools view -1 - > $prefix.aln.bam;\n";
if ($has_hla && (!defined($opts{x}) || $opts{x} eq 'intractg')) { if ($has_hla && !defined($opts{H}) && (!defined($opts{x}) || $opts{x} eq 'intractg')) {
$cmd .= "$root/run-HLA ". ($opts{x} eq 'intractg'? "-A " : "") . "$prefix.hla > $prefix.hla.top 2> $prefix.log.hla;\n"; $cmd .= "$root/run-HLA ". (defined($opts{x}) && $opts{x} eq 'intractg'? "-A " : "") . "$prefix.hla > $prefix.hla.top 2> $prefix.log.hla;\n";
$cmd .= "cat $prefix.hla.HLA*.gt | grep ^GT | cut -f2- > $prefix.hla.all;\n"; $cmd .= "cat $prefix.hla.HLA*.gt | grep ^GT | cut -f2- > $prefix.hla.all;\n";
$cmd .= "rm -f $prefix.hla.HLA*;\n" unless defined($opts{k}); $cmd .= "rm -f $prefix.hla.HLA*;\n" unless defined($opts{k});
} }

View File

@ -20,7 +20,7 @@ if [ $is_ctg -eq 0 ]; then
echo "** De novo assembling..." >&2 echo "** De novo assembling..." >&2
len=`$root/seqtk comp $pre.fq | awk '{++x;y+=$2}END{printf("%.0f\n", y/x)}'` len=`$root/seqtk comp $pre.fq | awk '{++x;y+=$2}END{printf("%.0f\n", y/x)}'`
$root/fermi2.pl unitig -f $root/fermi2 -r $root/ropebwt2 -t2 -l$len -p $pre.tmp $pre.fq > $pre.tmp.mak $root/fermi2.pl unitig -f $root/fermi2 -r $root/ropebwt2 -t2 -l$len -p $pre.tmp $pre.fq > $pre.tmp.mak
make -f $pre.tmp.mak make -f $pre.tmp.mak >&2
cp $pre.tmp.mag.gz $pre.mag.gz cp $pre.tmp.mag.gz $pre.mag.gz
else else
rm -f $pre.tmp.mag.gz rm -f $pre.tmp.mag.gz