|
1 | 1 | # Project, Institution, Workgroup |
2 | | -project = Project.where(title: 'Default Project').first_or_create |
| 2 | +program = Programme.where(title: 'Default Programme').first_or_create(web_page: 'http://www.seek4science.org', funding_details: 'Funding H2020X01Y001', description: 'This is a test programme for the SEEK sandbox.') |
| 3 | +project = Project.where(title: 'Default Project').first_or_create(:programme_id => program.id) # TODO this link is not working |
3 | 4 | institution = Institution.where(title: 'Default Institution').first_or_create(country: 'United Kingdom') |
4 | 5 | workgroup = WorkGroup.where(project_id: project.id, institution_id: institution.id).first_or_create |
5 | 6 |
|
|
35 | 36 | investigation = Investigation.new(title: 'Central Carbon Metabolism of Sulfolobus solfataricus', |
36 | 37 | description: 'An investigation in the CCM of S. solfataricus with a focus on the unique temperature adaptations and regulation; using a combined modelling and experimental approach.') |
37 | 38 | investigation.projects = [project] |
38 | | -investigation.contributor = guest_user |
| 39 | +investigation.contributor = guest_person |
39 | 40 | investigation.policy = Policy.create(name: 'default policy', access_type: 1) |
40 | 41 | investigation.save |
41 | 42 | puts 'Seeded 1 investigation.' |
42 | 43 |
|
43 | 44 | study = Study.new(title: 'Carbon loss at high T') |
44 | | -study.contributor = guest_user |
| 45 | +study.contributor = guest_person |
45 | 46 | study.policy = Policy.create(name: 'default policy', access_type: 1) |
46 | 47 | study.investigation = investigation |
47 | 48 | study.save |
48 | 49 | puts 'Seeded 1 study.' |
49 | 50 |
|
| 51 | +## Observation unit |
| 52 | +observation_unit = ObservationUnit.new(title: 'Large scale bioreactor') |
| 53 | +observation_unit.contributor = guest_person |
| 54 | +observation_unit.policy = Policy.create(name: 'default policy', access_type: 1) |
| 55 | +observation_unit.study = study |
| 56 | +disable_authorization_checks { observation_unit.save } |
| 57 | +puts 'Seeded 1 observation unit' |
| 58 | + |
| 59 | +## Assays ## |
| 60 | + |
| 61 | +## Experimental assay? |
50 | 62 | exp_assay = Assay.new(title: 'Reconstituted system reference state', |
51 | 63 | description: 'The four purified enzymes were incubated in assay buffer and consumption of 3PG and production of F6P were measured in time, together with GAP and DHAP concentrations.') |
52 | 64 | exp_assay.contributor = guest_person |
53 | 65 | exp_assay.policy = Policy.create(name: 'default policy', access_type: 1) |
54 | 66 | exp_assay.study = study |
55 | | -exp_assay.assay_class = AssayClass.first |
| 67 | +exp_assay.assay_class = AssayClass.experimental |
56 | 68 | exp_assay.save |
57 | | -puts 'Seeded 1 experimental assay.' |
| 69 | +puts "exp_assay: Seeded 1 #{exp_assay.assay_class.long_key.downcase}." |
58 | 70 |
|
| 71 | +# Modeling assay? |
59 | 72 | model_assay = Assay.new(title: 'Model reconstituted system', |
60 | 73 | description: 'Mathematical model for the reconstituted system with PGK, GAPDH, TPI and FBPAase.') |
61 | 74 | model_assay.contributor = guest_person |
62 | 75 | model_assay.policy = Policy.create(name: 'default policy', access_type: 1) |
63 | 76 | model_assay.study = study |
64 | | -model_assay.assay_class = AssayClass.last |
| 77 | +model_assay.assay_class = AssayClass.modelling |
65 | 78 | model_assay.save |
66 | | -puts 'Seeded 1 modelling analysis.' |
| 79 | +puts "Seeded 1 #{model_assay.assay_class.long_key.downcase}." |
67 | 80 |
|
| 81 | +# Assay stream |
| 82 | +assay_stream = Assay.new(title: 'Assay stream', |
| 83 | + description: 'A stream of assays? This is a test assay stream for the example data.',) |
| 84 | +assay_stream.contributor = guest_person |
| 85 | +assay_stream.policy = Policy.create(name: 'default policy', access_type: 1) |
| 86 | +assay_stream.study = study |
| 87 | +assay_stream.assay_class = AssayClass.assay_stream |
| 88 | +assay_stream.save |
| 89 | +puts "Seeded 1 assay stream #{model_assay.assay_class.long_key.downcase}." |
| 90 | +# |
| 91 | +####### |
68 | 92 | # Assets |
69 | 93 | # TODO check filesize |
70 | 94 | data_file1 = DataFile.new(title: 'Metabolite concentrations during reconstituted enzyme incubation', |
71 | 95 | description: 'The purified enzymes, PGK, GAPDH, TPI and FBPAase were incubated at 70 C en conversion of 3PG to F6P was followed.') |
72 | | -data_file1.contributor = guest_user |
| 96 | +data_file1.contributor = guest_person |
73 | 97 | data_file1.projects = [project] |
74 | 98 | relationship = RelationshipType.where(title: 'Validation data').first |
75 | 99 | data_file1.policy = Policy.create(name: 'default policy', access_type: 1) |
|
88 | 112 |
|
89 | 113 | data_file2 = DataFile.new(title: 'Model simulation and Exp data for reconstituted system', |
90 | 114 | description: 'Experimental data for the reconstituted system are plotted together with the model prediction.') |
91 | | -data_file2.contributor = guest_user |
| 115 | +data_file2.contributor = guest_person |
92 | 116 | data_file2.projects = [project] |
93 | 117 | data_file2.policy = Policy.create(name: 'default policy', access_type: 1) |
94 | 118 | data_file2.content_blob = ContentBlob.new(original_filename: 'combinedPlot.jpg', |
|
109 | 133 | model = Model.new(title: 'Mathematical model for the combined four enzyme system', |
110 | 134 | description: 'The PGK, GAPDH, TPI and FBPAase were modelled together using the individual rate equations. Closed system.') |
111 | 135 | model.model_format = ModelFormat.find_by_title('SBML') |
112 | | -model.contributor = guest_user |
| 136 | +model.contributor = guest_person |
113 | 137 | model.projects = [project] |
114 | 138 | model.assays = [model_assay] |
115 | 139 | model.policy = Policy.create(name: 'default policy', access_type: 1) |
|
131 | 155 | content_type: 'text/xml') |
132 | 156 | model.content_blobs = [cb1, cb2, cb3, cb4, cb5, cb6] |
133 | 157 | disable_authorization_checks { model.save } |
134 | | -AssetsCreator.create(asset_id: model.id, creator_id: guest_user.id, asset_type: model.class.name) |
| 158 | +AssetsCreator.create(asset_id: model.id, creator_id: guest_person.id, asset_type: model.class.name) |
135 | 159 | # copy file |
136 | 160 | model.content_blobs.each do |blob| |
137 | 161 | FileUtils.cp File.dirname(__FILE__) + '/' + blob.original_filename, blob.filepath |
|
144 | 168 | sop = Sop.new(title: "Default title", |
145 | 169 | description: "Default description" |
146 | 170 | ) |
147 | | -sop.contributor = guest_user |
| 171 | +sop.contributor = guest_person |
148 | 172 | sop.projects = [project] |
149 | 173 | sop.assays = [exp_assay] |
150 | 174 | sop.policy = Policy.create(name: 'default policy', access_type: 1) |
151 | 175 | sop.content_blob = ContentBlob.new(original_filename: 'test_sop.txt', |
152 | 176 | content_type: 'text' |
153 | 177 | ) |
154 | 178 | disable_authorization_checks {sop.save} |
155 | | -AssetsCreator.create(asset_id: sop.id, creator_id: guest_user.id, asset_type: sop.class.name) |
| 179 | +AssetsCreator.create(asset_id: sop.id, creator_id: guest_person.id, asset_type: sop.class.name) |
156 | 180 | #copy file |
157 | 181 | FileUtils.cp File.dirname(__FILE__) + '/' + sop.content_blob.original_filename, sop.content_blob.filepath |
158 | 182 | puts "Seeded 1 sop." |
159 | 183 | =end |
160 | 184 |
|
161 | 185 | # publication |
162 | | -publication = Publication.new(pubmed_id: '23865479', |
163 | | - title: 'Intermediate instability at high temperature leads to low pathway efficiency for an in vitro reconstituted system of gluconeogenesis in Sulfolobus solfataricus', |
164 | | - abstract: "Four enzymes of the gluconeogenic pathway in Sulfolobus solfataricus were purified and kinetically characterized. The enzymes were reconstituted in vitro to quantify the contribution of temperature instability of the pathway intermediates to carbon loss from the system. |
165 | | - The reconstituted system, consisting of phosphoglycerate kinase, glyceraldehyde 3-phosphate dehydrogenase, triose phosphate isomerase and the fructose 1,6-bisphosphate aldolase/phosphatase, maintained a constant consumption rate of 3-phosphoglycerate and production of |
166 | | - fructose 6-phosphate over a 1-h period. Cofactors ATP and NADPH were regenerated via pyruvate kinase and glucose dehydrogenase. A mathematical model was constructed on the basis of the kinetics of the purified enzymes and the measured half-life times of the pathway intermediates. |
167 | | - The model quantitatively predicted the system fluxes and metabolite concentrations. Relative enzyme concentrations were chosen such that half the carbon in the system was lost due to degradation of the thermolabile intermediates dihydroxyacetone phosphate, glyceraldehyde 3-phosphate |
168 | | - and 1,3-bisphosphoglycerate, indicating that intermediate instability at high temperature can significantly affect pathway efficiency.", |
169 | | - published_date: '2015', |
170 | | - journal: 'FEBS J') |
171 | | - |
172 | | -publication.contributor = guest_user |
173 | | -publication.projects = [project] |
174 | | -publication.policy = Policy.create(name: 'default policy', access_type: 1) |
175 | | -publication_author1 = PublicationAuthor.new(first_name: 'T.', |
176 | | - last_name: 'Kouril', |
177 | | - author_index: 1) |
178 | | -publication_author2 = PublicationAuthor.new(first_name: 'D.', |
179 | | - last_name: 'Esser', |
180 | | - author_index: 1) |
181 | | -publication_author3 = PublicationAuthor.new(first_name: 'J.', |
182 | | - last_name: 'Kort', |
183 | | - author_index: 1) |
184 | | -publication_author4 = PublicationAuthor.new(first_name: 'H. V.', |
185 | | - last_name: 'Westerhoff', |
186 | | - author_index: 1) |
187 | | -publication_author5 = PublicationAuthor.new(first_name: 'B.', |
188 | | - last_name: 'Siebers', |
189 | | - author_index: 1) |
190 | | -publication_author6 = PublicationAuthor.new(first_name: 'J.', |
191 | | - last_name: 'Snoep', |
192 | | - author_index: 1) |
193 | | - |
194 | | -publication.publication_authors = [publication_author1, publication_author2, publication_author3, publication_author4, publication_author5, publication_author6] |
| 186 | +publication = Publication.new( |
| 187 | + publication_type_id: PublicationType.where(title:"Journal").first.id, |
| 188 | + pubmed_id: '23865479', |
| 189 | + title: 'Intermediate instability at high temperature leads to low pathway efficiency for an in vitro reconstituted system of gluconeogenesis in Sulfolobus solfataricus', |
| 190 | + abstract: "Four enzymes of the gluconeogenic pathway in Sulfolobus solfataricus were purified and kinetically characterized. The enzymes were reconstituted in vitro to quantify the contribution of temperature instability of the pathway intermediates to carbon loss from the system. |
| 191 | + The reconstituted system, consisting of phosphoglycerate kinase, glyceraldehyde 3-phosphate dehydrogenase, triose phosphate isomerase and the fructose 1,6-bisphosphate aldolase/phosphatase, maintained a constant consumption rate of 3-phosphoglycerate and production of |
| 192 | + fructose 6-phosphate over a 1-h period. Cofactors ATP and NADPH were regenerated via pyruvate kinase and glucose dehydrogenase. A mathematical model was constructed on the basis of the kinetics of the purified enzymes and the measured half-life times of the pathway intermediates. |
| 193 | + The model quantitatively predicted the system fluxes and metabolite concentrations. Relative enzyme concentrations were chosen such that half the carbon in the system was lost due to degradation of the thermolabile intermediates dihydroxyacetone phosphate, glyceraldehyde 3-phosphate |
| 194 | + and 1,3-bisphosphoglycerate, indicating that intermediate instability at high temperature can significantly affect pathway efficiency.", |
| 195 | + published_date: '2015', |
| 196 | + journal: 'FEBS J' |
| 197 | +) |
| 198 | + |
| 199 | +# Set contributor and projects |
| 200 | +publication.contributor = guest_person |
| 201 | +publication.projects << project |
| 202 | + |
| 203 | +# Build policy through the association |
| 204 | +publication.build_policy(name: 'default policy', access_type: 1) |
| 205 | + |
| 206 | +# Build publication authors |
| 207 | +authors = [ |
| 208 | + { first_name: 'T.', last_name: 'Kouril', author_index: 1 }, |
| 209 | + { first_name: 'D.', last_name: 'Esser', author_index: 2 }, |
| 210 | + { first_name: 'J.', last_name: 'Kort', author_index: 3 }, |
| 211 | + { first_name: 'H. V.', last_name: 'Westerhoff', author_index: 4 }, |
| 212 | + { first_name: 'B.', last_name: 'Siebers', author_index: 5 }, |
| 213 | + { first_name: 'J.', last_name: 'Snoep', author_index: 6 } |
| 214 | +] |
| 215 | + |
| 216 | +authors.each do |author_attrs| |
| 217 | + publication.publication_authors.build(author_attrs) |
| 218 | +end |
| 219 | + |
| 220 | +# Save publication with all associations |
195 | 221 | disable_authorization_checks do |
196 | | - publication.save |
| 222 | + publication.save! # raises an error if something is invalid |
197 | 223 | publication.associate(exp_assay) |
198 | 224 | publication.associate(model_assay) |
199 | 225 | end |
200 | | -AssetsCreator.create(asset_id: publication.id, creator_id: guest_user.id, asset_type: publication.class.name) |
| 226 | + |
| 227 | +# Create asset |
| 228 | +AssetsCreator.create(asset_id: publication.id, creator_id: guest_person.id, asset_type: publication.class.name) |
| 229 | + |
201 | 230 | puts 'Seeded 1 publication.' |
202 | 231 |
|
| 232 | +# Log activity |
203 | 233 | [project, investigation, study, exp_assay, model_assay, data_file1, data_file2, model, publication].each do |item| |
204 | 234 | ActivityLog.create(action: 'create', |
205 | 235 | culprit: guest_user, |
|
213 | 243 | <p style="text-align:center">For more information about SEEK and to see a video, please visit our <a href="http://www.seek4science.org">Website</a>.</p>' |
214 | 244 |
|
215 | 245 | Seek::Config.solr_enabled = true |
| 246 | +Seek::Config.isa_enabled = true |
| 247 | +Seek::Config.observation_units_enabled = true |
216 | 248 | Seek::Config.programmes_enabled = true |
217 | 249 | Seek::Config.programme_user_creation_enabled = true |
218 | 250 | Seek:: Config.noreply_sender = '[email protected]' |
|
0 commit comments