From efa4a1055d7691e3cd1368dcafa210c2691a5fd2 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Thu, 8 Jul 2010 18:43:52 +0000 Subject: [PATCH] * samtools-0.1.7-r607 * improved the genotype accuracy for indels * use the SOAPsnp model for SNP calling by default. --- bam_maqcns.c | 5 +++-- bam_plcmd.c | 5 +++-- bamtk.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bam_maqcns.c b/bam_maqcns.c index 51f56a9..9a25380 100644 --- a/bam_maqcns.c +++ b/bam_maqcns.c @@ -446,6 +446,7 @@ bam_maqindel_ret_t *bam_maqindel(int n, int pos, const bam_maqindel_opt_t *mi, c for (i = 0; i < n_types; ++i) { ka_param_t ap = ka_param_blast; ap.band_width = 2 * types[n_types - 1] + 2; + ap.gap_end = 0; // write ref2 for (k = 0, j = left; j <= pos; ++j) ref2[k++] = bam_nt16_nt4_table[bam_nt16_table[(int)ref[j]]]; @@ -490,10 +491,10 @@ bam_maqindel_ret_t *bam_maqindel(int n, int pos, const bam_maqindel_opt_t *mi, c if (ref2[x+k] != rs[y+k] && ref2[x+k] < 4) ps += bam1_qual(p->b)[y+k]; x += len; y += len; } else if (op == BAM_CINS || op == BAM_CSOFT_CLIP) { - if (op == BAM_CINS) ps += mi->q_indel * len; + if (op == BAM_CINS && l > 0 && l < n_acigar - 1) ps += mi->q_indel * len; y += len; } else if (op == BAM_CDEL) { - ps += mi->q_indel * len; + if (l > 0 && l < n_acigar - 1) ps += mi->q_indel * len; x += len; } } diff --git a/bam_plcmd.c b/bam_plcmd.c index d1ea03f..84838dd 100644 --- a/bam_plcmd.c +++ b/bam_plcmd.c @@ -341,10 +341,11 @@ int bam_pileup(int argc, char *argv[]) d->max_depth = 0; d->tid = -1; d->mask = BAM_DEF_MASK; d->c = bam_maqcns_init(); + d->c->is_soap = 1; // change the default model d->ido = bam_maqindel_opt_init(); while ((c = getopt(argc, argv, "st:f:cT:N:r:l:d:im:gI:G:vM:S2aR:P")) >= 0) { switch (c) { - case 'a': d->c->is_soap = 1; break; + case 'a': d->c->is_soap = 0; break; case 's': d->format |= BAM_PLF_SIMPLE; break; case 't': fn_list = strdup(optarg); break; case 'l': fn_pos = strdup(optarg); break; @@ -379,7 +380,7 @@ int bam_pileup(int argc, char *argv[]) fprintf(stderr, "Usage: samtools pileup [options] |\n\n"); fprintf(stderr, "Option: -s simple (yet incomplete) pileup format\n"); fprintf(stderr, " -S the input is in SAM\n"); - fprintf(stderr, " -a use the SOAPsnp model for SNP calling\n"); + fprintf(stderr, " -a use the MAQ model for SNP calling\n"); fprintf(stderr, " -2 output the 2nd best call and quality\n"); fprintf(stderr, " -i only show lines/consensus with indels\n"); fprintf(stderr, " -m INT filtering reads with bits in INT [%d]\n", d->mask); diff --git a/bamtk.c b/bamtk.c index be126fa..be1f6b2 100644 --- a/bamtk.c +++ b/bamtk.c @@ -9,7 +9,7 @@ #endif #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.7-18 (r605)" +#define PACKAGE_VERSION "0.1.7-19 (r607)" #endif int bam_taf2baf(int argc, char *argv[]); -- 2.39.2