691a2b8981d6db69e8707ea44041c4661cdac97e max Wed Sep 9 06:38:29 2026 -0700 Imprinting: add the ASM Atlas tracks, and tidy the collection's labels Adds a composite built from Rosenski et al. 2025, "Atlas of imprinted and allele-specific DNA methylation in the human body". Three subtracks: the 458 regions whose methylation follows the parent of origin, the 72 known control regions with the boundaries the paper redrew, and the pool of 385,235 regions carrying two methylation states that those came out of. A fourth set, the regions whose methylation follows a nearby SNP, is built by the scripts but its stanza is commented out, since sequence driven methylation is not imprinting. The authors released hg19 only, so all three are lifted. Their published files are close to bare BED, so the SNPs, cell types, p-values, gene links and gamete methylation on the details pages are read out of the paper's supplementary tables and joined on by position. Regions that lift but change length by more than 10%, because hg38 added sequence inside them, are kept with a note rather than dropped: one of them is TCEB3C, the only control region on chr18. Also across the collection: - long labels name their source right after "Imprinting", so that a label read on its own says where the data came from - the two gene catalogs are worded alike, and ordered OMIM, Geneimprint, MethBase2, Akbari, ASM Atlas - the OMIM curators confirmed that their (I) marker covers established and candidate imprinted genes alike, with nothing in the export to tell them apart. Labels, description page and makeDoc now say so, and the claim that the set is "more conservative" than the computational tracks is gone. The bigBed was rebuilt for the autoSql line, same 459 features. - every subtrack page opens by naming the collection, linked back to its hgTrackUi page, and no longer repeats the collection page's introduction to imprinting refs #37599 diff --git src/hg/makeDb/scripts/imprinting/kaplanImprintLift.sh src/hg/makeDb/scripts/imprinting/kaplanImprintLift.sh new file mode 100755 index 00000000000..63af6f4893f --- /dev/null +++ src/hg/makeDb/scripts/imprinting/kaplanImprintLift.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# Lift the four Rosenski et al. 2025 imprinting BED files from hg19 to hg38 and +# build the bigBeds. The authors only published hg19 coordinates. +# +# Usage: kaplanImprintLift.sh <bedDir> <outDir> +# bedDir holds the hg19 BED files written by kaplanImprintToBed.py +# outDir where the hg38 BED files, the unmapped lists and the bigBeds go + +set -beEu -o pipefail + +bedDir=$1 +outDir=$2 +scriptDir=$(dirname $(readlink -f $0)) +chain=/gbdb/hg19/liftOver/hg19ToHg38.over.chain.gz +chromSizes=/hive/data/genomes/hg38/chrom.sizes + +mkdir -p $outDir $outDir/tmp + +# The boundaries a control region had before this study revised them are lifted +# on their own, and then joined back onto the ICR track as a text field. +liftOver -tab -bedPlus=4 $bedDir/kaplanIcrOrig.hg19.bed $chain \ + $outDir/tmp/kaplanIcrOrig.hg38.bed $outDir/kaplanIcrOrig.unmapped + +# liftOver needs -tab and -bedPlus so that it leaves the extra fields alone. +# The column added by awk carries the length before lifting, which is what +# kaplanLiftNote.py uses to spot regions stretched over sequence added in hg38. +for track in kaplanIcr kaplanBimodal kaplanAsm kaplanParentalAsm; do + echo "== $track" + awk -v OFS='\t' '{print $0, NR"|"($3-$2)}' $bedDir/$track.hg19.bed \ + > $outDir/tmp/$track.id.bed + liftOver -tab -bedPlus=9 $outDir/tmp/$track.id.bed $chain \ + $outDir/tmp/$track.lifted.bed $outDir/$track.unmapped + if [ $track = kaplanIcr ]; then + $scriptDir/kaplanIcrAddOrig.py $outDir/tmp/$track.lifted.bed \ + $outDir/tmp/kaplanIcrOrig.hg38.bed $outDir/tmp/$track.withOrig.bed + mv $outDir/tmp/$track.withOrig.bed $outDir/tmp/$track.lifted.bed + fi + $scriptDir/kaplanLiftNote.py $outDir/tmp/$track.lifted.bed \ + $outDir/tmp/$track.noted.bed +done + +echo +for track in kaplanIcr kaplanBimodal kaplanAsm kaplanParentalAsm; do + sort -k1,1 -k2,2n $outDir/tmp/$track.noted.bed > $outDir/$track.hg38.bed + # the two small curated sets are searchable by name, the two genome-wide + # ones have names like "3 cell types" that are not worth indexing + extraIndex="" + if [ $track = kaplanIcr -o $track = kaplanParentalAsm ]; then + extraIndex="-extraIndex=name" + fi + bedToBigBed -type=bed9+ -tab -as=$scriptDir/$track.as $extraIndex \ + $outDir/$track.hg38.bed $chromSizes $outDir/$track.bb 2> $outDir/tmp/$track.bbLog + printf "%-20s hg19 %8d -> hg38 %8d (%d did not lift)\n" $track \ + $(wc -l < $bedDir/$track.hg19.bed) $(wc -l < $outDir/$track.hg38.bed) \ + $(grep -vc '^#' $outDir/$track.unmapped || true) +done