bc9f54cc38a4f72f3a53c3e7bedccec41a1870be
max
Mon Apr 29 06:26:58 2024 -0700
adding space and skipping long cigar strings on hgc page, refs #33292
diff --git src/hg/hgc/bamClick.c src/hg/hgc/bamClick.c
index 8c058e4..e582f1c 100644
--- src/hg/hgc/bamClick.c
+++ src/hg/hgc/bamClick.c
@@ -29,33 +29,38 @@
* CIGAR that is anchored to positive strand while showing rc'd sequence. I think
* to do it right, we would need to reverse the CIGAR string for display. */
static boolean useStrand = FALSE;
static boolean skipQualityScore = FALSE;
static void singleBamDetails(const bam1_t *bam)
/* Print out the properties of this alignment. */
{
const bam1_core_t *core = &bam->core;
char *itemName = bam1_qname(bam);
int tLength = bamGetTargetLength(bam);
int tStart = core->pos, tEnd = tStart+tLength;
boolean isRc = useStrand && bamIsRc(bam);
printPosOnChrom(seqName, tStart, tEnd, NULL, FALSE, itemName);
if (!skipQualityScore)
printf("Alignment Quality: %d
\n", core->qual);
+if (core->n_cigar > 50)
+ printf("CIGAR string: Cannot show long CIGAR string, more than 50 operations. Contact us if you need to see the full CIGAR string here.
\n");
+else
+ {
printf("CIGAR string: %s (", bamGetCigar(bam));
bamShowCigarEnglish(bam);
printf(")
\n");
+ }
printf("Tags:");
bamShowTags(bam);
puts("
");
printf("Flags: 0x%02x:
\n ", core->flag);
bamShowFlagsEnglish(bam);
puts("
");
if (bamIsRc(bam))
printf("Note: although the read was mapped to the reverse strand of the genome, "
"the sequence and CIGAR in BAM are relative to the forward strand.
\n");
puts("
");
struct dnaSeq *genoSeq = hChromSeq(database, seqName, tStart, tEnd);
char *qSeq = bamGetQuerySequence(bam, FALSE);
if (isNotEmpty(qSeq) && !sameString(qSeq, "*"))
{
char *qSeq = NULL;