+Beta release 0.1.12a (2 December, 2010)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This is another bug fix release:
+
+ * Fixed a memory violation in mpileup, which causes segfault. Release
+ 0.1.9 and above are affected.
+
+ * Fixed a memory violation in the indel caller, which does not causes
+ segfault, but may potentially affect deletion calls in an unexpected
+ way. Release 0.1.10 and above are affected.
+
+ * Fixed a bug in computing r-square in bcftools. Few are using this
+ functionality and it only has minor effect.
+
+ * Fixed a memory leak in bam_fetch().
+
+ * Fixed a bug in writing meta information to the BAM index for the last
+ sequence. This bug is invisible to most users, but it is a bug anyway.
+
+ * Fixed a bug in bcftools which causes false "DP4=0,0,0,0" annotations.
+
+(0.1.12: 2 December 2010, r862)
+
+
+
Beta release 0.1.11 (21 November, 2010)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const void *rghash)
{
extern void ks_introsort_uint32_t(int, uint32_t*);
- int i, s, j, k, t, n_types, *types, max_rd_len, left, right, max_ins, *score1, *score2;
+ int i, s, j, k, t, n_types, *types, max_rd_len, left, right, max_ins, *score1, *score2, max_ref2;
int N, K, l_run, ref_type, n_alt;
char *inscns = 0, *ref2, *query;
khash_t(rg) *hash = (khash_t(rg)*)rghash;
free(inscns_aux);
}
// compute the likelihood given each type of indel for each read
- ref2 = calloc(right - left + max_ins + 2, 1);
+ max_ref2 = right - left + 2 + 2 * (max_ins > -types[0]? max_ins : -types[0]);
+ ref2 = calloc(max_ref2, 1);
query = calloc(right - left + max_rd_len + max_ins + 2, 1);
score1 = calloc(N * n_types, sizeof(int));
score2 = calloc(N * n_types, sizeof(int));
}
for (; j < right && ref[j]; ++j)
ref2[k++] = bam_nt16_nt4_table[bam_nt16_table[(int)ref[j]]];
+ for (; k < max_ref2; ++k) ref2[k] = 4;
if (j < right) right = j;
// align each read to ref2
for (s = K = 0; s < n; ++s) {
}
if (save_tid >= 0) {
insert_offset(idx->index[save_tid], save_bin, save_off, bam_tell(fp));
- insert_offset(idx->index[save_tid], BAM_MAX_BIN, off_beg, off_end);
+ insert_offset(idx->index[save_tid], BAM_MAX_BIN, off_beg, bam_tell(fp));
insert_offset(idx->index[save_tid], BAM_MAX_BIN, n_mapped, n_unmapped);
}
merge_chunks(idx);
b = bam_init1();
iter = bam_iter_query(idx, tid, beg, end);
while ((ret = bam_iter_read(fp, iter, b)) >= 0) func(b, data);
+ bam_iter_destroy(iter);
bam_destroy1(b);
return (ret == -1)? 0 : ret;
}
mplp_aux_t *ma = (mplp_aux_t*)data;
int ret, skip = 0;
do {
- int has_ref = (ma->ref && ma->ref_id == b->core.tid)? 1 : 0;
+ int has_ref;
ret = ma->iter? bam_iter_read(ma->fp, ma->iter, b) : bam_read1(ma->fp, b);
if (ret < 0) break;
+ has_ref = (ma->ref && ma->ref_id == b->core.tid)? 1 : 0;
skip = 0;
if (has_ref && (ma->flag&MPLP_REALN)) bam_prob_realn_core(b, ma->ref, 1);
if (has_ref && ma->capQ_thres > 10) {
#endif
#ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.1.11 (r851)"
+#define PACKAGE_VERSION "0.1.12a (r862)"
#endif
int bam_taf2baf(int argc, char *argv[]);
}
bgzf_read(bp->fp, b->str, b->l_str);
l = 12 + b->l_str;
- bcf_sync(b);
+ if (bcf_sync(b) < 0) return -2;
for (i = 0; i < b->n_gi; ++i) {
bgzf_read(bp->fp, b->gi[i].data, b->gi[i].len * h->n_smpl);
l += b->gi[i].len * h->n_smpl;
if ((p = strstr(b->info, "I16=")) == 0) return -1;
p += 4;
for (i = 0; i < 16; ++i) {
- anno[i] = strtol(p, &p, 10);
+ errno = 0; anno[i] = strtol(p, &p, 10);
if (anno[i] == 0 && (errno == EINVAL || errno == ERANGE)) return -2;
++p;
}
memcpy(flast, f, 4 * sizeof(double));
freq_iter(n_smpl, pdg, f);
for (i = 0; i < 4; ++i) {
- double x = fabs(f[0] - flast[0]);
+ double x = fabs(f[i] - flast[i]);
if (x > eps) eps = x;
}
if (eps < LD_ITER_EPS) break;
my $command = shift(@ARGV);
my %func = (subsam=>\&subsam, listsam=>\&listsam, fillac=>\&fillac, qstats=>\&qstats, varFilter=>\&varFilter,
hapmap2vcf=>\&hapmap2vcf, ucscsnp2vcf=>\&ucscsnp2vcf, filter4vcf=>\&varFilter, ldstats=>\&ldstats,
- gapstats=>\&gapstats);
+ gapstats=>\&gapstats, splitchr=>\&splitchr);
die("Unknown command \"$command\".\n") if (!defined($func{$command}));
&{$func{$command}};
}
+sub splitchr {
+ my %opts = (l=>5000000);
+ getopts('l:', \%opts);
+ my $l = $opts{l};
+ die(qq/Usage: vcfutils.pl splitchr [-l $opts{l}] <in.fa.fai>\n/) if (@ARGV == 0 && -t STDIN);
+ while (<>) {
+ my @t = split;
+ my $last = 0;
+ for (my $i = 0; $i < $t[1];) {
+ my $e = ($t[1] - $i) / $l < 1.1? $t[1] : $i + $l;
+ print "$t[0]:".($i+1)."-$e\n";
+ $i = $e;
+ }
+ }
+}
+
sub subsam {
die(qq/Usage: vcfutils.pl subsam <in.vcf> [samples]\n/) if (@ARGV == 0);
my ($fh, %h);
-.TH samtools 1 "21 November 2010" "samtools-0.1.11" "Bioinformatics tools"
+.TH samtools 1 "2 December 2010" "samtools-0.1.12" "Bioinformatics tools"
.SH NAME
.PP
samtools - Utilities for the Sequence Alignment/Map (SAM) format
-samtools-0.1.11 21 November 2010 samtools(1)
+samtools-0.1.12 2 December 2010 samtools(1)