fcc6591a9eb3db4aeb92d2a6d45e43b689e99896 galt Wed Apr 21 23:55:56 2021 -0700 adding mm10 to altScaffoldPlacementToBed.pl so it does not create IDs with sub-version, like hg19. diff --git src/hg/utils/automation/altScaffoldPlacementToBed.pl src/hg/utils/automation/altScaffoldPlacementToBed.pl index e542415..136809f 100755 --- src/hg/utils/automation/altScaffoldPlacementToBed.pl +++ src/hg/utils/automation/altScaffoldPlacementToBed.pl @@ -36,38 +36,38 @@ while (<>) { next if (/^#/); chomp; my @w = split("\t"); my ($altScafName, $altAcc, $c, $cAcc, $altStart, $altEnd, $cStart, $cEnd, $altEndTail) = ($w[2], $w[3], $w[5], $w[6], $w[9], $w[10], $w[11], $w[12], $w[14]); my $suffix = $aNameToSuffix{$altScafName}; if (! $suffix) { $suffix = ($altScafName =~ m/PATCH$/) ? "fix" : "alt"; } my $chr = "chr$c"; my $chrBase = $chr; if ($c =~ m/^HSCHR/) { # Mapping is not alt/fix to chrom, but fix to alt; convert alt accession to UCSC format: $chr = $cAcc; - if ($opt_db && $opt_db eq 'hg19') { + if ($opt_db && ($opt_db eq 'hg19' || $opt_db eq 'mm10')) { $chr =~ s/^(\w+)\.\d+/$1/ || die "Unexpected cAcc ($cAcc)"; $chr = lc($chr); } else { $chr =~ s/^(\w+)\.(\d+)/$1v$2/ || die "Unexpected cAcc ($cAcc)"; } $chrBase =~ s/HSCHR([A-Z0-9]+)_.*/$1/; $chr = "${chrBase}_${chr}_alt"; } - if ($opt_db && $opt_db eq 'hg19') { + if ($opt_db && ($opt_db eq 'hg19' || $opt_db eq 'mm10')) { $altAcc =~ s/^(\w+)\.\d+/$1/ || die "Unexpected altAcc ($altAcc)"; $altAcc = lc($altAcc); } else { $altAcc =~ s/^(\w+)\.(\d+)/$1v$2/ || die "Unexpected altAcc ($altAcc)"; } $altAcc = "${chrBase}_${altAcc}_$suffix"; my $altName = $altAcc; if ($altStart > 1 || $altEndTail > 0) { $altName .= ":$altStart-$altEnd"; } print join("\t", $chr, $cStart-1, $cEnd, $altName) . "\n"; print join("\t", $altAcc, $altStart-1, $altEnd, $chr.":$cStart-$cEnd") . "\n"; }