From: Heng Li Date: Thu, 21 May 2009 15:06:16 +0000 (+0000) Subject: Release samtools-0.1.4 X-Git-Url: https://git.donarmstrong.com/?p=samtools.git;a=commitdiff_plain;h=b0ed19dc2d8fb84998d41d6c3588611185707137 Release samtools-0.1.4 --- diff --git a/ChangeLog b/ChangeLog index cbe3178..fe2a947 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,81 @@ +------------------------------------------------------------------------ +r296 | lh3lh3 | 2009-05-21 12:53:14 +0100 (Thu, 21 May 2009) | 3 lines +Changed paths: + M /trunk/samtools/bam_maqcns.c + M /trunk/samtools/bamtk.c + + * samtools-0.1.3-24 (r296) + * another similar bug in the indel caller + +------------------------------------------------------------------------ +r295 | lh3lh3 | 2009-05-21 12:50:28 +0100 (Thu, 21 May 2009) | 3 lines +Changed paths: + M /trunk/samtools/bam_maqcns.c + M /trunk/samtools/bamtk.c + + * samtools-0.1.3-23 (r295) + * fixed a critical bug in the indel caller + +------------------------------------------------------------------------ +r294 | lh3lh3 | 2009-05-20 13:00:20 +0100 (Wed, 20 May 2009) | 2 lines +Changed paths: + M /trunk/samtools/bam_stat.c + +added a missing header file + +------------------------------------------------------------------------ +r293 | lh3lh3 | 2009-05-19 23:44:25 +0100 (Tue, 19 May 2009) | 3 lines +Changed paths: + M /trunk/samtools/bam_tview.c + M /trunk/samtools/bamtk.c + + * samtools-0.1.3-22 (r293) + * open tview in the dot-view mode by default + +------------------------------------------------------------------------ +r292 | lh3lh3 | 2009-05-18 21:01:23 +0100 (Mon, 18 May 2009) | 6 lines +Changed paths: + M /trunk/samtools/samtools.1 + +Added a note to the manual. Currently SAMtools used unaligned words in +several places. Although this does not cause bus errors to me, it may +affect portability. Please see the "Bus error" wiki page for more +information. Also thank James Bonfields for pointing this out. + + +------------------------------------------------------------------------ +r286 | lh3lh3 | 2009-05-14 15:23:13 +0100 (Thu, 14 May 2009) | 3 lines +Changed paths: + M /trunk/samtools/bam.h + M /trunk/samtools/bam_aux.c + M /trunk/samtools/bamtk.c + + * samtools-0.1.3-21 (286) + * declare bam_aux_get_core() in bam.h + +------------------------------------------------------------------------ +r276 | lh3lh3 | 2009-05-13 10:07:55 +0100 (Wed, 13 May 2009) | 5 lines +Changed paths: + M /trunk/samtools/bam.h + M /trunk/samtools/bam_index.c + M /trunk/samtools/bamtk.c + + * samtools-0.1.3-20 (r276) + * remove bam1_t::hash again. We need to modify the Perl API anyway to + make it work with the latest SVN. + * As is suggested by Tim, scan "{base}.bai" and "{base}.bam.bai" for index + +------------------------------------------------------------------------ +r275 | lh3lh3 | 2009-05-12 21:14:10 +0100 (Tue, 12 May 2009) | 4 lines +Changed paths: + M /trunk/samtools/ChangeLog + M /trunk/samtools/bam.h + M /trunk/samtools/bamtk.c + + * samtools-0.1.3-19 (r275) + * a minor change to the bam1_t struct: added back "void *hash" for the + backward compatibility with Bio::DB::Sam + ------------------------------------------------------------------------ r273 | lh3lh3 | 2009-05-12 14:28:39 +0100 (Tue, 12 May 2009) | 3 lines Changed paths: diff --git a/NEWS b/NEWS index e3468f1..f0af063 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,44 @@ +Beta Release 0.1.4 (21 May, 2009) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Notable changes: + + * Added the 'rmdupse' command: removing duplicates for SE reads. + + * Fixed a critical bug in the indel caller: clipped alignments are not + processed correctly. + + * Fixed a bug in the tview: gapped alignment may be incorrectly + displayed. + + * Unified the interface to BAM and SAM I/O. This is done by + implementing a wrapper on top of the old APIs and therefore old APIs + are still valid. The new I/O APIs also recognize the @SQ header + lines. + + * Generate the MD tag. + + * Generate "=" bases. However, the indel caller will not work when "=" + bases are present. + + * Enhanced support of color-read display (by Nils Homer). + + * Implemented the GNU building system. However, currently the building + system does not generate libbam.a. We will improve this later. For + the time being, `make -f Makefile.generic' is preferred. + + * Fixed a minor bug in pileup: the first read in a chromosome may be + skipped. + + * Fixed bugs in bam_aux.c. These bugs do not affect other components as + they were not used previously. + + * Output the 'SM' tag from maq2sam. + +(0.1.4: 21 May 2009, r297) + + + Beta Release 0.1.3 (15 April, 2009) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/bam_plcmd.c b/bam_plcmd.c index 7bc422f..1d5ea5a 100644 --- a/bam_plcmd.c +++ b/bam_plcmd.c @@ -151,7 +151,7 @@ static int pileup_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *p { pu_data_t *d = (pu_data_t*)data; bam_maqindel_ret_t *r = 0; - int i, j, rb, max_mapq = 0, *proposed_indels = 0; + int i, j, rb, rms_mapq = -1, max_mapq = 0, *proposed_indels = 0; uint32_t x; if (d->format & BAM_PLF_GLF) return glt3_func(tid, pos, n, pu, data); @@ -181,6 +181,7 @@ static int pileup_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *p if (ref_q > 255) ref_q = 255; } printf("%c\t%d\t%d\t%d\t", bam_nt16_rev_table[x>>28], x>>8&0xff, ref_q, x>>16&0xff); + rms_mapq = x>>16&0xff; } if ((d->format & (BAM_PLF_CNS|BAM_PLF_INDEL_ONLY)) && d->ref) { if (proposed_indels) @@ -235,7 +236,7 @@ static int pileup_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *p if (r->gt < 2) printf("%s/%s\t", r->s[r->gt], r->s[r->gt]); else printf("%s/%s\t", r->s[0], r->s[1]); printf("%d\t%d\t", r->q_cns, r->q_ref); - printf("%d\t%d\t", max_mapq, n); + printf("%d\t%d\t", rms_mapq >= 0? rms_mapq : max_mapq, n); printf("%s\t%s\t", r->s[0], r->s[1]); //printf("%d\t%d\t", r->gl[0], r->gl[1]); printf("%d\t%d\t%d\n", r->cnt1, r->cnt2, r->cnt_anti); diff --git a/bamtk.c b/bamtk.c index b38b0d4..5dfa82a 100644 --- a/bamtk.c +++ b/bamtk.c @@ -3,7 +3,7 @@ #include "bam.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.3-24 (r296)" +#define PACKAGE_VERSION "0.1.4 (r297)" #endif int bam_taf2baf(int argc, char *argv[]); diff --git a/misc/maq2sam.c b/misc/maq2sam.c index 6eaf2c6..758a698 100644 --- a/misc/maq2sam.c +++ b/misc/maq2sam.c @@ -5,7 +5,7 @@ #include #include -#define PACKAGE_VERSION "0.1.1 (20090120)" +#define PACKAGE_VERSION "0.1.2 (20090521)" //#define MAQ_LONGREADS @@ -94,7 +94,7 @@ void maq2tam_core(gzFile fp, const char *rg) m1 = &mm1; mm = maqmap_read_header(fp); while ((ret = gzread(fp, m1, sizeof(maqmap1_t))) == sizeof(maqmap1_t)) { - int j, flag = 0; + int j, flag = 0, se_mapq = m1->seq[MAX_READLEN-1]; if (m1->flag) flag |= 1; if ((m1->flag&PAIRFLAG_PAIRED) || ((m1->flag&PAIRFLAG_SW) && m1->flag != 192)) flag |= 2; if (m1->flag == 192) flag |= 4; @@ -130,6 +130,7 @@ void maq2tam_core(gzFile fp, const char *rg) if (c > 0) printf("%dM%dI%dM\t", m1->map_qual, c, m1->size - m1->map_qual - c); else printf("%dM%dD%dM\t", m1->map_qual, -c, m1->size - m1->map_qual); } + se_mapq = 0; // zero SE mapQ for reads aligned by SW } else { if (flag&4) printf("0\t*\t"); else printf("%d\t%dM\t", m1->map_qual, m1->size); @@ -144,11 +145,11 @@ void maq2tam_core(gzFile fp, const char *rg) putchar((m1->seq[j]&0x3f) + 33); putchar('\t'); if (rg) printf("RG:Z:%s\t", rg); - if (flag&4) { + if (flag&4) { // unmapped printf("MF:i:%d\n", m1->flag); } else { printf("MF:i:%d\t", m1->flag); - if (m1->flag) printf("AM:i:%d\t", m1->alt_qual); + if (m1->flag) printf("AM:i:%d\tSM:i:%d\t", m1->alt_qual, se_mapq); printf("NM:i:%d\tUQ:i:%d\tH0:i:%d\tH1:i:%d\n", m1->info1&0xf, m1->info2, m1->c[0], m1->c[1]); } } diff --git a/samtools.1 b/samtools.1 index 802e7a5..99ab3f6 100644 --- a/samtools.1 +++ b/samtools.1 @@ -1,10 +1,10 @@ -.TH samtools 1 "15 April 2009" "samtools-0.1.3" "Bioinformatics tools" +.TH samtools 1 "21 May 2009" "samtools-0.1.4" "Bioinformatics tools" .SH NAME .PP samtools - Utilities for the Sequence Alignment/Map (SAM) format .SH SYNOPSIS .PP -samtools import ref_list.txt aln.sam.gz aln.bam +samtools view -bt ref_list.txt -o aln.bam aln.sam.gz .PP samtools sort aln.bam aln.sorted .PP @@ -32,20 +32,9 @@ allows to retrieve reads in any regions swiftly. .B import samtools import -Convert alignments in SAM format to BAM format. File -.I -is TAB-delimited. Each line must contain the reference name and the -length of the reference, one line for each distinct reference; -additional fields are ignored. This file also defines the order of the -reference sequences in sorting. File -.I -can be optionally compressed by zlib or gzip. A single hyphen is -recognized as stdin or stdout, depending on the context. If you run -`samtools faidx ', the resultant index file -.I .fai -can be used as this -.I -file. +Since 0.1.4, this command is an alias of: + +samtools view -bt -o .TP .B sort @@ -96,7 +85,8 @@ will be created. .TP .B view -samtools view [-bhH] [region1 [...]] +samtools view [-bhHS] [-t in.refList] [-o output] [-f reqFlag] [-F +skipFlag] [-q minMapQ] [region1 [...]] Extract/print all or sub alignments in SAM or BAM format. If no region is specified, all the alignments will be printed; otherwise only @@ -116,6 +106,35 @@ Include the header in the output. .TP .B -H Output the header only. +.TP +.B -S +Input is in SAM. If @SQ header lines are absent, the +.B `-t' +option is required. +.TP +.B -t FILE +This file is TAB-delimited. Each line must contain the reference name +and the length of the reference, one line for each distinct reference; +additional fields are ignored. This file also defines the order of the +reference sequences in sorting. If you run `samtools faidx ', +the resultant index file +.I .fai +can be used as this +.I +file. +.TP +.B -o FILE +Output file [stdout] +.TP +.B -f INT +Only output alignments with all bits in INT present in the FLAG +field. INT can be in hex in the format of /^0x[0-9A-F]+/ [0] +.TP +.B -F INT +Skip alignments with bits present in INT [0] +.TP +.B -q INT +Skip alignments with MAPQ smaller than INT [0] .RE .TP @@ -150,7 +169,8 @@ on the reverse strand. A pattern `\\+[0-9]+[ACGTNacgtn]+' indicates there is an insertion between this reference position and the next reference position. The length of the insertion is given by the integer in the pattern, followed by the inserted sequence. Similarly, a pattern -`-[0-9]+[ACGTNacgtn]+' represents a deletion from the reference. Also at +`-[0-9]+[ACGTNacgtn]+' represents a deletion from the reference. The +deleted bases will be presented as `*' in the following lines. Also at the read base column, a symbol `^' marks the start of a read segment which is a contiguous subsequence on the read separated by `N/S/H' CIGAR operations. The ASCII of the character following `^' minus 33 gives the @@ -158,14 +178,14 @@ mapping quality. A symbol `$' marks the end of a read segment. If option .B -c -is applied, the consensus base, consensus quality, SNP quality and -maximum mapping quality of the reads covering the site will be inserted -between the `reference base' and the `read bases' columns. An indel -occupies an additional line. Each indel line consists of chromosome -name, coordinate, a star, top two high-scoring ins/del sequences, the -number of alignments containing the first indel allele, the number of -alignments containing the second indel allele, and the number of -alignments containing indels different from the top two alleles. +is applied, the consensus base, consensus quality, SNP quality and RMS +mapping quality of the reads covering the site will be inserted between +the `reference base' and the `read bases' columns. An indel occupies an +additional line. Each indel line consists of chromosome name, +coordinate, a star, the genotype, consensus quality, SNP quality, RMS +mapping quality, # covering reads, the first alllele, the second allele, +# reads supporting the first allele, # reads supporting the second +allele and # reads containing indels different from the top two alleles. .B OPTIONS: .RS @@ -219,7 +239,7 @@ is in use. .TP .B -g -Generate genotype likelihood in the binary GLFv2 format. This option +Generate genotype likelihood in the binary GLFv3 format. This option suppresses -c, -i and -s. .TP @@ -268,6 +288,32 @@ works with FR orientation and requires ISIZE is correctly set. .RE +.TP +.B rmdupse +samtools rmdupse + +Remove potential duplicates for single-ended reads. This command will +treat all reads as single-ended even if they are paired in fact. + +.RE + +.TP +.B fillmd +samtools fillmd [-e] + +Generate the MD tag. If the MD tag is already present, this command will +give a warning if the MD tag generated is different from the existing +tag. + +.B OPTIONS: +.RS +.TP 8 +.B -e +Convert a the read base to = if it is identical to the aligned reference +base. Indel caller does not support the = bases at the moment. + +.RE + .SH SAM FORFAM