Skip to content
Snippets Groups Projects
Commit 8640341c authored by barillac's avatar barillac
Browse files

small fix

SVN: 34317
parent 2488e568
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,6 @@ def setEntityProperties(tr, definition, entity, properties): ...@@ -81,7 +81,6 @@ def setEntityProperties(tr, definition, entity, properties):
possiblePropertyValue = definitionsVoc.getVocabularyTermCodeForVocabularyAndTermLabel(propertyDefinition[4], propertyValue) possiblePropertyValue = definitionsVoc.getVocabularyTermCodeForVocabularyAndTermLabel(propertyDefinition[4], propertyValue)
if possiblePropertyValue is not None: if possiblePropertyValue is not None:
propertyValue = possiblePropertyValue propertyValue = possiblePropertyValue
print "EXISTING VALUE:", propertyValue
else: else:
print "MISSING VALUE FOR:", propertyValue print "MISSING VALUE FOR:", propertyValue
...@@ -265,17 +264,17 @@ def getSampleForUpdate(sampleIdentifier, sampleType, tr): ...@@ -265,17 +264,17 @@ def getSampleForUpdate(sampleIdentifier, sampleType, tr):
if sample is None and sampleType is not None: if sample is None and sampleType is not None:
#print "Cache Create " + sampleIdentifier + ":" + str(sampleType) #print "Cache Create " + sampleIdentifier + ":" + str(sampleType)
if sampleType == "ANTIBODY": if sampleType == "ANTIBODY":
experiment = getExperimentForUpdate("/MATERIALS/REAGENTS/ANTIBODIES", sampleType, tr) experiment = getExperimentForUpdate("/MATERIALS/REAGENTS/ANTIBODIES", sampleType, tr)
elif sampleType == "STRAIN": elif sampleType == "STRAIN":
experiment = getExperimentForUpdate("/MATERIALS/YEASTS/YEAST_COLLECTION_1", sampleType, tr) experiment = getExperimentForUpdate("/MATERIALS/YEASTS/YEAST_COLLECTION_1", sampleType, tr)
elif sampleType == "PLASMID": elif sampleType == "PLASMID":
experiment = getExperimentForUpdate("/MATERIALS/PLASMIDS/PLASMID_COLLECTION_1", sampleType, tr) experiment = getExperimentForUpdate("/MATERIALS/PLASMIDS/PLASMID_COLLECTION_1", sampleType, tr)
elif sampleType == "CHEMICAL": elif sampleType == "CHEMICAL":
experiment = getExperimentForUpdate("/MATERIALS/REAGENTS/CHEMICALS", sampleType, tr) experiment = getExperimentForUpdate("/MATERIALS/REAGENTS/CHEMICALS", sampleType, tr)
elif sampleType == "RESTRICTION_ENZYME": elif sampleType == "RESTRICTION_ENZYME":
experiment = getExperimentForUpdate("/MATERIALS/REAGENTS/RESTRICTION_ENZYMES", sampleType, tr) experiment = getExperimentForUpdate("/MATERIALS/REAGENTS/RESTRICTION_ENZYMES", sampleType, tr)
elif sampleType == "OLIGO": elif sampleType == "OLIGO":
experiment = getExperimentForUpdate("/MATERIALS/POLYNUCLEOTIDES/OLIGO_COLLECTION_1", sampleType, tr) experiment = getExperimentForUpdate("/MATERIALS/POLYNUCLEOTIDES/OLIGO_COLLECTION_1", sampleType, tr)
sample = tr.createNewSample(sampleIdentifier, sampleType) sample = tr.createNewSample(sampleIdentifier, sampleType)
sample.setExperiment(experiment) sample.setExperiment(experiment)
if sample is not None: if sample is not None:
...@@ -462,14 +461,19 @@ class AntibodyOpenBISDTO(FMPeterOpenBISDTO): ...@@ -462,14 +461,19 @@ class AntibodyOpenBISDTO(FMPeterOpenBISDTO):
return False return False
def write(self, tr): def write(self, tr):
code = "AB_" + self.values["REF_NUM"] if self.values["REF_NUM"] is not None:
if code is not None:
sample = getSampleForUpdate("/MATERIALS/"+code,"ANTIBODY", tr) code = "AB" + self.values["REF_NUM"]
setEntityProperties(tr, self.definition, sample, self.values); if code is not None:
sample = getSampleForUpdate("/MATERIALS/"+code,"ANTIBODY", tr)
setEntityProperties(tr, self.definition, sample, self.values);
else:
print "Sample ", self.values["REF_NUM"], " does not have a REF_NUM"
def getIdentifier(self, tr): def getIdentifier(self, tr):
code = "AB_"+ self.values["REF_NUM"] if self.values["REF_NUM"]:
return code code = "AB"+ self.values["REF_NUM"]
return code
...@@ -493,6 +497,7 @@ class StrainOpenBISDTO(FMPeterOpenBISDTO): ...@@ -493,6 +497,7 @@ class StrainOpenBISDTO(FMPeterOpenBISDTO):
sample = getSampleForUpdate("/MATERIALS/"+code,"STRAIN", tr) sample = getSampleForUpdate("/MATERIALS/"+code,"STRAIN", tr)
setEntityProperties(tr, self.definition, sample, self.values) setEntityProperties(tr, self.definition, sample, self.values)
print setEntityProperties(tr, self.definition, sample, self.values) print setEntityProperties(tr, self.definition, sample, self.values)
def getIdentifier(self, tr): def getIdentifier(self, tr):
code = self.values["NAME"] code = self.values["NAME"]
...@@ -575,13 +580,13 @@ class ChemicalOpenBISDTO(FMPeterOpenBISDTO): ...@@ -575,13 +580,13 @@ class ChemicalOpenBISDTO(FMPeterOpenBISDTO):
return False return False
def write(self, tr): def write(self, tr):
code = "CHEM_" + self.values["ID"] code = "CHEM" + self.values["ID"]
if code is not None: if code is not None:
sample = getSampleForUpdate("/MATERIALS/"+code,"CHEMICAL", tr) sample = getSampleForUpdate("/MATERIALS/"+code,"CHEMICAL", tr)
setEntityProperties(tr, self.definition, sample, self.values); setEntityProperties(tr, self.definition, sample, self.values);
def getIdentifier(self, tr): def getIdentifier(self, tr):
code = "CHEM_" + self.values["ID"] code = "CHEM" + self.values["ID"]
return code return code
## ##
...@@ -601,15 +606,17 @@ class EnzymeOpenBISDTO(FMPeterOpenBISDTO): ...@@ -601,15 +606,17 @@ class EnzymeOpenBISDTO(FMPeterOpenBISDTO):
return False return False
def write(self, tr): def write(self, tr):
code = self.values["NAME"] for i in range(1,45):
code = "RE" + str(i)
if code is not None:
sample = getSampleForUpdate("/MATERIALS/"+code,"RESTRICTION_ENZYME", tr) sample = getSampleForUpdate("/MATERIALS/"+code,"RESTRICTION_ENZYME", tr)
setEntityProperties(tr, self.definition, sample, self.values); setEntityProperties(tr, self.definition, sample, self.values);
def getIdentifier(self, tr): def getIdentifier(self, tr):
code = self.values["NAME"] for i in range(1,45):
return code code = "RE" + str(i)
return code
...@@ -635,13 +642,13 @@ fmPass = "nucleus" ...@@ -635,13 +642,13 @@ fmPass = "nucleus"
adaptors = [ adaptors = [
EnzymeAdaptor(fmConnString, fmUser, fmPass, "Weis_Restriction_enzymes") #EnzymeAdaptor(fmConnString, fmUser, fmPass, "Weis_Restriction_enzymes")
#ChemicalAdaptor(fmConnString, fmUser, fmPass, "Weis_Chemicals") #ChemicalAdaptor(fmConnString, fmUser, fmPass, "Weis_Chemicals")
#OligoAdaptor(fmConnString, fmUser, fmPass, "Weis_Oligos"),
#AntibodyAdaptor(fmConnString, fmUser, fmPass, "Weis _Antibodies") #AntibodyAdaptor(fmConnString, fmUser, fmPass, "Weis _Antibodies")
#OligoAdaptor(fmConnString, fmUser, fmPass, "Weis_Oligos"),
#PlasmidAdaptor(fmConnString, fmUser, fmPass, "Weis_Plasmids") #PlasmidAdaptor(fmConnString, fmUser, fmPass, "Weis_Plasmids")
#StrainAdaptor(fmConnString, fmUser, fmPass, "Weis_Yeast_Strains"), StrainAdaptor(fmConnString, fmUser, fmPass, "Weis_Yeast_Strains"),
#StrainMultipleValuesAdaptor(fmConnString, fmUser, fmPass, "Weis_Yeast_Strains") StrainMultipleValuesAdaptor(fmConnString, fmUser, fmPass, "Weis_Yeast_Strains")
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment