Skip to content
Commits on Source (2)
......@@ -112,7 +112,7 @@ struct bbiSummary *bwgReduceSectionList(struct bwgSection *sectionList,
void bwgCreate(struct bwgSection *sectionList, struct hash *chromSizeHash,
int blockSize, int itemsPerSlot, boolean doCompress, boolean keepAllChromosomes,
boolean fixedSummaries, char *fileName);
boolean fixedSummaries, boolean clipDontDie, char *fileName);
/* Create a bigWig file out of a sorted sectionList. A lower level routine
* than the one above. */
......
......@@ -81,7 +81,7 @@ ifneq (${SSL_DIR}, "/usr/include/openssl")
endif
# on hgwdev, already using the static library with mysqllient.
ifeq (${IS_HGWDEV},yes)
L+=/usr/lib64/libssl.a /usr/lib64/libcrypto.a -lkrb5
L+=/usr/lib64/libssl.a /usr/lib64/libcrypto.a -lkrb5 -lk5crypto -ldl
else
L+=-lssl -lcrypto
endif
......@@ -89,7 +89,7 @@ endif
# autodetect where libm is installed
ifeq (${MLIB},)
ifneq ($(wildcard /usr/lib64/libm.a),)
MLIB=/usr/lib64/libm.a
MLIB=-lm
endif
endif
ifeq (${MLIB},)
......@@ -138,7 +138,7 @@ ifneq ($(MAKECMDGOALS),clean)
# on hgwdev, use the static library.
ifeq (${IS_HGWDEV},yes)
MYSQLINC=/usr/include/mysql
MYSQLLIBS=/usr/lib64/libssl.a /usr/lib64/libcrypto.a /usr/lib64/mysql/libmysqlclient.a -lkrb5
MYSQLLIBS=/usr/lib64/libmysqlclient.a /usr/lib64/libssl.a /usr/lib64/libcrypto.a -lkrb5 -ldl -lz
endif
# this does *not* work on Mac OSX with the dynamic libraries
ifneq ($(UNAME_S),Darwin)
......@@ -239,7 +239,7 @@ endif
# OK to add -lstdc++ to all MYSQLLIBS just in case it is
# MySQL version 5.6 libraries, but no 'librt' on Mac OSX
ifeq (${IS_HGWDEV},yes)
MYSQLLIBS += /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libstdc++.a /usr/lib/debug/usr/lib64/librt.a
MYSQLLIBS += /usr/lib/gcc/x86_64-redhat-linux/4.8.5/libstdc++.a /usr/lib64/librt.a
else
ifeq ($(UNAME_S),Darwin)
MYSQLLIBS += -lstdc++
......@@ -261,7 +261,7 @@ endif
#global external libraries
L += $(kentSrc)/htslib/libhts.a
L+=${PNGLIB} ${ZLIB} ${MLIB}
L+=${PNGLIB} ${MLIB} ${ZLIB}
HG_INC+=${PNGINCL}
# pass through COREDUMP
......
......@@ -6,6 +6,7 @@
#ifndef gff3_h
#define gff3_h
struct gff3Ann
/* Annotation record from a GFF3 file. Attributes define in the spec (those
* starting with upper case letters) are parsed into fields of this
......@@ -140,6 +141,10 @@ struct gff3Ann
* if not known */
};
/* flags */
#define GFF3_WARN_WHEN_POSSIBLE 0x01 // generate warnings and drop entries rather than errors
struct gff3AnnRef
/* A reference to a gff3Ann object */
{
......@@ -191,6 +196,7 @@ struct gff3File
* NULL if none specified */
struct lineFile *lf; /* only set while parsing */
FILE *errFh; /* write errors to this file */
unsigned int flags; /* flags controlling parsing */
int maxErr; /* maximum number of errors before aborting */
int errCnt; /* error count */
};
......@@ -229,11 +235,11 @@ extern char *gff3FeatJGeneSegment;
extern char *gff3FeatVGeneSegment;
struct gff3File *gff3FileOpen(char *fileName, int maxErr, FILE *errFh);
struct gff3File *gff3FileOpen(char *fileName, int maxErr, unsigned flags, FILE *errFh);
/* Parse a GFF3 file into a gff3File object. If maxErr not zero, then
* continue to parse until this number of error have been reached. A maxErr
* less than zero does not stop reports all errors. Write errors to errFh,
* if NULL, use stderr. */
* if NULL, use stderr. See above flags. */
void gff3FileFree(struct gff3File **g3fPtr);
/* Free a gff3File object */
......
/*****************************************************************************
* Copyright (C) 2002 Ryan Weber. This source code may be freely used *
* for personal, academic, and non-profit purposes. Commercial use *
* permitted only by explicit agreement with Ryan Weber (weber@cse.ucsc.edu) *
* permitted only by explicit agreement with Ryan Weber (weber@soe.ucsc.edu) *
*****************************************************************************/
/* jointalign.h - routines for printing a joint alignment in html. */
......
/* Copyright (C) 2014 The Regents of the University of California
* See README in this or parent directory for licensing information. */
#define SRC_VERSION "365"
#define SRC_VERSION "370"
......@@ -176,6 +176,9 @@ switch (type)
fprintf(f, "%c", datum.datChar);
break;
case vcfInfoString:
if (startsWith("http", datum.datString))
fprintf(f, "<a target=_blank href='%s'>%s</a>", datum.datString, datum.datString);
else
fprintf(f, "%s", datum.datString);
break;
default:
......
......@@ -361,6 +361,27 @@ for (item = itemList; item != NULL; )
lmCleanup(&lmLocal);
}
static bits32 getChromSize(struct hash *chromSizeHash, char *chrom, boolean clipDontDie)
/* return size of chrom or BIGNUM if hash is NULL. errAbort if not found, unless clipDontDie */
{
int chromSize = 0;
if (chromSizeHash) {
chromSize = hashIntValDefault(chromSizeHash, chrom, -1);
if (chromSize==-1) {
warn("chromosome %s is not in chrom sizes file", chrom);
if (clipDontDie)
chromSize = BIGNUM;
else
noWarnAbort();
}
}
else
chromSize = BIGNUM;
return chromSize;
}
static unsigned parseUnsignedVal(struct lineFile *lf, char *var, char *val)
/* Return val as an integer, printing error message if it's not. */
{
......@@ -420,7 +441,9 @@ while ((varEqVal = nextWord(&initialLine)) != NULL)
* rest of section. */
if (chrom == NULL)
errAbort("Missing chrom= setting line %d of %s\n", lf->lineIx, lf->fileName);
bits32 chromSize = (chromSizeHash ? hashIntVal(chromSizeHash, chrom) : BIGNUM);
bits32 chromSize = getChromSize(chromSizeHash, chrom, clipDontDie);
if (start > chromSize)
{
warn("line %d of %s: chromosome %s has %u bases, but item starts at %u",
......@@ -502,7 +525,7 @@ while (lineFileNextReal(lf, &line))
{
lmAllocVar(chromHash->lm, chrom);
hashAddSaveName(chromHash, chromName, chrom, &chrom->name);
chrom->size = (chromSizeHash ? hashIntVal(chromSizeHash, chromName) : BIGNUM);
chrom->size = getChromSize(chromSizeHash, chromName, clipDontDie);
slAddHead(&chromList, chrom);
}
......@@ -585,7 +608,7 @@ chromList = NULL;
}
void bwgMakeChromInfo(struct bwgSection *sectionList, struct hash *chromSizeHash,
int *retChromCount, struct bbiChromInfo **retChromArray,
boolean clipDontDie, int *retChromCount, struct bbiChromInfo **retChromArray,
int *retMaxChromNameSize)
/* Fill in chromId field in sectionList. Return array of chromosome name/ids.
* The chromSizeHash is keyed by name, and has int values. */
......@@ -619,7 +642,7 @@ for (i = 0, uniq = uniqList; i < chromCount; ++i, uniq = uniq->next)
{
chromArray[i].name = uniq->val;
chromArray[i].id = i;
chromArray[i].size = hashIntVal(chromSizeHash, uniq->val);
chromArray[i].size = getChromSize(chromSizeHash, uniq->val, clipDontDie);
}
/* Clean up, set return values and go home. */
......@@ -636,7 +659,7 @@ static int bwgStrcmp (const void * A, const void * B) {
}
void bwgMakeAllChromInfo(struct bwgSection *sectionList, struct hash *chromSizeHash,
int *retChromCount, struct bbiChromInfo **retChromArray,
boolean clipDontDie, int *retChromCount, struct bbiChromInfo **retChromArray,
int *retMaxChromNameSize)
/* Fill in chromId field in sectionList. Return array of chromosome name/ids.
* The chromSizeHash is keyed by name, and has int values. */
......@@ -667,7 +690,7 @@ for (i = 0; i < chromCount; ++i)
{
chromArray[i].name = chromNames[i];
chromArray[i].id = i;
chromArray[i].size = hashIntVal(chromSizeHash, chromNames[i]);
chromArray[i].size = getChromSize(chromSizeHash, chromNames[i], clipDontDie);
}
// Assign IDs to sections:
......@@ -956,7 +979,7 @@ for (i=1; i<REDUCTION_COUNT; i++)
void bwgCreate(struct bwgSection *sectionList, struct hash *chromSizeHash,
int blockSize, int itemsPerSlot, boolean doCompress, boolean keepAllChromosomes,
boolean fixedSummaries, char *fileName)
boolean fixedSummaries, boolean clipDontDie, char *fileName)
/* Create a bigWig file out of a sorted sectionList. */
{
bits64 sectionCount = slCount(sectionList);
......@@ -984,9 +1007,9 @@ int i;
struct bbiChromInfo *chromInfoArray;
int chromCount, maxChromNameSize;
if (keepAllChromosomes)
bwgMakeAllChromInfo(sectionList, chromSizeHash, &chromCount, &chromInfoArray, &maxChromNameSize);
bwgMakeAllChromInfo(sectionList, chromSizeHash, clipDontDie, &chromCount, &chromInfoArray, &maxChromNameSize);
else
bwgMakeChromInfo(sectionList, chromSizeHash, &chromCount, &chromInfoArray, &maxChromNameSize);
bwgMakeChromInfo(sectionList, chromSizeHash, clipDontDie, &chromCount, &chromInfoArray, &maxChromNameSize);
if (fixedSummaries)
bwgComputeFixedSummaries(sectionList, reduceSummaries, &summaryCount, chromInfoArray, reductionAmounts);
......@@ -1217,7 +1240,7 @@ struct lm *lm = lmInit(0);
struct bwgSection *sectionList = bwgParseWig(inName, clipDontDie, chromSizeHash, itemsPerSlot, lm);
if (sectionList == NULL)
errAbort("%s is empty of data", inName);
bwgCreate(sectionList, chromSizeHash, blockSize, itemsPerSlot, compress, keepAllChromosomes, fixedSummaries, outName);
bwgCreate(sectionList, chromSizeHash, blockSize, itemsPerSlot, compress, keepAllChromosomes, fixedSummaries, clipDontDie, outName);
lmCleanup(&lm);
}
......
......@@ -69,45 +69,51 @@ static bool gff3FileStopDueToErrors(struct gff3File *g3f)
return g3f->errCnt > g3f->maxErr;
}
static void gff3FileErr(struct gff3File *g3f, char *format, ...)
static void gff3FileErr(struct gff3File *g3f, bool canWarn, char *format, ...)
#if defined(__GNUC__)
__attribute__((format(printf, 2, 3)))
__attribute__((format(printf, 3, 4)))
#endif
;
static void gff3AnnErr(struct gff3Ann *g3a, char *format, ...)
static void gff3AnnErr(struct gff3Ann *g3a, bool canWarn, char *format, ...)
#if defined(__GNUC__)
__attribute__((format(printf, 2, 3)))
__attribute__((format(printf, 3, 4)))
#endif
;
static void vaGff3FileErr(struct gff3File *g3f, char *format, va_list args)
static void vaGff3FileErr(struct gff3File *g3f, bool canWarn, char *format, va_list args)
/* Print error message to error file, abort if max errors have been reached */
{
bool isWarning = canWarn && (g3f->flags & GFF3_WARN_WHEN_POSSIBLE);
if (g3f->lf != NULL)
fprintf(g3f->errFh, "%s:%d: ", g3f->lf->fileName, g3f->lf->lineIx);
if (isWarning)
fprintf(g3f->errFh, "WARNING: ");
vfprintf(g3f->errFh, format, args);
fprintf(g3f->errFh, "\n");
if (!isWarning)
{
g3f->errCnt++;
if (gff3FileStopDueToErrors(g3f))
errAbort("GFF3: %d parser errors", g3f->errCnt);
}
}
static void gff3FileErr(struct gff3File *g3f, char *format, ...)
static void gff3FileErr(struct gff3File *g3f, bool canWarn, char *format, ...)
/* Print error message and abort */
{
va_list args;
va_start(args, format);
vaGff3FileErr(g3f, format, args);
vaGff3FileErr(g3f, canWarn, format, args);
va_end(args);
}
static void gff3AnnErr(struct gff3Ann *g3a, char *format, ...)
static void gff3AnnErr(struct gff3Ann *g3a, bool canWarn, char *format, ...)
/* Print error message abort */
{
va_list args;
va_start(args, format);
vaGff3FileErr(g3a->file, format, args);
vaGff3FileErr(g3a->file, canWarn, format, args);
va_end(args);
}
......@@ -117,7 +123,7 @@ static int gff3FileStrToInt(struct gff3File *g3f, char *str)
char *end;
long val = strtol(str, &end, 0);
if ((end == str) || (*end != '\0'))
gff3FileErr(g3f, "invalid integer: %s", str);
gff3FileErr(g3f, FALSE, "invalid integer: %s", str);
return (int)val;
}
......@@ -127,7 +133,7 @@ static float gff3FileStrToFloat(struct gff3File *g3f, char *str)
char *end;
double val = strtod(str, &end);
if ((end == str) || (*end != '\0'))
gff3FileErr(g3f, "invalid float: %s", str);
gff3FileErr(g3f, FALSE, "invalid float: %s", str);
return (float)val;
}
......@@ -164,7 +170,7 @@ static char **dynChopStringWhite(struct gff3File *g3f, char *str, int minWords,
int numWords = chopByWhite(str, NULL, 0);
if ((numWords < minWords) || (numWords > maxWords))
{
gff3FileErr(g3f, "expected %s, got \"%s\"", desc, str);
gff3FileErr(g3f, FALSE, "expected %s, got \"%s\"", desc, str);
return NULL;
}
// allocate buffer for both array and string
......@@ -212,7 +218,7 @@ return NULL;
static void raiseInvalidEscape(struct gff3Ann *g3a, char *str)
/* raise an error about an invalid escape in a string */
{
gff3AnnErr(g3a, "invalid GFF escape sequence in string: %s", str);
gff3AnnErr(g3a, TRUE, "invalid GFF escape sequence in string: %s", str);
}
static char convertEscape(struct gff3Ann *g3a, char *esc, char *src)
......@@ -220,13 +226,19 @@ static char convertEscape(struct gff3Ann *g3a, char *esc, char *src)
* in the form `%09' */
{
if (!(isxdigit(esc[1]) && isxdigit(esc[2])))
{
raiseInvalidEscape(g3a, src);
return '_'; // something
}
char num[3], *end;
strncpy(num, esc+1, 2);
num[2] = '\0';
long val = strtol(num, &end, 16);
if ((end == num) || (*end != '\0'))
{
raiseInvalidEscape(g3a, src);
return '_';
}
return (char)val;
}
......@@ -314,7 +326,10 @@ else if (sameString(strand, "-"))
else if (sameString(strand, "?"))
return "?";
else
gff3AnnErr(g3a, "invalid strand: '%s'", strand);
{
gff3AnnErr(g3a, TRUE, "invalid strand: '%s'", strand);
return NULL;
}
return NULL;
}
......@@ -325,7 +340,10 @@ if (sameString(str, "."))
return -1;
int phase = gff3FileStrToInt(g3a->file, str);
if ((phase < 0) || (phase > 2))
gff3AnnErr(g3a, "invalid phase: %d", phase);
{
gff3AnnErr(g3a, TRUE, "invalid phase: %d", phase);
return -1;
}
return phase;
}
......@@ -347,14 +365,14 @@ g3a->phase = parsePhase(g3a, words[7]);
if (sameString(g3a->type, "CDS"))
{
if (g3a->phase < 0)
gff3AnnErr(g3a, "CDS feature must have phase");
gff3AnnErr(g3a, TRUE, "CDS feature must have phase");
}
else
{
#if 0 // spec unclear; bug report filed
// spec currently doesn't restrict phase, unclear if it's allowed on start/stop codon features
if (g3a->phase >= 0)
gff3AnnErr(g3a, "phase only allowed on CDS features");
gff3AnnErr(g3a, TRUE, "phase only allowed on CDS features");
#endif
}
}
......@@ -364,14 +382,18 @@ static boolean checkAttrTag(struct gff3Ann *g3a, char *tag)
{
// FIXME: spec is not clear on what is a valid tag.
char *tc = tag;
boolean isOk = isalpha(*tc);
boolean isOk = (isalnum(*tc) || (*tc == '-') || (*tc == '_'));
for (tc++; isOk && (*tc != '\0'); tc++)
{
if (!((*tc == '-') || (*tc == '_') || isalnum(*tc)))
isOk = FALSE;
}
if (!isOk)
gff3AnnErr(g3a, "invalid attribute tag, must start with an alphabetic character and be composed of alphanumeric, dash, or underscore characters: %s", tag);
{
gff3AnnErr(g3a, TRUE, "invalid attribute tag, must be only alphanumeric, dash or underscore: %s", tag);
if (g3a->file->flags & GFF3_WARN_WHEN_POSSIBLE)
return TRUE;
}
return isOk;
}
......@@ -411,7 +433,7 @@ static void parseAttr(struct gff3Ann *g3a, char *attrStr)
{
char *eq = strchr(attrStr, '=');
if ((eq == NULL) || (eq == attrStr))
gff3AnnErr(g3a, "expected name=value: %s", attrStr);
gff3AnnErr(g3a, FALSE, "expected name=value: %s", attrStr);
else
{
char *tag = attrStr;
......@@ -443,7 +465,7 @@ static void checkSingleValAttr(struct gff3Ann *g3a, struct gff3Attr *attr)
/* validate that an attribute has only one value */
{
if (attr->vals->next != NULL)
gff3AnnErr(g3a, "attribute %s must have a single value, found multiple comma-separated values", attr->tag);
gff3AnnErr(g3a, FALSE, "attribute %s must have a single value, found multiple comma-separated values", attr->tag);
}
static void parseIDAttr(struct gff3Ann *g3a, struct gff3Attr *attr)
......@@ -564,7 +586,7 @@ else if (sameString(attr->tag, gff3AttrDbxref))
else if (sameString(attr->tag, gff3AttrOntologyTerm))
parseOntologyTermAttr(g3a, attr);
else
gff3AnnErr(g3a, "unknown standard attribute, user defined attributes must start with a lower-case letter: %s", attr->tag);
gff3AnnErr(g3a, TRUE, "unknown standard attribute, user defined attributes must start with a lower-case letter: %s", attr->tag);
}
static void parseStdAttrs(struct gff3Ann *g3a)
......@@ -587,7 +609,7 @@ static void parseAnn(struct gff3File *g3f, char *line)
char *words[gffNumCols+1];
int numWords = chopString(line, "\t", words, gffNumCols+1);
if (numWords != gffNumCols)
gff3FileErr(g3f, "expected %d tab-separated columns: %s", gffNumCols, line);
gff3FileErr(g3f, FALSE, "expected %d tab-separated columns: %s", gffNumCols, line);
else
{
struct gff3Ann *g3a = gff3FileAlloc(g3f, sizeof(struct gff3Ann));
......@@ -706,7 +728,7 @@ if (g3f->seqRegionMap == NULL)
g3f->seqRegionMap = hashNew(0);
struct hashEl *hel = hashStore(g3f->seqRegionMap, sr->seqid);
if (hel->val != NULL)
gff3FileErr(g3f, "duplicate ##sequence-region for %s", sr->seqid);
gff3FileErr(g3f, TRUE, "duplicate ##sequence-region for %s", sr->seqid);
else
{
hel->val = sr;
......@@ -803,7 +825,10 @@ static void parseGenomeBuild(struct gff3File *g3f, char *line)
/* parse ##genome-build source buildName */
{
if (g3f->genomeBuildSource != NULL)
gff3FileErr(g3f, "multiple ##genome-build records");
{
gff3FileErr(g3f, TRUE, "multiple ##genome-build records");
return; // skip
}
char **words = dynChopStringWhite(g3f, line, 3, 3, NULL,
"\"##genome-build source buildName\"");
if (words == NULL)
......@@ -847,7 +872,7 @@ else if (startsWithWord("##gff-spec-version", line) ||
startsWithWord("##Type", line))
; /* FIXME: silently ignore these. Mark says. */
else
gff3FileErr(g3f, "invalid meta line: %s", line);
gff3FileErr(g3f, TRUE, "invalid meta line: %s", line);
}
static void parseLine(struct gff3File *g3f, char *line)
......@@ -864,15 +889,15 @@ static void parseHeader(struct gff3File *g3f)
{
char *line;
if (!lineFileNext(g3f->lf, &line, NULL))
gff3FileErr(g3f, "empty GFF file, must have header");
gff3FileErr(g3f, FALSE, "empty GFF file, must have header");
char *ver = skipToSpaces(line);
if (*ver != '\0')
if ((ver != NULL) && (*ver != '\0'))
{
*ver++ = '\0';
ver = trimSpaces(ver);
}
if (!(sameString(line, "##gff-version") && sameString(ver, "3")))
gff3FileErr(g3f, "invalid GFF3 header");
gff3FileErr(g3f, TRUE, "invalid GFF3 header");
}
static void parseFile(struct gff3File *g3f)
......@@ -907,7 +932,7 @@ struct gff3Ann *g3a2;
for (g3a2 = g3a->nextPart; (g3a2 != NULL) && !gff3FileStopDueToErrors(g3a->file); g3a2 = g3a2->nextPart)
{
if (!sameString(g3a->type, g3a2->type))
gff3AnnErr(g3a, "Annotation records for discontinuous features with ID=\"%s\" do not have the same type, found \"%s\" and \"%s\"", g3a->id, g3a->type, g3a2->type);
gff3AnnErr(g3a, FALSE, "Annotation records for discontinuous features with ID=\"%s\" do not have the same type, found \"%s\" and \"%s\"", g3a->id, g3a->type, g3a2->type);
}
}
......@@ -978,7 +1003,7 @@ static struct gff3Ann *resolveRef(struct gff3Ann *g3a, char *id, char *attr)
{
struct gff3Ann *ann = gff3FileFindAnn(g3a->file, id);
if (ann == NULL)
gff3AnnErr(g3a, "Can't find annotation record \"%s\" referenced by \"%s\" %s attribute", id, g3a->id, attr);
gff3AnnErr(g3a, TRUE, "Can't find annotation record \"%s\" referenced by \"%s\" %s attribute", id, g3a->id, attr);
return ann;
}
......@@ -1001,7 +1026,11 @@ static void resolveAnn(struct gff3Ann *g3a)
{
g3a->parents = resolveRefs(g3a, g3a->parentIds, gff3AttrParent);
if (g3a->parents == NULL)
{
// is droppped if there here ignored errors resolving reference
if (g3a->parentIds == NULL)
slSafeAddHead(&g3a->file->roots, gff3AnnRefAlloc(g3a));
}
else
{
struct gff3AnnRef *par;
......@@ -1045,7 +1074,7 @@ g3f->pool = hashNew(0);
return g3f;
}
struct gff3File *gff3FileOpen(char *fileName, int maxErr, FILE *errFh)
struct gff3File *gff3FileOpen(char *fileName, int maxErr, unsigned flags, FILE *errFh)
/* Parse a GFF3 file into a gff3File object. If maxErr not zero, then
* continue to parse until this number of error have been reached. A maxErr
* less than zero does not stop reports all errors. Write errors to errFh,
......@@ -1053,6 +1082,7 @@ struct gff3File *gff3FileOpen(char *fileName, int maxErr, FILE *errFh)
{
struct gff3File *g3f = gff3FileNew();
g3f->fileName = gff3FileCloneStr(g3f, fileName);
g3f->flags = flags;
g3f->errFh = (errFh != NULL) ? errFh : stderr;
g3f->maxErr = (maxErr < 0) ? INT_MAX : maxErr;
parseFile(g3f);
......
......@@ -1010,7 +1010,7 @@ dyStringAppend(policy, " img-src * data:;");
dyStringAppend(policy, " img-src 'self'");
// used by hgGene for modbaseimages in hg/hgc/lowelab.c hg/protein/lib/domains.c hg/hgGene/domains.c
dyStringAppend(policy, " modbase.compbio.ucsf.edu");
dyStringAppend(policy, " hgwdev.cse.ucsc.edu"); // used by visiGene
dyStringAppend(policy, " hgwdev.gi.ucsc.edu"); // used by visiGene
dyStringAppend(policy, " genome.ucsc.edu"); // used by visiGene
dyStringAppend(policy, " code.jquery.com"); // used by hgIntegrator
dyStringAppend(policy, " www.google-analytics.com"); // used by google analytics
......
......@@ -1625,8 +1625,6 @@ while (TRUE)
return TRUE;
}
close(sd);
if (redirectCount > 0)
freeMem(url);
if (success)
{
/* we have a new url to try */
......@@ -1653,6 +1651,8 @@ while (TRUE)
}
}
}
if (redirectCount > 1)
freeMem(url);
if (!success)
{ /* failure after 0 to 5 redirects */
if (redirectCount > 0)
......
......@@ -1951,7 +1951,7 @@ if (cigar == NULL)
}
else
{
char cigarSpec[strlen(cigar+1)]; // copy since parsing is destructive
char cigarSpec[strlen(cigar)+1]; // copy since parsing is destructive
strcpy(cigarSpec, cigar);
char *cigarNext = cigarSpec;
if (strand[1] == '-')
......
......@@ -196,7 +196,7 @@ for (tti = ttiList; tti != NULL; tti = tti->next)
char *sqlType = NULL;
char sqlTypeBuf[256];
if (!isSymbolString(tti->name))
errAbort("Error - database needs work. Somehow symbol %s got in field list\n", tti->name);
errAbort("Error - tagStorm not SQL compliant. Somehow symbol %s got in field list\n", tti->name);
if (sqlReservedCheck(reservedHash, tti->name))
errAbort("Error - field '%s' is a SQL reserved word", tti->name);
if (tti->isUnsigned)
......
......@@ -53,6 +53,7 @@ if (startsWith("http://",url) || startsWith("https://",url))
/* Update sd with newSd, replace it with newUrl, etc. */
sd = newSd;
url = newUrl;
verbose(2, "New url after redirect: %s\n", url);
}
}
while (TRUE)
......
......@@ -18,7 +18,7 @@ errAbort(
static void gff3Tester(char *gff3InFile, char *gff3OutFile)
/* tester for GFF3 objects */
{
struct gff3File *g3f = gff3FileOpen(gff3InFile, -1, NULL);
struct gff3File *g3f = gff3FileOpen(gff3InFile, -1, 0, NULL);
gff3FileWrite(g3f, gff3OutFile);
gff3FileFree(&g3f);
}
......
......@@ -17,7 +17,7 @@ errAbort(
"htmlMimeTest - post mime-encoded page with series on input sizes\n"
"usage:\n"
" htmlMimeTest url-to-hgBlat dnaText startSize endSize\n"
"e.g. htmlMimeTest http://hgwdev-${user}.cse.ucsc.edu/cgi-bin/hgBlat input/htmlMime.txt 100 200\n"
"e.g. htmlMimeTest https://hgwdev-${user}.gi.ucsc.edu/cgi-bin/hgBlat input/htmlMime.txt 100 200\n"
"options:\n"
" -asFile - send data as type FILE upload (seqFile) instead of TEXTAREA (userSeq) \n"
);
......@@ -35,7 +35,6 @@ void htmlMimeTest(char *url, char *dnaFileName, int size)
struct htmlPage *rootPage, *page;
struct htmlForm *form, *mainForm;
struct qaStatus *qs;
struct htmlFormVar *orgVar;
char *dna, *dnaSeg;
qs = qaPageGet(url, &rootPage);
if (qs->errMessage)
......
......@@ -168,7 +168,7 @@ ${BIN_DIR}/htmlMimeTest: mkdirs htmlMimeTest.o ${MYLIBS}
${CC} ${COPT} -o ${BIN_DIR}/htmlMimeTest htmlMimeTest.o ${MYLIBS} ${L}
htmlMime1: ${BIN_DIR}/htmlMimeTest mkdirs
${BIN_DIR}/htmlMimeTest http://hgwdev.cse.ucsc.edu/cgi-bin/hgBlat input/htmlMime.txt 3490 3502 > output/$@.out
${BIN_DIR}/htmlMimeTest https://hgwdev.gi.ucsc.edu/cgi-bin/hgBlat input/htmlMime.txt 3490 3502 > output/$@.out
diff expected/$@.out output/$@.out
......
......@@ -33,7 +33,6 @@ int size = 0;
// Local copy (reference file) and URL for testing:
#define THOUSAND_HIVE "/hive/data/outside/1000genomes/ncbi/ftp-trace.ncbi.nih.gov/1000genomes/"
#define THOUSAND_FTP "ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/data/"
#define CHR3_SLX_BAM "NA12878/alignment/NA12878.chrom3.SLX.maq.SRP000032.2009_07.bam"
#define CHR4_SLX_BAM "NA12878/alignment/NA12878.chrom4.SLX.maq.SRP000032.2009_07.bam"
// Use typical size range of bgzip-compressed data blocks:
......@@ -452,7 +451,7 @@ else
if (sameString(protocol, "http"))
{
char *httpUrl = "http://hgwdev.cse.ucsc.edu/~angie/wgEncodeCshlRnaSeqAlignmentsK562ChromatinShort.bb";
char *httpUrl = "http://hgwdev.gi.ucsc.edu/~angie/wgEncodeCshlRnaSeqAlignmentsK562ChromatinShort.bb";
char *httpLocalCopy = "/gbdb/hg18/bbi/wgEncodeCshlRnaSeqAlignmentsK562ChromatinShort.bb";
if (size)
gotError |= testSize(httpUrl, fileSize(httpLocalCopy));
......
......@@ -29,7 +29,7 @@ static struct optionSpec options[] = {
{NULL, 0},
};
void closeOutput(struct hash *hash, bam_header_t *head)
void closeOutput(struct hash *hash)
/* Loops through the output files and closes them. */
{
struct hashEl *hel, *helList = hashElListHash(hash);
......@@ -44,7 +44,6 @@ void writeOutput(samfile_t *input, struct hash *hash, boolean unmapped, char *d
/* Reads through the input bam and writes each alignment to the correct output file.
* Unmapped reads are written to 'unmapped.bam' */
{
bam_header_t *head = input ->header;
bam1_t one;
ZeroVar(&one);
if (makeDir(dir))
......@@ -52,6 +51,7 @@ if (makeDir(dir))
setCurrentDir(dir);
}
// Creates a new directory and moves into it.
bam_header_t *head = sam_hdr_read(input);
samfile_t *unmap = bamMustOpenLocal("unmapped.bam", "wb", head);
if (!unmapped)
/* Removes the 'unmapped.bam' file if it is not requested. */
......@@ -60,11 +60,11 @@ if (!unmapped)
}
for (;;)
{
if (samread (input, &one) < 0)
if (sam_read1(input, head, &one) < 0)
{
break;
}
if (one.core.tid > 0)
if (one.core.tid >= 0)
{
char *chrom = head->target_name[one.core.tid];
samfile_t *out = hashFindVal(hash, chrom);
......@@ -74,13 +74,13 @@ for (;;)
out = bamMustOpenLocal(fileName, "wb", head);
hashAdd(hash, chrom, out);
}
samwrite(hashFindVal(hash, head->target_name[one.core.tid]), &one);
sam_write1(hashFindVal(hash, head->target_name[one.core.tid]), head, &one);
}
else
{
if (unmapped)
{
samwrite(unmap, &one);
sam_write1(unmap, head, &one);
}
}
}
......@@ -92,11 +92,10 @@ void bamSplitByChrom(char *inBam, char *dir, boolean unmapped)
{
struct hash *hash = hashNew(0);
samfile_t *input = bamMustOpenLocal(inBam, "rb", NULL);
bam_header_t *head = input ->header;
writeOutput(input, hash, unmapped, dir);
/* Open the output bam files in a new directory. */
/* Write each alignment to the correct output file. */
closeOutput(hash, head);
closeOutput(hash);
/* Loops through each output file and closes it */
samclose(input);
}
......
kentSrc = ../..
kentSrc = ../..
A = bamSplitByChrom
include $(kentSrc)/inc/userApp.mk
......@@ -114,6 +114,7 @@ for (;;)
psl->tName = cloneString((char *)hel->val); /* memory leak */
}
pslTabOut(psl, f); /* no free of this psl data, memory leak */
pslFree(&psl);
}
++processCount;
if (dots)
......