Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
087671d6
Commit
087671d6
authored
9 years ago
by
barillac
Browse files
Options
Downloads
Patches
Plain Diff
parents of plasmids added
SVN: 34284
parent
2e49358e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plasmid/source/core-plugins/weismigration/1/dss/drop-boxes/weismigration/migration.py
+48
-12
48 additions, 12 deletions
...weismigration/1/dss/drop-boxes/weismigration/migration.py
with
48 additions
and
12 deletions
plasmid/source/core-plugins/weismigration/1/dss/drop-boxes/weismigration/migration.py
+
48
−
12
View file @
087671d6
...
@@ -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
"
)
]
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment