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
8640341c
Commit
8640341c
authored
9 years ago
by
barillac
Browse files
Options
Downloads
Patches
Plain Diff
small fix
SVN: 34317
parent
2488e568
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
+30
-23
30 additions, 23 deletions
...weismigration/1/dss/drop-boxes/weismigration/migration.py
with
30 additions
and
23 deletions
plasmid/source/core-plugins/weismigration/1/dss/drop-boxes/weismigration/migration.py
+
30
−
23
View file @
8640341c
...
@@ -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
"
)
]
]
...
...
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