Skip to content
Snippets Groups Projects
Commit 087671d6 authored by barillac's avatar barillac
Browse files

parents of plasmids added

SVN: 34284
parent 2e49358e
No related branches found
No related tags found
No related merge requests found
...@@ -133,16 +133,51 @@ def setEntityProperties(tr, definition, entity, properties): ...@@ -133,16 +133,51 @@ def setEntityProperties(tr, definition, entity, properties):
def setEntityParents(tr, definition, entity, properties): def setEntityParents(tr, definition, entity, properties):
for propertyCode, propertyValue in properties.iteritems(): for propertyCode, propertyValue in properties.iteritems():
propertyDefinition = definitions.getPropertyDefinitionByCode(definition, propertyCode) propertyDefinition = definitions.getPropertyDefinitionByCode(definition, propertyCode)
if propertyValue is not None: if propertyValue is not None and propertyDefinition[0] == "PCR_3_OLIGO" or propertyDefinition[0] == "PCR_5_OLIGO":
propertyValue = unicode(propertyValue) propertyValue = unicode(propertyValue)
print "PROP_PARENTS", propertyDefinition[0], propertyValue
if re.match ("UC# ", propertyValue) and not re.search("/", propertyValue):
parentCode = "/MATERIALS/"+ propertyValue.replace("UC# ", "US").strip(" ")
currentParentsList = entity.getParentSampleIdentifiers()
currentParentsList.add(parentCode)
entity.setParentSampleIdentifiers(currentParentsList)
elif re.match ("UC#", propertyValue) and not re.search("/", propertyValue):
parentCode= "/MATERIALS/"+ propertyValue.replace("UC#", "US").strip(" ")
currentParentsList = entity.getParentSampleIdentifiers()
currentParentsList.add(parentCode)
entity.setParentSampleIdentifiers(currentParentsList)
elif re.match ("UC #", propertyValue) and not re.search("/", propertyValue):
parentCode= "/MATERIALS/"+ propertyValue.replace("UC #", "US").strip(" ")
currentParentsList = entity.getParentSampleIdentifiers()
currentParentsList.add(parentCode)
entity.setParentSampleIdentifiers(currentParentsList)
elif re.match ("UC ", propertyValue) and not re.search("/", propertyValue):
parentCode="/MATERIALS/"+ propertyValue.replace("UC ", "US").strip(" ")
currentParentsList = entity.getParentSampleIdentifiers()
currentParentsList.add(parentCode)
entity.setParentSampleIdentifiers(currentParentsList)
elif re.match ("UC", propertyValue) and not re.search("/", propertyValue):
parentCode= "/MATERIALS/"+ propertyValue.replace("UC", "US").strip(" ")
currentParentsList = entity.getParentSampleIdentifiers()
currentParentsList.add(parentCode)
entity.setParentSampleIdentifiers(currentParentsList)
elif re.match ("CH", propertyValue):
parentCode="/MATERIALS/"+ propertyValue.strip(" ")
currentParentsList = entity.getParentSampleIdentifiers()
currentParentsList.add(parentCode)
entity.setParentSampleIdentifiers(currentParentsList)
else:
print "NO PARENT WAS SET FOR THIS FOUND VALUE:", propertyValue
# elif propertyDefinition[0] == "INSERT":
# if re.match()
#entity.setParentSampleIdentifiers()
if propertyDefinition[0] == "PCR_3_OLIGO":
if re.match ("UC", propertyValue):
print propertyDefinition[0], propertyValue
propertyValue= str.replace("UC", "US", propertyValue)
print propertyDefinition[0], propertyValue
#entity.setParentSampleIdentifiers()
## ##
## Generic Pattern ## Generic Pattern
## ##
...@@ -207,7 +242,7 @@ def getExperimentForUpdate(experimentIdentifier, experimentType, tr): ...@@ -207,7 +242,7 @@ def getExperimentForUpdate(experimentIdentifier, experimentType, tr):
experimentCache[experimentIdentifier] = experiment experimentCache[experimentIdentifier] = experiment
else: else:
pass pass
print "Cache hit " + experimentIdentifier + ":" + str(experimentType) #print "Cache hit " + experimentIdentifier + ":" + str(experimentType)
if experimentIdentifier not in experimentCache: if experimentIdentifier not in experimentCache:
return None return None
else: else:
...@@ -485,14 +520,15 @@ class PlasmidAdaptor(FileMakerEntityAdaptor): ...@@ -485,14 +520,15 @@ class PlasmidAdaptor(FileMakerEntityAdaptor):
class PlasmidOpenBISDTO(FMPeterOpenBISDTO): class PlasmidOpenBISDTO(FMPeterOpenBISDTO):
def write(self, tr): def write(self, tr):
code = self.values["NAME"] code = "PKW" + self.values["NAME"]
if code is not None: if code is not None:
sample = getSampleForUpdate("/MATERIALS/"+code,"PLASMID", tr) sample = getSampleForUpdate("/MATERIALS/"+code,"PLASMID", tr)
setEntityProperties(tr, self.definition, sample, self.values); setEntityProperties(tr, self.definition, sample, self.values)
setEntityParents(tr, self.definition, sample, self.values) setEntityParents(tr, self.definition, sample, self.values)
print "SETPARENTS", setEntityParents(tr, self.definition, sample, self.values)
def getIdentifier(self, tr): def getIdentifier(self, tr):
code = self.values["NAME"] code = "PKW" +self.values["NAME"]
return code return code
...@@ -604,7 +640,7 @@ fmPass = "nucleus" ...@@ -604,7 +640,7 @@ 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"), #OligoAdaptor(fmConnString, fmUser, fmPass, "Weis_Oligos"),
#AntibodyAdaptor(fmConnString, fmUser, fmPass, "Weis _Antibodies") #AntibodyAdaptor(fmConnString, fmUser, fmPass, "Weis _Antibodies")
PlasmidAdaptor(fmConnString, fmUser, fmPass, "Weis_Plasmids") PlasmidAdaptor(fmConnString, fmUser, fmPass, "Weis_Plasmids")
] ]
......
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