{
    "pageid": "upload_help",
    "cn": "\n<br>\n<b>Dataset File Upload/QC</b><br>\nThis functionality of GlyGen allows our collaborators to perform QC and submit their datasets to be integratedinto the GlyGen Knowledgebase.\n\n<br><br>\n<b>Dataset File Formats</b><br>\nCurrently, only tabular dataset files in CSV or TSV formats can be uploaded.\n\n<br><br>\n<b>QC Types</b><br>\nThe following QC types can be performed on uploaded file.\n<ul style=\"margin-left:20px;\">\n    <li><b>Basic File Sanity</b> - where basic file structure in a given format is validated.</li>\n    <li><b>Glycosylation Site</b> - if rows in uploaded file contain information about glycosylation sites, this QC type can be selected to check of each reported site is found in GlyGen canonical protein sequences. The uploaded CSV/TSV file should have the following required fields/headers:\n        <ul style=\"margin-left:20px;\">\n            <li>uniprotkb_ac - protein UniProtKB accession</li>\n            <li>start_pos - start position of the reported site</li>\n            <li>end_pos - end position of the reported site</li>\n            <li>site_seq - site amino acid sequence for the site region</li>\n            <li>glytoucan_ac - GlyToucan accession of the reported glycan</li>\n            <li>glyco_type - glycosylation type [e.g: N-linked, O-linked]</li>\n            <li>xref_id - database ID in source database</li>\n            <li>citation_id - citation id such as PMID or DOI in which the site was reported</li>\n            <li>citation_type - citation type such as PubMed or DOI</li>\n            <li>notes - notes on the reported site</li>\n        </ul>\n    </li>\n    <li><b>Glycosylation Site UniCarbKB </b> - similar to the Glycosylation Site QC type with the following required fields:\n        <ul style=\"margin-left:20px;\">\n             <li>protein - protein UniProtKB accession</li>\n             <li>position - position of the reported site</li>\n             <li>aminoacid - site amino acid sequence for the site region</li>\n             <li>toucan - GlyToucan accession of the reported glycan</li>\n             <li>aminoacidtype - glycosylation type [e.g: N-linked, O-linked]</li>\n             <li>id - UniCarbKB ID</li>\n             <li>pmid - PMID in which the site was reported</li>\n             <li>notes - notes on the reported site</li>\n        </ul>\n    </li>\n</ul>\n\n\n<br><br>\n<b>Performing QC Using API</b><br>\nOne can using our dataset upload and submit APIs following documentation given at <a href=\"https://dsapi.glygen.org\">https://dsapi.glygen.org</a>. Alternatively, the following simple python wrapper can be used to use the APIs for multiple files.\n\n<br>\n<div className=\"leftblock\" style=\"background:#fff;border:1px dashed #ccc;\">\n<pre>\n    \n    import requests\n    import glob\n    import json\n\n\n    url = \"https://dsapi.glygen.org/dataset/upload\"          ## production server\n    #url = \"https://beta-dsapi.glygen.org/dataset/upload\"    ## beta server\n\n    file_list = glob.glob(\"/path/to/my/glycosylation/data/*.csv\")\n    for in_file in file_list:\n        files = {\"file\": open(in_file, 'rb')}\n        req_obj = {\"format\":\"csv\", \"qctype\":\"glyco_site_unicarbkb\", \"dataversion\":\"1.12.1\"}\n        r = requests.post(url, files=files, data=req_obj)\n        out_file = \".\".join(in_file.split(\".\")[:-1]) + \".json\"\n        with open(out_file, \"w\") as FW:\n            FW.write(\"%s\\n\" % (json.dumps(json.loads(r.text), indent=4)))\n        print (\"Saved response in %s\" % (out_file))\n</pre>\n\n</div>\n\n\n\n\n\n\n\n\n\n\n\n"
}
