ISA-tools / BioInvIndex

The web application, model, database persistence, services package and web services for the BII. Led by Eamonn Maguire (Uni. of Oxford) & Philippe Rocca-Serra (Uni. of Oxford).
http://www.isa-tools.org
16 stars 13 forks source link

Cannot find our file in any collection... #44

Closed pconesa closed 12 years ago

pconesa commented 12 years ago

Hi Eamonn!

I think I have follow your indications and now we have a MetabolightsIndexer class in the bridge package (in our fork).

To index our "Metabolite asigments file" (a column in an nmr or ms assay) we need to access it. We just need the path, to open it an index it.

I have tried your suggestions:

assay.getXrefs();

and

assay.getAnnotations();

I am printing out to the console the values but this is what I get:

For annotations only one: Annotation { #459011, text: a_firstuploadwithidentifiers_metabolite profiling_mass spectrometry.txt, type: FreeTextTerm{id=13, name='assayFileId', ontologyTerms=[]} }

For xRef 2: xref found: getAcc():MYSQL21_bjpgnOFVfI, getId():327686, suorce:ReferenceSource{id='29' acc='0000366:NULL-ACCESSION:WEB:RAW' name='0000366:NULL-ACCESSION:WEB:RAW', url='', version='null', description='Raw Data Files Repository [metabolite profiling, mass spectrometry]'} xref found: getAcc():MYSQL21_bjpgnOFVfI, getId():327687, suorce:ReferenceSource{id='30' acc='0000366:NULL-ACCESSION:WEB:PROCESSED' name='0000366:NULL-ACCESSION:WEB:PROCESSED', url='', version='null', description='Processed Data Files Repository [metabolite profiling, mass spectrometry]'}

None of them looks like our assignments file....

I could use the MYSQL21_bjpgnOFVfI value (DATA_LOCATION) and look for any file that ends with "_mas.csv", but my problem is that I don't know how to get the complete path....

Any suggestion?

Happy solstice! ;-)

eamonnmag commented 12 years ago

The metabolite file can be accessed via the AssayResult object, contrary to what I initially thought.

This section of code should be executed within the for-each block in the AssayBridge class.

Collection assayResults = ProcessingUtils.findAssayResultsFromAssay(assay);
for (AssayResult result : assayResults) {
    for (Annotation annotation : result.getData().getAnnotation("metaboliteFile")) {
        System.out.printf("Type: %s -> Value: %s\n", annotation.getType().getValue(), annotation.getText());
    }
}