e6d1189bea4cc541396f842b65a3392c33c8e734
max
  Wed Sep 2 02:55:03 2026 -0700
hprc2annot: put the collection in git and fix the QA findings

The HPRC Release 2 GenArk contributed track collection (7 tracks x 462
assemblies) had only its one-line betaGenArk.txt enable checked in. Add the
makeDoc, the build scripts, the seven track description pages and the trackDb
stanzas, and fix the problems QA found.

Data fixes, both rebuilt across all 462 assemblies:

- liftoff: gff3ToGenePred was naming each genePred after the gene, so every
transcript of a gene shared one name, the RefSeq accession was lost and the
transcript_biotype lookup never matched (type empty on 99.8% of rows). Pass
-rnaNameAttr=ID. Duplicate (chrom,start,end,name) tuples go from 24,969 to 0
and type is now empty on 2,132 of 82,973,730 rows. The same flag is a no-op
on the CAT GFF3 (byte-identical output), so both gene tracks now share one
code path and CAT needs no rebuild.

- segdups: the build read SEDEF column 6, strand1, which is "+" by construction
on every row, so every inverted duplication rendered forward. Use column 14,
strand2, the orientation of the paralogous copy: 13.8M + and 13.8M - across
the collection. Also translate the paralog partner out of PanSN through the
GenArk chromAlias, since the browser does not translate a plain text field,
and store identity as a percentage so the mouseover can read it.

hprc2annotFixBed.sh is not idempotent for pclai: a second run re-parses an
already-parsed name and blanks the values. It now refuses to touch a converted
file. GCA_041900255.1 was damaged that way and is rebuilt from source.

Provenance, all from the QA report:

- stats.tsv is appended to rather than truncated on every run, and each run
regenerates log/summary.tsv, a per-track roll-up over the collection.
- dataVersion on all seven tracks.
- Rows are now dropped for exactly two reasons and both are counted: past the
end of the sequence, or a sequence name absent from the assembly, which also
warns with example names. Only GCA_018472765.3 trips the second, the known
upstream contig-version mismatch. genePredToBigGenePred failure is checked
and an empty conversion result is a failure, not a valid empty bigBed.

Description pages: fix a raw UTF-8 character, rewrite the segdups and pclai
display conventions which still described the data before the name field was
blanked, add a color legend checked against the data, add the pcLAI preprint
(from the Crossref record, since it has no PMID), and correct the stated reason
liftoff drops transcripts.

Display: title case on the short labels, "Active centromeres" shortened to fit
the 17-character limit, pcLAI to pack since it has no readable dense state,
liftoff and segdups to dense, and a filter on the segdups original flag.

refs #35415

diff --git src/hg/makeDb/trackDb/contrib/hprc2annot/pclai.html src/hg/makeDb/trackDb/contrib/hprc2annot/pclai.html
new file mode 100644
index 00000000000..3d597d26f6a
--- /dev/null
+++ src/hg/makeDb/trackDb/contrib/hprc2annot/pclai.html
@@ -0,0 +1,85 @@
+<h2>Description</h2>
+<p>
+This track shows pangenome local ancestry inference (pcLAI) for this Human
+Pangenome Reference Consortium (HPRC) Release 2 assembly, in the assembly's own
+coordinates. Every person's genome is a mosaic inherited from ancestors of
+different populations, and "local ancestry" describes, region by region along a
+chromosome, where a stretch of DNA came from. Rather than picking one population
+label per region, pcLAI places each region on a continuous scale, so ancestry
+that sits between two reference populations is not forced into one of them. This
+track divides each haplotype into windows of about a hundred thousand bases and
+reports the ancestry inferred for each one, letting users see how ancestry varies
+along a single individual's genome.
+</p>
+
+<h2>Display Conventions</h2>
+<p>
+Each item is one genomic window. Items carry no visible label. Holding the mouse
+over an item shows the window identifier, the position of the window in the
+principal-component space that pcLAI uses to describe ancestry, the position of
+the longer ancestry segment the window belongs to, and a confidence score; the
+same values are on the details page. The item color is derived from the same
+principal-component position, so windows of similar inferred ancestry get similar
+colors and a run of shared ancestry appears as a block of consistent color.
+Because the color is continuous rather than a set of population labels, it is
+read by comparing regions with each other rather than against a fixed legend.
+</p>
+<p>
+The track is best viewed in pack mode. In dense mode the windows are collapsed
+onto one row, which hides the per-window values.
+</p>
+
+<h2>Methods</h2>
+<p>
+Conventional local ancestry inference gives every segment of a genome one of a
+fixed set of population labels. Point cloud local ancestry inference instead
+places each segment at a point in a continuous coordinate space, so a genome
+becomes a cloud of points, one per haplotype segment. The coordinate space can be
+any continuous description of ancestry; here it is the first two principal
+components of a reference panel of genomes with known population of origin.
+Ancestry that falls between the reference populations, which a label-based method
+has to round to the nearest label, therefore stays visible as an intermediate
+position. The files carry both the coordinate of each individual window and the
+coordinate of the longer ancestry segment that window belongs to. See the
+reference below for the method. This track uses the assembly-coordinate
+(<tt>asm_coord</tt>) output, that is, ancestry placed on each HPRC assembly's own
+sequence; companion outputs projected onto GRCh38 and CHM13 coordinates are
+distributed separately.
+</p>
+<p>
+The annotation files were obtained from the HPRC Release 2 data collection on the
+public <tt>s3://human-pangenomics</tt> bucket, indexed at
+<a href="https://github.com/human-pangenomics/hprc_intermediate_assembly/tree/main/data_tables/annotation/pclai" target="_blank">the hprc_intermediate_assembly data tables</a>.
+The per-assembly BED file was converted to a UCSC bigBed file, with the window
+identifier and the two sets of coordinates split out of the source item name into
+their own fields. The steps are described in the
+<a href="https://github.com/ucscGenomeBrowser/kent/blob/master/src/hg/makeDb/doc/contrib/hprc2annot.txt" target="_blank">makeDoc</a>,
+the build scripts are in the
+<a href="https://github.com/ucscGenomeBrowser/kent/tree/master/src/hg/makeDb/scripts/hprc2annot" target="_blank">kent source tree</a>,
+and the track configuration is in
+<a href="https://github.com/ucscGenomeBrowser/kent/tree/master/src/hg/makeDb/trackDb/contrib/hprc2annot" target="_blank">trackDb/contrib/hprc2annot</a>.
+Every window in the source files is carried through to the bigBed.
+</p>
+
+<h2>Data Access</h2>
+<p>
+For automated analysis, the annotation is stored in a bigBed-format file
+(<tt>pclai.bb</tt>) that can be read with the UCSC tool <tt>bigBedToBed</tt>.
+The original files are available from the HPRC S3 bucket linked above.
+</p>
+
+<h2>Credits</h2>
+<p>
+Annotations were generated by the Human Pangenome Reference Consortium. Thanks to
+the HPRC production team for making these data available.
+</p>
+
+<h2>References</h2>
+<p>
+Geleta M, Mas Montserrat D, Ioannidis NM, Ioannidis AG.
+<a href="https://doi.org/10.64898/2026.03.23.713813" target="_blank">
+Point cloud local ancestry inference (PCLAI): continuous coordinate-based ancestry along the
+genome</a>.
+<em>bioRxiv</em>. 2026 Mar 25.
+doi: <a href="https://doi.org/10.64898/2026.03.23.713813" target="_blank">10.64898/2026.03.23.713813</a>
+</p>