Export BioCompute Object as JSON

export_json(x, file)

Arguments

x

BioCompute Object JSON string from convert_json

file

JSON file path

Value

Path to the output file

Examples

file_json <- tempfile(fileext = ".json")
generate_example("HCV1a") %>%
  convert_json() %>%
  export_json(file_json)
cat(paste(readLines(file_json), collapse = "\n"))
#> {
#>   "spec_version": "https://w3id.org/biocompute/1.4.2/",
#>   "object_id": "https://biocompute.sbgenomics.com/bco/9916e5ac-b7e4-45a0-9074-d2f55ff35f9a",
#>   "etag": "d18deb41a97a3108e743231af5fec0055dac321b945a569ca58bf33503ec526b",
#>   "provenance_domain": {
#>     "name": "HCV1a ledipasvir resistance SNP detection",
#>     "version": "1.0.0",
#>     "review": [
#>       {
#>         "status": "approved",
#>         "reviewer_comment": "Approved by [company name] staff. Waiting for approval from FDA Reviewer",
#>         "date": 1510507848,
#>         "reviewer": [
#>           {
#>             "reviewer_name": "Jane Doe",
#>             "reviewer_affiliation": "Seven Bridges Genomics",
#>             "reviewer_email": "example@sevenbridges.com",
#>             "reviewer_contribution": "curatedBy",
#>             "reviewer_orcid": "https://orcid.org/0000-0000-0000-0000"
#>           }
#>         ]
#>       },
#>       {
#>         "status": "approved",
#>         "reviewer_comment": "The revised BCO looks fine",
#>         "date": 1513110648,
#>         "reviewer": [
#>           {
#>             "reviewer_name": "John Doe",
#>             "reviewer_affiliation": "U.S. Food and Drug Administration",
#>             "reviewer_email": "example@fda.gov",
#>             "reviewer_contribution": "curatedBy",
#>             "reviewer_orcid": "NA"
#>           }
#>         ]
#>       }
#>     ],
#>     "derived_from": "https://github.com/biocompute-objects/BCO_Specification/blob/1.2.1-beta/HCV1a.json",
#>     "obsolete_after": "2018-11-12T12:30:48-0500",
#>     "embargo": ["2017-10-12T12:30:48-0500", "2017-11-12T12:30:48-0500"],
#>     "created": "2017-01-20T09:40:17-0500",
#>     "modified": "2019-05-10T09:40:17-0500",
#>     "contributors": [
#>       {
#>         "name": "Jane Doe",
#>         "affiliation": "Seven Bridges Genomics",
#>         "email": "example@sevenbridges.com",
#>         "contribution": ["createdBy", "curatedBy"],
#>         "orcid": "https://orcid.org/0000-0000-0000-0000"
#>       },
#>       {
#>         "name": "John Doe",
#>         "affiliation": "U.S. Food and Drug Administration",
#>         "email": "example@fda.gov",
#>         "contribution": "authoredBy",
#>         "orcid": "NA"
#>       }
#>     ],
#>     "license": "https://creativecommons.org/licenses/by/4.0/"
#>   },
#>   "usability_domain": ["Identify baseline single nucleotide polymorphisms (SNPs)[SO:0000694], (insertions)[SO:0000667], and (deletions)[SO:0000045] that correlate with reduced (ledipasvir)[pubchem.compound:67505836] antiviral drug efficacy in (Hepatitis C virus subtype 1)[taxonomy:31646]", "Identify treatment emergent amino acid (substitutions)[SO:1000002] that correlate with antiviral drug treatment failure", "Determine whether the treatment emergent amino acid (substitutions)[SO:1000002] identified correlate with treatment failure involving other drugs against the same virus"],
#>   "extension_domain": {
#>     "fhir_extension": {
#>       "fhir_endpoint": "https://fhirtest.uhn.ca/baseDstu3",
#>       "fhir_version": "3",
#>       "fhir_resources": [
#>         [
#>           {
#>             "fhir_id": "21376",
#>             "fhir_resource": "Sequence"
#>           }
#>         ],
#>         [
#>           {
#>             "fhir_id": "6288583",
#>             "fhir_resource": "DiagnosticReport"
#>           }
#>         ],
#>         [
#>           {
#>             "fhir_id": "25544",
#>             "fhir_resource": "ProcedureRequest"
#>           }
#>         ],
#>         [
#>           {
#>             "fhir_id": "92440",
#>             "fhir_resource": "Observation"
#>           }
#>         ],
#>         [
#>           {
#>             "fhir_id": "4588936",
#>             "fhir_resource": "FamilyMemberHistory"
#>           }
#>         ]
#>       ]
#>     },
#>     "scm_extension": {
#>       "scm_repository": "https://github.com/example/repo1",
#>       "scm_type": "git",
#>       "scm_commit": "c9ffea0b60fa3bcf8e138af7c99ca141a6b8fb21",
#>       "scm_path": "workflow/hive-viral-mutation-detection.cwl",
#>       "scm_preview": "https://github.com/example/repo1/blob/c9ffea0b60fa3bcf8e138af7c99ca141a6b8fb21/workflow/hive-viral-mutation-detection.cwl"
#>     }
#>   },
#>   "description_domain": {
#>     "keywords": ["HCV1a", "Ledipasvir", "antiviral resistance", "SNP", "amino acid substitutions"],
#>     "xref": [
#>       {
#>         "namespace": "pubchem.compound",
#>         "name": "PubChem-compound",
#>         "ids": "67505836",
#>         "access_time": "2017-01-20T09:40:17-0500"
#>       },
#>       {
#>         "namespace": "pubmed",
#>         "name": "PubMed",
#>         "ids": "26508693",
#>         "access_time": "2017-01-21T09:40:17-0500"
#>       },
#>       {
#>         "namespace": "so",
#>         "name": "Sequence Ontology",
#>         "ids": ["SO:000002", "SO:0000694", "SO:0000667", "SO:0000045"],
#>         "access_time": "2017-01-22T09:40:17-0500"
#>       },
#>       {
#>         "namespace": "taxonomy",
#>         "name": "Taxonomy",
#>         "ids": "31646",
#>         "access_time": "2017-01-23T09:40:17-0500"
#>       }
#>     ],
#>     "platform": [
#>       "Seven Bridges Platform"
#>     ],
#>     "pipeline_steps": [
#>       {
#>         "step_number": "1",
#>         "name": "HIVE-hexagon",
#>         "description": "Alignment of reads to a set of references",
#>         "version": "1.3",
#>         "prerequisite": [
#>           {
#>             "name": "Hepatitis C virus genotype 1",
#>             "uri": {
#>               "uri": "https://www.ncbi.nlm.nih.gov/nuccore/22129792",
#>               "access_time": "2017-01-24 09:40:17"
#>             }
#>           },
#>           {
#>             "name": "Hepatitis C virus type 1b complete genome",
#>             "uri": {
#>               "uri": "https://www.ncbi.nlm.nih.gov/nuccore/5420376",
#>               "access_time": "2017-01-24 09:40:17"
#>             }
#>           },
#>           {
#>             "name": "Hepatitis C virus (isolate JFH-1) genomic RNA",
#>             "uri": {
#>               "uri": "https://www.ncbi.nlm.nih.gov/nuccore/13122261",
#>               "access_time": "2017-01-24 09:40:17"
#>             }
#>           },
#>           {
#>             "name": "Hepatitis C virus clone J8CF, complete genome",
#>             "uri": {
#>               "uri": "https://www.ncbi.nlm.nih.gov/nuccore/386646758",
#>               "access_time": "2017-01-24 09:40:17"
#>             }
#>           },
#>           {
#>             "name": "Hepatitis C virus S52 polyprotein gene",
#>             "uri": {
#>               "uri": "https://www.ncbi.nlm.nih.gov/nuccore/295311559",
#>               "access_time": "2017-01-24 09:40:17"
#>             }
#>           }
#>         ],
#>         "input_list": [
#>           {
#>             "uri": "https://example.com/dna.cgi?cmd=objFile&ids=514683",
#>             "access_time": "2017-01-24 09:40:17"
#>           },
#>           {
#>             "uri": "https://example.com/dna.cgi?cmd=objFile&ids=514682",
#>             "access_time": "2017-01-24 09:40:17"
#>           }
#>         ],
#>         "output_list": [
#>           {
#>             "uri": "https://example.com/data/514769/allCount-aligned.csv",
#>             "access_time": "2017-01-24 09:40:17"
#>           },
#>           {
#>             "uri": "https://example.com/data/514801/SNPProfile*.csv",
#>             "access_time": "2017-01-24 09:40:17"
#>           }
#>         ]
#>       }
#>     ]
#>   },
#>   "execution_domain": {
#>     "script": [
#>       "https://example.com/workflows/antiviral_resistance_detection_hive.py"
#>     ],
#>     "script_driver": "shell",
#>     "software_prerequisites": [
#>       {
#>         "name": "HIVE-hexagon",
#>         "version": "babajanian.1",
#>         "uri": [
#>           {
#>             "uri": "https://example.com/dna.cgi?cmd=dna-hexagon&cmdMode=-",
#>             "access_time": "2017-01-24 09:40:17",
#>             "sha1_chksum": "d60f506cddac09e9e816531e7905ca1ca6641e3c"
#>           }
#>         ]
#>       },
#>       {
#>         "name": "HIVE-heptagon",
#>         "version": "albinoni.2",
#>         "uri": [
#>           {
#>             "uri": "https://example.com/dna.cgi?cmd=dna-heptagon&cmdMode=-",
#>             "access_time": "2017-01-24 09:40:17",
#>             "sha1_chksum": "NA"
#>           }
#>         ]
#>       }
#>     ],
#>     "external_data_endpoints": [
#>       [
#>         {
#>           "name": "generic name",
#>           "url": "protocol://domain:port/application/path"
#>         }
#>       ],
#>       [
#>         {
#>           "name": "access to ftp server",
#>           "url": "ftp://data.example.com:21/"
#>         }
#>       ],
#>       [
#>         {
#>           "name": "access to e-utils web service",
#>           "url": "https://eutils.ncbi.nlm.nih.gov/entrez/eutils"
#>         }
#>       ]
#>     ],
#>     "environment_variables": {
#>       "HOSTTYPE": "x86_64-linux",
#>       "EDITOR": "vim"
#>     }
#>   },
#>   "parametric_domain": [
#>     {
#>       "param": "seed",
#>       "value": "14",
#>       "step": "1"
#>     },
#>     {
#>       "param": "minimum_match_len",
#>       "value": "66",
#>       "step": "1"
#>     },
#>     {
#>       "param": "divergence_threshold_percent",
#>       "value": "0.30",
#>       "step": "1"
#>     },
#>     {
#>       "param": "minimum_coverage",
#>       "value": "15",
#>       "step": "2"
#>     },
#>     {
#>       "param": "freq_cutoff",
#>       "value": "0.10",
#>       "step": "2"
#>     }
#>   ],
#>   "io_domain": {
#>     "input_subdomain": [
#>       {
#>         "uri": [
#>           {
#>             "filename": "Hepatitis C virus genotype 1",
#>             "uri": "https://www.ncbi.nlm.nih.gov/nuccore/22129792",
#>             "access_time": "2017-01-24T09:40:17-0500"
#>           }
#>         ]
#>       },
#>       {
#>         "uri": [
#>           {
#>             "filename": "Hepatitis C virus type 1b complete genome",
#>             "uri": "https://www.ncbi.nlm.nih.gov/nuccore/5420376",
#>             "access_time": "2017-01-24T09:40:17-0500"
#>           }
#>         ]
#>       }
#>     ],
#>     "output_subdomain": [
#>       {
#>         "mediatype": "text/csv",
#>         "uri": [
#>           {
#>             "uri": "https://example.com/data/514769/dnaAccessionBased.csv",
#>             "access_time": "2017-01-24T09:40:17-0500"
#>           }
#>         ]
#>       },
#>       {
#>         "mediatype": "text/csv",
#>         "uri": [
#>           {
#>             "uri": "https://example.com/data/514801/SNPProfile*.csv",
#>             "access_time": "2017-01-24T09:40:17-0500"
#>           }
#>         ]
#>       }
#>     ]
#>   },
#>   "error_domain": {
#>     "empirical_error": {
#>       "false_negative_alignment_hits": "<0.0010",
#>       "false_discovery": "<0.05"
#>     },
#>     "algorithmic_error": {
#>       "false_positive_mutation_calls": "<0.00005",
#>       "false_discovery": "0.005"
#>     }
#>   }
#> }