Skip to content

Commit 05f1052

Browse files
authored
Make chain file translation more robust
1 parent e6bb8f3 commit 05f1052

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/util/ChainFileValidator.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,16 @@ public void exec(Results rs) throws SQLException
338338

339339
//UCSC is a main source of chain files, so deal with their quirks:
340340
// https://genome.ucsc.edu/cgi-bin/hgGateway
341+
if (refName.startsWith("chr0"))
342+
{
343+
// Allow chr01, chr1 -> 1
344+
String toTest = refName.replaceFirst("chr0", "");
345+
if (cachedReferences.containsKey(toTest))
346+
{
347+
return cachedReferences.get(toTest);
348+
}
349+
}
350+
341351
if (refName.startsWith("chr"))
342352
{
343353
String toTest = refName.replaceFirst("chr", "");

0 commit comments

Comments
 (0)