595d44078d99eb1f717f097e2e4c886c450b2fe1 hiram Tue Mar 28 12:19:29 2023 -0700 adding download links on the gene track description pages for the GTF file no redmine diff --git src/hg/utils/automation/AsmHub.pm src/hg/utils/automation/AsmHub.pm index f650f8d..9bdbac5 100755 --- src/hg/utils/automation/AsmHub.pm +++ src/hg/utils/automation/AsmHub.pm @@ -25,15 +25,27 @@ # delimiters, input is a large number with no commas: sub commify($) { my $text = reverse $_[0]; $text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g; return scalar reverse $text } # given an asmId.chrom.sizes, return the assembly size from the # sum of column 2: sub asmSize($) { my ($chromSizes) = @_; my $asmSize=`ave -col=2 $chromSizes | grep "total" | sed -e 's/total //; s/.000000//;'`; chomp $asmSize; return $asmSize; } + +# given a fully qualified asmId, e.g.: GCA_018504075.1_HG02723.alt.pat.f1_v2 +# return the string representating the path: GCA/018/504/075 +sub asmIdToPath($) { + my ($asmId) = @_; + my $gcX = substr($asmId, 0, 3); + my $d0 = substr($asmId, 4, 3); + my $d1 = substr($asmId, 7, 3); + my $d2 = substr($asmId, 10, 3); + my $ret = sprintf("%s/%s/%s/%s", $gcX, $d0, $d1, $d2); + return $ret; +}