e70152e44cc66cc599ff6b699eb8adc07f3e656a kent Sat May 24 21:09:34 2014 -0700 Adding Copyright NNNN Regents of the University of California to all files I believe with reasonable certainty were developed under UCSC employ or as part of Genome Browser copyright assignment. diff --git src/hg/lib/txCommon.c src/hg/lib/txCommon.c index 9b587c8..ae3825a 100644 --- src/hg/lib/txCommon.c +++ src/hg/lib/txCommon.c @@ -1,55 +1,58 @@ /* txCommon - contains routines shared by various programs in * the txXxx family (which is used to make the UCSC gene set */ +/* Copyright (C) 2014 The Regents of the University of California + * See README in this or parent directory for licensing information. */ + #include "common.h" #include "linefile.h" #include "hash.h" #include "txCommon.h" char *txAccFromTempName(char *tempName) /* Given name in this.that.acc.version format, return * just acc.version. */ { char *s = tempName + strlen(tempName); int periodCount = 0; while (s > tempName && periodCount < 2) { char c = *(--s); if (c == '.') ++periodCount; } if (periodCount < 2) errAbort("Can't extract accession.ver from %s, expecting at least two periods", tempName); s += 1; int len = strlen(s); if ((len < 8 && !startsWith("CCDS", s) ) || len > 75) { errAbort("Accession seems a little too long or short in %s", tempName); } return s; } void txGeneAccFromId(int id, char acc[16]) /* Convert ID to accession in uc123ABC format. */ { if (id >= 17576000) errAbort("Out of accessions!"); acc[8] = 0; acc[7] = id%26 + 'a'; id /= 26; acc[6] = id%26 + 'a'; id /= 26; acc[5] = id%26 + 'a'; id /= 26; acc[4] = id%10 + '0'; id /= 10; acc[3] = id%10 + '0'; id /= 10; acc[2] = id%10 + '0'; acc[1] = 'c'; acc[0] = 'u'; }