[OTDev] Example of a feature creation request.

Nina Jeliazkova jeliazkova.nina at gmail.com
Mon Aug 16 15:21:19 CEST 2010


Surajit,

Sorry, had sent the message incomplete.

On Mon, Aug 16, 2010 at 4:16 PM, Nina Jeliazkova
<jeliazkova.nina at gmail.com> wrote:
> Hi Surajit,
>
> On Mon, Aug 16, 2010 at 2:41 PM, surajit ray <mr.surajit.ray at gmail.com> wrote:
>> Hi Nina,
>>
>> I am trying to upload a generated feature to an Ambit server. Would
>> you have some example class doing this in Java ?
>>
>
>
>> My work flow is
>> a) Accept a compound uri and a dataset uri
>> b) Retrieve compound smiles from compound from uri
>> c) Retrieve dataset from uri
>> d) parse dataset representation to get compound URIs
>> e) get the smiles of all dataset compounds
>> f) run some code ...
>> g) upload a feature of this compound to an Ambit location
>>
>>
>> only step g) remains. Therefore it would be great help if you have an
>> example. The API page on opentox on feature does not provide any
>> examples (link : http://opentox.org/dev/apis/api-1.1/Feature)
>>
>
> The basic procedure is you add the new features into the RDF
> representation of the dataset and POST (or PUT) the updated dataset
> back.
> If in c) you retrieve the dataset in Jena model,  you would need to
> add an instance of ot:Feature to the model and add to data entries
> (ot:DataEntry, think dataset rows) the new feature and its values
> (similar to adding new columns to a table ).
>
> Could you have a look at
> https://ambit.svn.sourceforge.net/svnroot/ambit/branches/opentox/opentox-client/src/test/java/org/opentox/dataset/test/FeatureTest.java
> ?  I think the method OntModel addFeaturesToDataset(String dataset)
> method is what you need.
>
>> also I have a couple of question about datasets etc
>> 1) Datasets contain listings of conformers of compounds. I am assuming
>> that the conformer uri will produce the same Smile representation as
>> the compound uri itself. Is that correct ?
>
> Yes.
>
>> 2) If I have some property like MCSS, I would like to have the same
>> feature for the two compounds being compared. Meaning when compared -
>> Compound A and Compound B should have the same MCSS right ? So I need
>> a feature which belongs to both compounds. Is this possible in the
>> present opentox framework ?
>>
> This is exactly what features are for.  You could define a feature ,
> representing particular MCSS, and assign same value (e.g. TRUE ) to
> compounds, having the same MCSS, and different value (e.g. FALSE)
> otherwise.
>
> A feature by itself is not associated with any compound. The feature
> values association is done via data entries in a dataset, and normally
> it could be done with as many compounds as necessary.
>
> In the example below, the feature feature/21573

The feature http://apps.ideaconsult.net:8080/ambit2/feature/21573  is
a feature, denoting Carcinogenicity in ISSCAN database ;  it has been
assigned values 1 for  compound/44497/conformer/409422  and value 3
for compound/413/conformer/409421  , and values 1 and 3 are assigned
to many more compounds in the dataset as well (here limited to 2
compounds for clarity).



>
> <rdf:RDF
>    xmlns:ac="http://apps.ideaconsult.net:8080/ambit2/compound/"
>    xmlns:ot="http://www.opentox.org/api/1.1#"
> xmlns:af="http://apps.ideaconsult.net:8080/ambit2/feature/"
>  -- prefixes skipped --
>  xml:base="http://apps.ideaconsult.net:8080/ambit2/">
>  <owl:Class rdf:about="http://www.opentox.org/api/1.1#Dataset"/>
>  <owl:Class rdf:about="http://www.opentox.org/api/1.1#Compound"/>
>  <owl:Class rdf:about="http://www.opentox.org/api/1.1#Feature"/>
>  <owl:Class rdf:about="http://www.opentox.org/api/1.1#FeatureValue"/>
>  <owl:Class rdf:about="http://www.opentox.org/api/1.1#NumericFeature">
>    <rdfs:subClassOf rdf:resource="http://www.opentox.org/api/1.1#Feature"/>
>  </owl:Class>
>  <owl:Class rdf:about="http://www.opentox.org/api/1.1#NominalFeature">
>    <rdfs:subClassOf rdf:resource="http://www.opentox.org/api/1.1#Feature"/>
>  </owl:Class>
>  <owl:Class rdf:about="http://www.opentox.org/api/1.1#DataEntry"/>
>  <owl:ObjectProperty rdf:about="http://www.opentox.org/api/1.1#acceptValue"/>
>  <owl:ObjectProperty rdf:about="http://www.opentox.org/api/1.1#dataEntry"/>
>  <owl:ObjectProperty rdf:about="http://www.opentox.org/api/1.1#hasSource"/>
>  <owl:ObjectProperty rdf:about="http://www.opentox.org/api/1.1#values"/>
>  <owl:ObjectProperty rdf:about="http://www.opentox.org/api/1.1#compound"/>
>  <owl:ObjectProperty rdf:about="http://www.opentox.org/api/1.1#feature"/>
>  <owl:DatatypeProperty rdf:about="http://www.opentox.org/api/1.1#units"/>
>  <owl:DatatypeProperty rdf:about="http://www.opentox.org/api/1.1#value"/>
>  <owl:AnnotationProperty rdf:about="http://purl.org/dc/elements/1.1/type"/>
>  <owl:AnnotationProperty rdf:about="http://purl.org/dc/elements/1.1/title"/>
>  <owl:AnnotationProperty
> rdf:about="http://purl.org/dc/elements/1.1/description"/>
>  <ot:Dataset rdf:about="dataset/9">
>    <ot:dataEntry>
>      <ot:DataEntry>
>        <ot:values>
>          <ot:FeatureValue>
>            <ot:value rdf:datatype="http://www.w3.org/2001/XMLSchema#double"
>            >1.0</ot:value>
>            <ot:feature>
>              <ot:Feature rdf:about="feature/21573">
>
> <dc:creator>http://www.epa.gov/NCCT/dsstox/sdf_isscan_external.html</dc:creator>
>
> <ot:hasSource>ISSCAN_v3a_1153_19Sept08.1222179139.sdf</ot:hasSource>
>                <ot:units></ot:units>
>                <owl:sameAs
> rdf:resource="http://www.opentox.org/echaEndpoints.owl#Carcinogenicity"/>
>                <ot:acceptValue>3.0</ot:acceptValue>
>                <rdf:type
> rdf:resource="http://www.opentox.org/api/1.1#NominalFeature"/>
>                <ot:acceptValue>1.0</ot:acceptValue>
>                <rdf:type
> rdf:resource="http://www.opentox.org/api/1.1#NumericFeature"/>
>                <dc:title>Canc</dc:title>
>              </ot:Feature>
>            </ot:feature>
>          </ot:FeatureValue>
>        </ot:values>
>        <ot:compound>
>          <ot:Compound rdf:about="compound/44497/conformer/409422"/>
>        </ot:compound>
>      </ot:DataEntry>
>    </ot:dataEntry>
>    <ot:dataEntry>
>      <ot:DataEntry>
>        <ot:values>
>          <ot:FeatureValue>
>            <ot:value rdf:datatype="http://www.w3.org/2001/XMLSchema#double"
>            >3.0</ot:value>
>            <ot:feature rdf:resource="feature/21573"/>
>          </ot:FeatureValue>
>        </ot:values>
>        <ot:compound>
>          <ot:Compound rdf:about="compound/413/conformer/409421"/>
>        </ot:compound>
>      </ot:DataEntry>
>    </ot:dataEntry>
>  </ot:Dataset>
> </rdf:RDF>
>
>

Hope this helps,

Nina

>> Thanks
>> Surajit
>> _______________________________________________
>> Development mailing list
>> Development at opentox.org
>> http://www.opentox.org/mailman/listinfo/development
>>
>



More information about the Development mailing list