Team:UESTC-Software/API.html
From 2014.igem.org
Revision as of 16:21, 15 October 2014 by Tangying0608 (Talk | contribs)
API Documentation
Service API Documentation
1Main functions
1.1Submit a Crisper-X
requestURL: getMain.php
1.2Get result
Get the result given the request id.
URL | getResult.php |
POST | id |
Return | Result in json style,with status=0, 1, 2 means ok, error and not finished respectively. |
Example | POST: id=355Return: {“status”:2,“message”:“not finished yet”} |
1.3Get requests History
Get requests history. Unregistered users will get the global history.
URL | getHistory.php |
POST | token |
Return | Top ten records, ordered by time, in Json array style |
Example | POST: token=005536bf21179e54370c75b6fb136f2aReturn: [{“request id”:“351”,“status”:“0”},{“request id”:“355”,“status”:“2”}] |
See also | Login [ section 2.1 ] |
2User Management
2.1Login
Login(Sign in) using Username and Password. A token will be returned forfuture authentication.
URL | login/ |
POST | name(username), pswd(password) |
Return | 32 byte token when login succeed, or ’-’ otherwise. |
Example | POST: name=guest&pswd=1234Return: 005536bf21179e54370c75b6fb136f2a |
2.2Log out
Delete user log information and Log out.
URL | login/logout.php |
POST | token |
Return | Nothing. |
See also | Login [ section 2.1 ] |
2.3Sign Up
Create a new account with username, password and email.
URL | login/signup.php |
POST | name(username, unique),pswd(password, encrypt using md5),email(unique). |
Return | ”Sign In Succeed” or error information. |
2.4Update user’s Information
Update your password and/or email address.
URL | login/signup.php |
POST | name(username),pswd(old password),newpswd(new password *),newemail(new email *),* Not necessary |
Return | ’+’: ok, ’-’: failed. |
3File/Specie Upload
3.1Check upload
Check if this token can upload files
URL | upload/check.php |
POST | status=0(Yes)/1(No) and message if status=1 in JSON. |
Return | ’+’: ok, ’-’: failed. |
Example | {”status”:1, ”message”:”Authentication failed”} |
3.2Upload file
Upload your file.
URL | upload/ |
POST | token, filename(no longer than 255),note(no longer than 1000), file |
Return | A(Upload succeed) or N(Something goes wrong) |
3.3Import
Import data from file(s).
URL | upload/import.php |
POST | token, command(in json, see section3.7) |
Return | New specie Name(start with number), or ’N’ for ’Something goes wrong’ |
3.4Viewmyfiles
View all my files.
URL | upload/viewmyfiles.php |
POST | token |
Return | All my files in JSON Array Style |
Example | [{”fileName”:”NC 001133-chromosome1”,”note”:”Saccharomycetes’s chromosome”}] |
3.5Viewmyspecies
View all my species.
URL | upload/viewmyspecies.php |
POST | token |
Return | All my species in JSON Array Style |
Example | [ {”specie”:”Saccharomyces-cerevisiae”, ”PAMs”:[{”PAM”:”NGG”},{”PAM”:”NRG”}], ”chromosomes”:[{”chromosome”:”NC 001147-chromosome1”}, {”chromosome”:”NC 001147-chromosome16”} ] |
3.6Deletemyfiles
Delete your file.
URL | upload/deletemyfiles.php |
POST | token, filename |
Return | A(Delete succeed) or N(Something goes wrong) |
3.7json.command.txt
How to write commands in Import(section 3.3) method.
The structure of a command:
{ specie varchar(96) Name of the new Specie. files array All correlative chromosome files(.fna). [ fileName varchar(255) File name ] PAM varchar(20) PAM }
Example:
{”specie”:”testSpecie”,”files”:[{”fileName”:”NC 012971”}],”PAM”:”NGG”}
4josn.txt
4.1Input
type 1 1=Knockout specie E.coil Specie gene thrA Gene Name location Chr2:336..2798 Location pam NGG PAM Sequence [1] r1 0.65 r1, r2=1-r1 length 20 nt length region ”0000” Region filter. 1 for in and 0 for out. EXON,INTRON,UTR,INTERGENIC rfc ”000000” 1 for use and 0 for not. RFC: 10, 12, 12a, 21, 23, 25
4.2Input Example
{ “specie” : “Saccharomyces-cerevisiae”, “location” : “NC 001144-chromosome12:1..500”, “pam” : “NGG”, “rfc” : “100101” }
4.3Output
status 0 Request Status. (0: ok, 1: failed, 2: still running) message no args Return message specie E.coil Specie gene thrA Gene name location Chr2:336..2798 Location region array[] Selected sequence information { endpoint 1807 Region end point description intergenic Region information } result array[] Top 50 Only { grna TC. . . CGG(20) sgRNA sequence position Chr2:15413205 Location strand + Which DNA chain (+/-) region exon Region of this sgRNA total score 86 Sguide Sspe 93 Sspe Seff 7 Seff count 2 Nmm offtarget array[] Top 20 Only { osequence CT. . . TGGG(20) possible-offtarget sgRNA sequence oscore 3.5 Smm omms 4 Nmm oposition Chr3:4158 Location of po-sgRNA ostrand + Which DNA chain (+/-) oregion Intergenic Region of this sgRNA } }
4.4Output example when ok:
{ ”status”: 0, ”message”: { ”specie”: ”E.coli”, ”kind”: ”E.coli K12-MG1655”, ”gene”: ””, ”location”: ”1:336..2798” }, ”result”: [{”key”: ”#1”, ”grna”: ”GAAGTTCGGCGGTACATCAGTGG”, ”position”: ”1:368”, ”total score”: 100, ”count”: 0, ”offtarget”: [] }, { ”key”: ”#2”, ”grna”: ”TAATGAAAAAGGCGAACTGGTGG”, ”position”: ”1:935”, ”total score”: 100, ”count”: 0, ”offtarget”: [] }, { ”key”: ”#3”, ”grna”: ”TGGAAAGCAATGCCAGGCAGGGG”, ”position”: ”1:427”, ”total score”: 100, ”count”: 0, ”offtarget”: [] }, { ”key”: ”#4”, ”grna”: ”CAAAATCACCAACCACCTGGTGG”, ”position”: ”1:479”, ”total score”: 100, ”count”: 0, ”offtarget”: [] },{ ”key”: ”#44”, ”grna”: ”ATTTTTGCCGAACTTTTGACGGG”, ”position”: ”1:564”, ”total score”: 91, ”count”: 2, ”offtarget”: [{ ”osequence”: ”ATTTTCGCCAAACATTTGGCAGG”, ”oscore”: 0.954750, ”omms”: 4, ”ostrand”: ”-”, ”oposition”: ”1:1924344”, ”oregion”: ”exco” }, { ”osequence”: ”ATTGTTGCGCAACTTTTGGCTGG”, ”oscore”: 0.480417, ”omms”: 4, ”ostrand”: ”-”, ”oposition”: ”1:3827949”, ”oregion”: ”exco” }] }] }
4.5 Output example when failed:
{ “status”: 1, “message”: “illegal args” }
4.6 Appendix. Equations
R=A,G; M=A,C; W=A,T; S=C,G; K=G,T; Y=C,T; H=A,C,T; V=A,C,G; B=C,G,T; D=A,G,T; N=A, G, C, T
Documentation & Download
Service API Documentation
![](https://static.igem.org/mediawiki/2014/c/c5/2014-UESTC-Software-Top.png)
![](https://static.igem.org/mediawiki/2014/e/e5/2014_UESTC_Software_logo.gif)
![](https://static.igem.org/mediawiki/2014/8/8d/2014-UESTC-Software-Igem.png)