-
Notifications
You must be signed in to change notification settings - Fork 0
Directly cut and paste able REST examples on imits staging system
To find a list of MiPlans with the BaSH consortium.
curl \
--basic --user bcm_robot@bcm.ac.uk:password \
-X GET \
'https://www.i-dcc.org/staging/imits/mi_plans.json?consortium_name_eq=BaSH'
This will return up to 20 records, you can return a greater number of records by adding 'per_page=40' to your query. You can then return page 2 by using 'page=2'. See example below.
curl \
--basic --user bcm_robot@bcm.ac.uk:password \
-X GET \
'https://www.i-dcc.org/staging/imits/mi_plans.json?consortium_name_eq=BaSH&per_page=40&page=2'
If you want to find an MiPlan on a gene (in this case Atp6v0b) and a the consortium BaSH you can use the following command.
curl \
--basic --user bcm_robot@bcm.ac.uk:password \
-X GET \
'https://www.i-dcc.org/staging/imits/mi_plans.json?consortium_name_eq=BaSH&marker_symbol_eq=Atp6v0b'
Use the following to set EsCell Qc Progress on a Plan.
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X PUT \
-H 'Content-Type: application/json' --data-binary \
'{"mi_plan" : {"number_of_es_cells_starting_qc": 3}}' \
'https://www.i-dcc.org/staging/imits/mi_plans/11786.json'
In order to create an MiAttempt you will need the ID of the MiPlan that you wish to create Microinjections on. This is a new requirement, and we no longer accept loose assignments by Consortium name and Production Centre name.
This request is the same as the above example, for requesting a gene however we're now searching explicitly by consortium name and production centre (in the same manner as you would have been when creating an Mi previously).
curl \
--basic --user bcm_robot@bcm.ac.uk:password \
-X GET \
'https://www.i-dcc.org/staging/imits/mi_plans.json?consortium_name_eq=BaSH&production_centre_name_eq=BCM'
You will receive an array of MiPlans in response to this. In the above instance as of writing there are more than 20 results, however it will be limited to 20 unless you explicitly request more. An example of a response with a single MiPlan is displayed below;
[
{
"comment":null,
"completion_note":null,
"id":8652,
"is_active":true,
"is_bespoke_allele":false,
"is_conditional_allele":false,
"is_cre_bac_allele":false,
"is_cre_knock_in_allele":false,
"is_deletion_allele":false,
"number_of_es_cells_passing_qc":2,
"number_of_es_cells_starting_qc":2,
"phenotype_only":false,
"recovery":null,
"withdrawn":false,
"status_name":"Assigned - ES Cell QC Complete",
"status_dates":{
"Interest":"2012-05-02",
"Assigned":"2012-05-31",
"Assigned - ES Cell QC In Progress":"2012-08-08",
"Assigned - ES Cell QC Complete":"2012-12-03"
},
"mgi_accession_id":"MGI:1913300",
"mi_attempts_count":1,
"phenotype_attempts_count":0,
"marker_symbol":"0610009B22Rik",
"consortium_name":"BaSH",
"production_centre_name":"BCM",
"priority_name":"Medium",
"sub_project_name":"",
"es_qc_comment_name":null
}
]
The field you want to take note of is the id of this MiPlan. Which in this case is 8652. Be sure to take into account that this is an array, and the first element you receive is not necessarily the one you want. You may also want to request an MiPlan based on one of the following;
- The es cell clone you have in your hand will be useful for finding the correct plan, you can use the parameter es_cell_name_eq and pass in a cell name for example 'HEPD0734_2_D04' and it will find all the plans for the gene that this clone belongs to.
- The gene using the marker_symbol_eq or mgi_accession_id_eq parameters.
- The MiPlans status using status_name_eq (You can use names of statuses with this parameter e.g. 'Interest' or 'Inactive').
- The priority of the MiPlan using priority_name_eq.
- The sub project of the MiPlan using sub_project_name_eq.
- Whether the MiPlan is 'active' using is_active_eq with the values 'true' or 'false'.
- If you are creating an MiAttempt certainly as useful parameter would be phenotype_only_eq (and make it false). If you accidentally attempt to create an MiAttempt on a phenotype_only plan you will receive a validation error.
Creating MIs via REST, (optional) part 2 create a new MiPlan as there isn't one currently for the es_cell you're injecting
In the example above we got back an MiPlan for the correct Consortium & Production Centre. However this will not always be the case. Tarmits (formally iMits) no longer automatically creates an MiPlan for you when you create an MiAttempt. You must do this yourself, and then record the id of the MiPlan for creating your MiAttempt.
An MiPlan must include a marker_symbol (or gene_id), a consortium_name (or consortium_id), and a priority_name (or priority_id).
An example request would be
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X POST \
-H 'Content-Type:application/json' --data-binary \
'{"mi_plan": {"marker_symbol": "Cbx1", "priority_name": "High",
"consortium_name": "BaSH"}}' \
'https://www.i-dcc.org/staging/imits/mi_plans.json'
You could also add a production_centre_name to this request, or it will be added when you create your MiAttempt.
If there is already an MiPlan with BaSH without a production_centre_name then you will not be able to create an MiPlan without a production_centre_name (although in this particular case, it's unlikely as you were previously unable to find one.)
You should receive a JSON payload with your new MiPlan in response. Record the id from this response to use in creating your new MiAttempt.
Warning as you may have read in the previous section, the creation of an MiAttempt has changed significantly. You now must supply an mi_plan_id when creating an attempt. Passing in consortium_name and production_centre_name no longer has any affect.
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X POST \
-H 'Content-Type:application/json' --data-binary \
'{"mi_attempt": {"es_cell_name": "HEPD0734_2_D04", "mi_plan_id": 8652,
"colony_name": "ZABC1", "mi_date": "2011-08-01",
"total_blasts_injected": 25, "comments": "0610009B22Rik"}}' \
'https://www.i-dcc.org/staging/imits/mi_attempts.json'
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X GET \
'https://www.i-dcc.org/staging/imits/mi_attempts.json?colony_name_eq=ZABC1'
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password \
-X PUT -H 'Content-Type: application/json' --data-binary \
'{ "mi_attempt": {"total_male_chimeras": 10} }' \
'https://www.i-dcc.org/staging/imits/mi_attempts/8467.json'
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X GET \
'https://www.i-dcc.org/staging/imits/mi_attempts.json?colony_name_eq=ZABC1'
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X PUT \
-H 'Content-Type: application/json' --data-binary \
'{ "mi_attempt": { "number_of_het_offspring": 10, "distribution_centres_attributes": [{ "is_distributed_by_emma": true, "centre_name": "Harwell", "deposited_material_name": "Live mice"}]}}' \
'https://www.i-dcc.org/staging/imits/mi_attempts/8467.json'
To Create Mi made using Mutagenesis Factors (Crispr/Cas9) you must leave the es_cell attribute blank and add a new attribute called mutagenesis_factor_attributes. This attribute looks like this:
mutagenesis_factor_attributes: {vector_name: (name of a vector/oligos in Targ Rep),
crisprs_attributes: [{sequence: (23 base pair sequence),
start: (start co-ordinates of crispr),
end: (end co-ordinates of crispr),
chr:(chromosome crispr is on)}]
}
Creating mi with Mutagenesis Factor
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X POST \
-H 'Content-Type:application/json' --data-binary \
'{"mi_attempt": {"mi_plan_id": 8652, "colony_name": "ZABC1", "mi_date": "2011-08-01", "mutagenesis_factor_attributes":{"crisprs_attributes":[{"sequence":"AAAAAAACCCCGGGGTTTGTACG", "chr":"11", "start":703823, "end":703846}]}}}' \
'https://www.i-dcc.org/staging/imits/mi_attempts.json'
Once created it is not possible to edit the Mutagenesis Factor, but you can update all of the other attributes on the mi_attempt as normal.
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X POST -H 'Content-Type: application/json' --data-binary \
'{"phenotype_attempt": {"mi_attempt_colony_name": "P2RX4 <EPD0850_1_E11>"}}' \
'https://www.i-dcc.org/staging/imits/phenotype_attempts.json'
This will automatically assign a default colony_name to the new phenotype_attempt. You can specify this field by passing in a colony_name parameter.
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X POST \
-H 'Content-Type: application/json' --data-binary \
'{"phenotype_attempt": {"mi_attempt_colony_name": "P2RX4 <EPD0850_1_E11>", "colony_name" : "ZABC14"}}' \
'https://www.i-dcc.org/staging/imits/phenotype_attempts.json'
The above 2 examples will assign the phenotype_attempt to the same mi_plan as the mi_attempt
You can assign the phenotype to a different mi_plan by passing in the mi_plan_id parameter.
First find the mi_plan
Note! this must be a phenotype_only plan.
curl --globoff --basic --user wtsi_robot@wtsi.ac.uk:password -X GET \
'https://www.i-dcc.org/staging/imits/mi_plans.json?marker_symbol_eq=Ccdc127&consortium_name_eq=BaSH&production_centre_name_eq=WTSI&phenotype_only_true=true'
extract the mi_plan id and include as a parameter to the phenotype_attempt hash.
curl --globoff --basic --user wtsi_robot@wtsi.ac.uk:password -X POST -H 'Content-Type: application/json' --data-binary \
'{"phenotype_attempt": {"mi_attempt_colony_name": "MFRV", "mi_plan_id" : "9064"}}' \
'https://www.i-dcc.org/staging/imits/phenotype_attempts.json'
find the phenotype attempt using colony_name.
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X GET 'https://www.i-dcc.org/staging/imits/phenotype_attempts.json?colony_name_eq=MFRV-1'
Extract phenotype attempt id and insert into url. Add phenotype attempt hash containing the fields you want to update.
eq. updating 'colony background strain'
curl --globoff --basic --user wtsi_robot@wtsi.ac.uk:password -X PUT -H 'Content-Type: application/json' --data-binary /
'{"phenotype_attempt": {"colony_background_strain_name" : "C57BL6/6NHsd"}}' /
'https://www.i-dcc.org/staging/imits/phenotype_attempts/1164.json'
If cre exision is not require you must set cre_excision_required: to false.
Creating a phenotpye attempt
curl --globoff --basic --user wtsi_robot@wtsi.ac.uk:password -X POST -H 'Content-Type: application/json' --data-binary \
'{"phenotype_attempt": {"mi_attempt_colony_name": "MFRV", "mi_plan_id" : "9064", "cre_excision_required" : "false"}}' \
'https://www.i-dcc.org/staging/imits/phenotype_attempts.json'
Updating a phenotpye attempt
curl --globoff --basic --user wtsi_robot@wtsi.ac.uk:password -X PUT -H 'Content-Type: application/json' --data-binary \
'{"phenotype_attempt": {"cre_excision_required" : "false"}}' \
'https://www.i-dcc.org/staging/imits/phenotype_attempts/1164.json'
This will allow the phenotype attempt to skip this requirement and will be assigned 'phenotype started' status
The following fields should not be filled in;
- deleter_strain_name
- number_of_cre_matings_successful
- mouse_allele_type
To find a list of es_cells for a specific gene, use marker_symbol or mgi_accession_id
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X GET 'http://www.i-dcc.org/staging/imits/targ_rep/es_cells.json?allele_gene_marker_symbol_eq=Scly'
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X GET 'https://www.i-dcc.org/staging/imits/targ_rep/es_cells.json?allele_gene_mgi_accession_id_eq=MGI:1355310'
To find a specific es_cell use name
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X GET 'https://www.i-dcc.org/staging/imits/targ_rep/es_cells.json?name_eq=EPD0044_6_G06'
####To create the distribution_qc associated with an es_cell. Data fields that can be updated
- five_prime_sr_pcr
- three_prime_sr_pcr
- karyotype_low
- karyotype_high
- copy_number
- five_prime_lr_pcr
- three_prime_lr_pcr
- thawing
- loa
- loxp
- loxp_srpcr
- lacz
- chr1
- chr8a
- chr8b
- chr11a
- chr11b
- chry
- es_cell_distribution_centre_id
- unspecified_repository_testing
Find the es_cell using it's name (shown above).
Extract the es_cell's id and input into the url also add your distribution_qc data to the "distribution_qcs_attributes" list.
Note! When creating distribution_qc
- DO NOT add distribution_qc_id
- You must supply an es_cell_distribution_centre_name (Which is currently one of 'WTSI', 'KOMP', 'EUCOMM')
- Their can only be one set of distribution_qc data for each centre.
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X PUT \
-H 'Content-Type:application/json' --data-binary \
'{"targ_rep_es_cell": { "distribution_qcs_attributes": [{ "three_prime_sr_pcr": "pass", "karyotype_low": 0.81, "karyotype_high": 0.9, "five_prime_lr_pcr": "pass", "es_cell_distribution_centre_name": "WTSI"}] }}' \
'https://www.i-dcc.org/staging/imits/targ_rep/es_cells/4931.json'
####To update distribution_qc data
Find the es_cell using the es_cell_id
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X GET 'https://www.i-dcc.org/staging/imits/targ_rep/es_cells/4931.json'
Extract the "distribution_qcs" id, you want to update and input it into the "distribution_qcs_attributes" list along with the fields you want to update.
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X PUT \
-H 'Content-Type:application/json' --data-binary \
'{"targ_rep_es_cell": { "distribution_qcs_attributes": [{ "id": 256, "karyotype_low": 0.60}] }}' \
'https://www.i-dcc.org/staging/imits/targ_rep/es_cells/4931.json'
####To update user_qc data associated with an Es Cell
Data fields that can be updated
- user_qc_map_test
- user_qc_karyotype
- user_qc_tv_backbone_assay
- user_qc_loxp_confirmation
- user_qc_southern_blot
- user_qc_loss_of_wt_allele
- user_qc_neo_count_qpcr
- user_qc_lacz_sr_pcr
- user_qc_mutant_specific_sr_pcr
- user_qc_five_prime_cassette_integrity
- user_qc_neo_sr_pcr
- user_qc_five_prime_lr_pcr
- user_qc_three_prime_lr_pcr
- user_qc_comment
Find the es_cell using it's name (shown above).
Extract the es_cell's id and input into the url also add your user_qc data to the "targ_rep_es_cell" hash.
curl --globoff --basic --user bcm_robot@bcm.ac.uk:password -X PUT \
-H 'Content-Type:application/json' --data-binary \
'{ targ_rep_es_cell : {"user_qc_karyotype" : "pass" }}' \
'https://www.i-dcc.org/staging/imits/targ_rep/es_cells/4931.json'
curl --user bcm_robot@bcm.ac.uk:password \
-d "contact[email]=fred@somewhere.ac.uk" \
-d "gene[mgi_accession_id]=MGI:105369" \
-d "contact[immediate]=true" \
https://www.i-dcc.org/staging/imits/notifications.json
curl --user bcm_robot@bcm.ac.uk:password \
-d "contact[email]=fred@somewhere.ac.uk" \
-d "gene[mgi_accession_id]=MGI:105369" \
https://www.i-dcc.org/staging/imits/notifications.json
curl --user bcm_robot@bcm.ac.uk:password -X DELETE \
-d "contact[email]=fred@sanger.ac.uk" \
-d "gene[mgi_accession_id]=MGI:105369" \
https://www.i-dcc.org/staging/imits/notifications.json