Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preview-genomic_model-neo4j.xml does not contain all the fields for some classes #62

Open
yasharmaster opened this issue Jul 12, 2017 · 3 comments

Comments

@yasharmaster
Copy link
Collaborator

yasharmaster commented Jul 12, 2017

When I try to convert all templates to cypher, some templates are not converted. For example consider the template Gene_transcriptionFactors.

<query name="Gene_transcriptionFactors" model="genomic" view="Gene.primaryIdentifier Gene.symbol Gene.regulatoryRegions.primaryIdentifier Gene.regulatoryRegions.chromosome.primaryIdentifier Gene.regulatoryRegions.chromosomeLocation.end Gene.regulatoryRegions.chromosomeLocation.start Gene.regulatoryRegions.dataSets.dataSource.name Gene.regulatoryRegions.factor.primaryIdentifier Gene.regulatoryRegions.factor.symbol Gene.regulatoryRegions.sequence.residues" longDescription="Show all known transcription factors for a particular D. melanogaster gene. (Data Source: REDfly, FlyBase)." sortOrder="Gene.regulatoryRegions.primaryIdentifier asc" constraintLogic="A and C">
<constraint path="Gene.regulatoryRegions" editable="false" type="TFBindingSite" />
<constraint path="Gene" code="A" editable="true" op="LOOKUP" value="dpp" />
<constraint path="Gene.organism.name" code="C" editable="true" op="=" value="Drosophila melanogaster" />
</query>

It gives following exception,

org.intermine.pathquery.PathException: Unable to resolve path 'Gene.regulatoryRegions.factor.primaryIdentifier': field 'factor' of class 'org.intermine.model.bio.RegulatoryRegion' not found in model 'genomic'
	at org.intermine.pathquery.Path.initialise(Path.java:195)
	at org.intermine.pathquery.Path.<init>(Path.java:102)
	at org.intermine.neo4j.cypher.Helper.getAllPaths(Helper.java:131)
	at org.intermine.neo4j.cypher.tree.PathTree.<init>(PathTree.java:25)
	at org.intermine.neo4j.cypher.QueryGenerator.pathQueryToCypher(QueryGenerator.java:48)
	at TemplateParser.main(TemplateParser.java:52)

This is because this template contains a Path having factor field right after RegulatoryRegion class, but in preview-genomic_model-neo4j.xml, RegulatoryRegion does not have any field called factor. Same is the case for some other classes and their fields.

So we need to update preview-genomic_model-neo4j.xml to reflect all the FlyMine classes and their fields, so as to be able to convert all sorts of PathQueries.
@sammyjava @danielabutano @vivekkrish

@sammyjava
Copy link
Member

Seems you're using templates from a different FlyMine than http://intermine.modencode.org/preview (currently down, and I've asked Daniela whether I should host it here so it stays up). In that mine, you have

<class name="RegulatoryRegion" extends="SequenceFeature" is-interface="true">
        <attribute name="evidenceMethod" type="java.lang.String"/>
        <reference name="gene" referenced-type="Gene" reverse-reference="regulatoryRegions"/>
</class>
<class name="SequenceFeature" extends="BioEntity" is-interface="true" neo4j-ignore="true">
        <attribute name="length" type="java.lang.Integer"/>
        <attribute name="cytoLocation" type="java.lang.String"/>
        <attribute name="scoreType" type="java.lang.String"/>
        <attribute name="score" type="java.lang.Double"/>
        <reference name="chromosome" referenced-type="Chromosome" neo4j-ignore="true"/>
        <reference name="chromosomeLocation" referenced-type="Location" neo4j-ignore="true"/>
        <reference name="sequence" referenced-type="Sequence" neo4j-ignore="true"/>
        <reference name="sequenceOntologyTerm" referenced-type="SOTerm" neo4j-relationship="HAS_TERM"/>
        <collection name="childFeatures" referenced-type="SequenceFeature" neo4j-relationship="PARENT_OF"/>
        <collection name="overlappingFeatures" referenced-type="SequenceFeature" neo4j-relationship="OVERLAPS"/>
</class>
<class name="BioEntity" is-interface="true" neo4j-ignore="true">
        <attribute name="secondaryIdentifier" type="java.lang.String"/>
        <attribute name="symbol" type="java.lang.String"/>
        <attribute name="primaryIdentifier" type="java.lang.String"/>
        <attribute name="name" type="java.lang.String"/>
        <reference name="organism" referenced-type="Organism" neo4j-relationship="PART_OF"/>
        <collection name="synonyms" referenced-type="Synonym" reverse-reference="subject" neo4j-relationship="SYNONYM_OF"/>
        <collection name="publications" referenced-type="Publication" reverse-reference="bioEntities" neo4j-relationship="MENTIONED_IN"/>
        <collection name="ontologyAnnotations" referenced-type="OntologyAnnotation" reverse-reference="subject" neo4j-relationship="ANNOTATED_BY"/>
        <collection name="interactions" referenced-type="Interaction" reverse-reference="participant1" neo4j-relationship="PARTICIPATES_IN"/>
        <collection name="crossReferences" referenced-type="CrossReference" reverse-reference="subject" neo4j-relationship="CROSS_REFERENCED_BY"/>
        <collection name="dataSets" referenced-type="DataSet" reverse-reference="bioEntities" neo4j-ignore="true"/>
        <collection name="locatedFeatures" referenced-type="Location" reverse-reference="locatedOn" neo4j-ignore="true"/>
        <collection name="locations" referenced-type="Location" reverse-reference="feature" neo4j-ignore="true"/>
</class>

But also, there is nothing special or permanent about templates - they're just example queries that are stored. There isn't really any need to convert templates to Cypher, per se, they're just good test cases for you to work with.

@yasharmaster
Copy link
Collaborator Author

yasharmaster commented Jul 12, 2017

Yeah @sammyjava , I downloaded these templates from http://www.flymine.org/ and not from our standard mine http://intermine.modencode.org/preview. I thought that the data model and templates of both FlyMines would be the same but I was wrong. 😅

When http://intermine.modencode.org/preview is up and running, I'll use its templates as test cases instead.

@sammyjava
Copy link
Member

I'm pretty sure mines are like snowflakes: no two are alike. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants