Skip to content

Commit

Permalink
Merge pull request #252 from hammerlab/header-spec-to-extant-columns
Browse files Browse the repository at this point in the history
header_spec -> extant_columns
  • Loading branch information
danvk committed Nov 20, 2014
2 parents c416b0c + 51e86b0 commit 7c98554
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cycledash/genotypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ def spec(vcf_id):
...},
SAMPLE: {attrA: ...}}
"""
query = "SELECT vcf_header, header_spec FROM vcfs WHERE id = %s"
query = "SELECT vcf_header, extant_columns FROM vcfs WHERE id = %s"
with db.engine.connect() as connection:
res = dict(connection.execute(query, (vcf_id,)).fetchall()[0])
spec = _vcf_header_spec(res['vcf_header'], res['header_spec'])
spec = _vcf_header_spec(res['vcf_header'], res['extant_columns'])
return spec


Expand Down
2 changes: 1 addition & 1 deletion schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CREATE TABLE vcfs (
notes TEXT, -- Any notes, params, etc the user might add. Ideally in JSON format.
uri TEXT UNIQUE, -- URI of source file, if any
vcf_header TEXT, -- Plaintext header of the VCF
header_spec TEXT, -- list of non-null columns in the VCF
extant_columns TEXT, -- JSON list of non-null columns in the VCF

precision NUMERIC,
recall NUMERIC,
Expand Down
2 changes: 1 addition & 1 deletion workers/genotype_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def extractor(run):
# (as this is a time-consuming operation) in the vcfs table for later use.
extant_cols = json.dumps(extant_columns(metadata, connection, vcf_id))
vcfs = metadata.tables.get('vcfs')
vcfs.update().where(vcfs.c.id == vcf_id).values(header_spec=extant_cols).execute()
vcfs.update().where(vcfs.c.id == vcf_id).values(extant_columns=extant_cols).execute()

connection.close()
return True
Expand Down

0 comments on commit 7c98554

Please sign in to comment.