Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

612 taxon id #1513

Merged
merged 10 commits into from Feb 2, 2017
Merged

612 taxon id #1513

merged 10 commits into from Feb 2, 2017

Conversation

ejacox
Copy link
Collaborator

@ejacox ejacox commented Dec 21, 2016

Replace NCBI taxon ID integer with ontology term in References and ReferenceSets. Propagates issue ga4gh/ga4gh-schemas#612 and pull request ga4gh/ga4gh-schemas#699.

@codecov-io
Copy link

codecov-io commented Dec 21, 2016

Codecov Report

Merging #1513 into master will increase coverage by -0.17%.

@@            Coverage Diff             @@
##           master    #1513      +/-   ##
==========================================
- Coverage   84.95%   84.79%   -0.17%     
==========================================
  Files          32       32              
  Lines        7087     7110      +23     
  Branches      897      902       +5     
==========================================
+ Hits         6021     6029       +8     
- Misses        907      919      +12     
- Partials      159      162       +3
Impacted Files Coverage Δ
ga4gh/server/datarepo.py 93.97% <ø> (ø)
ga4gh/server/cli/repomanager.py 84.8% <ø> (-0.32%)
ga4gh/server/datamodel/references.py 93.49% <63.15%> (-5.17%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c14ccad...f7684d5. Read the comment docs.

@david4096
Copy link
Member

david4096 commented Dec 22, 2016

Great!

http post localhost:8000/references/search referenceSetId=WyJoZzM3Il0

Gives:

HTTP/1.0 200 OK
Content-Length: 367
Content-Type: application/json
Date: Thu, 22 Dec 2016 01:59:13 GMT
Server: Werkzeug/0.11.5 Python/2.7.12+

{
    "nextPageToken": "", 
    "references": [
        {
            "id": "WyJoZzM3IiwicmVmX2JyY2ExIl0", 
            "isDerived": false, 
            "length": "81188", 
            "md5checksum": "90977a37195d3fd247e4916b5b4cbae8", 
            "name": "ref_brca1", 
            "sourceAccessions": [
                "GA4GH_CTS_01_BRCA1"
            ], 
            "sourceDivergence": 0.0, 
            "sourceUri": "", 
            "species": {
                "id": "9606", 
                "sourceName": "NCBI", 
                "sourceVersion": "", 
                "term": "Homo sapiens"
            }
        }
    ]
}

Looks good!

Set my own species ID from the repo command line using:

python repo_dev.py add-referenceset ga4gh-example-data/registry.db ga4gh-example-data/ref_brca1.fa.gz --species '{"id": "1234"}'

And inspected the database, which nicely had my entry.

WyJyZWZfYnJjYTEiXQ|ref_brca1|||0|12827085103f42e97428dc05a7f26fec|{"sourceName": "", "sourceVersion": "", "term": "", "id": "1234"}|[]||/home/david/git/server-1/ga4gh-example-data/ref_brca1.fa.gz

Ran this branch of compliance against it reporting one already known failure.

In the future we might provide an improved interface for setting species ontology terms via the repo manager.

+1

VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);
"""
cursor = self._dbConnection.cursor()
cursor.execute(sql, (
reference.getId(), reference.getParentContainer().getId(),
reference.getLocalId(), reference.getLength(),
reference.getIsDerived(), reference.getMd5Checksum(),
reference.getNcbiTaxonId(),
json.dumps(reference.getSpecies()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You provide the class as a second argument (protocol.OntologyTerm) when inserting a reference set. Any reason for the discrepancy? Does it produce a nice exception?

@david4096
Copy link
Member

david4096 commented Jan 10, 2017

Closes #1490

@david4096 david4096 merged commit f7a9990 into ga4gh:master Feb 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants