[InterMine Dev] Adding SNP Location

Richard Smith richard at flymine.org
Tue Aug 18 16:57:56 BST 2009


You don't need to add the Location class, it is already in the model.

SNP should just have a reference called 'chromosomeLocation' that
points to the Location class, i.e.

   <reference name="chromosomeLocation" referenced-type="Location"/>

But this is already defined in the data model.

SNP doesn't need another reference called 'location', the original
error you got was because this is what you set in the perl code but it
didn't exist in the merged model.  In the perl code you should change:

   $snp_item->set('location', $location_item);

To:

   $snp_item->set('chromosomeLocation', $location_item);


I hope this is clear we may be talking at cross purposes :)


Richard.



Vallejos, Andrew wrote:
> I have not added a Location object to the additions file.  I assumed
> that the location object was inherited. 
> 
> -----Original Message-----
> From: Richard Smith [mailto:richard at flymine.org] 
> Sent: Tuesday, August 18, 2009 10:09 AM
> To: Vallejos, Andrew
> Cc: Julie Sullivan; dev at intermine.org
> Subject: Re: [InterMine Dev] Adding SNP Location
> 
> Hmmm, so it looks like the location reference hasn't made it to the
> merged model.  If you change _additions.xml files the changes don't
> take effect until you do an 'ant clean build-db' in the dbmodel
> directory.  I think that explains the error.
> 
> I should have pointed out before that you could remove chromosomeStart
> and chromosomeEnd from SNP now the coordinates are moved to the
> Location class.
> 
> Cheers,
> Richard.
> 
> 
> 
> Vallejos, Andrew wrote:
>>   <class name="SNP" extends="PointMutation" is-interface="true">
>>     <attribute name="chromosomeStart" type="java.lang.String"/>
>>     <attribute name="allele2" type="java.lang.String"/>
>>     <attribute name="snp" type="java.lang.String"/>
>>     <attribute name="allele1" type="java.lang.String"/>
>>     <attribute name="chromosomeEnd" type="java.lang.String"/>
>>     <collection name="consequenceTypes"
>> referenced-type="ConsequenceType"/>
>>     <collection name="validations" referenced-type="ValidationState"/>
>>     <collection name="sources" referenced-type="Source"/>
>>   </class>
>>
>> -----Original Message-----
>> From: Richard Smith [mailto:richard at flymine.org] 
>> Sent: Tuesday, August 18, 2009 8:59 AM
>> To: Vallejos, Andrew
>> Cc: Julie Sullivan; dev at intermine.org
>> Subject: Re: [InterMine Dev] Adding SNP Location
>>
>> Right, the chromosome reference needs to be removed (as you
> discovered)
>> because the SNP class is merging with SNP from so_additions.xml, which
>> is an extension (via a few classes) of LocatedSequenceFeature.
>>
>> This means it has a chromosome reference and a chromosomeLocation
>> reference.  You should set both of these in the snp source.
>>
>> So the location reference isn't needed but it would be interesting to
>> find out why it is causing an error.  Could you send the definition of
>> the SNP class that appears in the merged model XML, run:
>>
>>    xmllint --format ratmine/dbmodel/build/model/genomic_model.xml
>>
>> Also could you send the result of '\d snp' in the production database.
>>
>> Cheers,
>> Richard.
>>
>>
>>
>>
>> Vallejos, Andrew wrote:
>>> The modified SNP additions file. 
>>>
>>> As you can see I already have a location reference field.  I had to
>>> comment out the chromosome reference because it was causing an error.
>>>
>>> <?xml version="1.0"?>
>>> <classes>
>>>    <class name="SNP" is-interface="true">
>>>      <attribute name="chromosomeStart" type="java.lang.String"/>
>>>      <attribute name="chromosomeEnd" type="java.lang.String"/>
>>>      <attribute name="snp" type="java.lang.String"/>
>>>      <attribute name="allele1" type="java.lang.String"/>
>>>      <attribute name="allele2" type="java.lang.String"/>
>>>  <!--    <reference name="chromosome" referenced-type="Chromosome"/>
>> -->
>>> 		 <reference name="location" referenced-type="Location"
>>> />
>>>      <collection name="validations" referenced-type="ValidationState"
>> />
>>>      <collection name="consequenceTypes"
>>> referenced-type="ConsequenceType"/>
>>>     <collection name="sources" referenced-type="Source"/>
>>>    </class>
>>>
>>>    <class name="ValidationState" is-interface="true">
>>>      <attribute name="state" type="java.lang.String"/>
>>>    </class>
>>>
>>>    <class name="ConsequenceType" is-interface="true">
>>>      <attribute name="type" type="java.lang.String"/>
>>>    </class>
>>>
>>>   <class name="Source" is-interface="true">
>>>      <attribute name="source" type="java.lang.String"/>
>>>    </class>
>>> </classes>
>>>
>>>
>>> -----Original Message-----
>>> From: Julie Sullivan [mailto:julie at flymine.org] 
>>> Sent: Tuesday, August 18, 2009 3:46 AM
>>> To: Vallejos, Andrew
>>> Cc: dev at intermine.org
>>> Subject: Re: [InterMine Dev] Adding SNP Location
>>>
>>> Andrew,
>>>
>>> This looks to be the interesting bit of the stacktrace:
>>>
>>>> Reference not found in model: [interface
>>> org.intermine.model.bio.SNP].location
>>>
>>> You need to add a reference to location in SNP.  To do this, add this
>>> line to 
>>> the SNP entry in your snp_additions.xml file:
>>>
>>>       <reference name="location" referenced-type="Location" />	
>>>
>>> Then run ant clean build-db in ratmine/dbmodel to update the model.
>>> Here is 
>>> some documentation about the additions file:
>>>
>>> 	http://intermine.org/wiki/ModelMerging
>>>
>>>
>>>
>>> _______________________________________________
>>> dev mailing list
>>> dev at mail.intermine.org
>>> http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
>>>
>>
> 
> 




More information about the dev mailing list