b1c2fdec9a31078a56333427830a760757d22a51
angie
Fri Jun 17 14:44:44 2016 -0700
Command line wrapper script for hgVai: hg/utils/vai.pl . hgVai has a new input parameter to specify a local file of variants instead of a custom track, and inhibits web output (e.g. Content-Type and cookies) when run on the command line. Added support for reading pgSnp variants from input file without bin column instead of database (pgSnp.as includes bin, but pgSnp files do not).
Has been tested somewhat on GBiB. Needs documentation.
refs #12216
diff --git src/hg/lib/pgSnp.c src/hg/lib/pgSnp.c
index 7e3524f..97e2028 100644
--- src/hg/lib/pgSnp.c
+++ src/hg/lib/pgSnp.c
@@ -627,49 +627,69 @@
while ((row = sqlNextRow(sr)) != NULL)
{
if (first == 1)
{
printf("
Links to phenotype databases
\n");
first = 0;
}
el = pgPhenoAssocLoad(row);
printf("%s\n", el->srcUrl, el->name);
}
}
}
static char *pgSnpAutoSqlString =
"table pgSnp"
-"\"personal genome SNP\""
+"\"personal genome SNP database table\""
" ("
" ushort bin; \"A field to speed indexing\""
" string chrom; \"Chromosome\""
" uint chromStart; \"Start position in chrom\""
" uint chromEnd; \"End position in chrom\""
" string name; \"alleles ACTG[/ACTG]\""
" int alleleCount; \"number of alleles\""
" string alleleFreq; \"comma separated list of frequency of each allele\""
" string alleleScores; \"comma separated list of quality scores\""
" )"
;
+static char *pgSnpFileAutoSqlString =
+"table pgSnp"
+"\"personal genome SNP file format\""
+" ("
+" string chrom; \"Chromosome\""
+" uint chromStart; \"Start position in chrom\""
+" uint chromEnd; \"End position in chrom\""
+" string name; \"alleles ACTG[/ACTG]\""
+" int alleleCount; \"number of alleles\""
+" string alleleFreq; \"comma separated list of frequency of each allele\""
+" string alleleScores; \"comma separated list of quality scores\""
+" )"
+;
+
struct asObject *pgSnpAsObj()
-// Return asObject describing fields of pgSnp
+// Return asObject describing fields of pgSnp database table (includes bin)
{
return asParseText(pgSnpAutoSqlString);
}
+struct asObject *pgSnpFileAsObj()
+// Return asObject describing fields of pgSnp file (no bin)
+{
+return asParseText(pgSnpFileAutoSqlString);
+}
+
struct pgSnp *pgSnpLoadNoBin(char **row)
/* load pgSnp struct from row without bin */
{
struct pgSnp *ret;
AllocVar(ret);
ret->bin = 0;
ret->chrom = cloneString(row[0]);
ret->chromStart = sqlUnsigned(row[1]);
ret->chromEnd = sqlUnsigned(row[2]);
ret->name = cloneString(row[3]);
ret->alleleCount = sqlSigned(row[4]);
ret->alleleFreq = cloneString(row[5]);
ret->alleleScores = cloneString(row[6]);
return ret;