{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Known Issue: unused ISA Source aren't serialized to ISA-Tab\n", "\n", "## Abtract:\n", "\n", "This notebook documents a behavior of the ISA-Tab writer which results in declared but unused ISA Source objects not to be serialized in the ISA-Tab file.\n", "The ISA objects are serialized fine if using the ISA-JSON write.\n", "The future releases of the ISA-API will see to address the issue.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Let's get the tools" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# If executing the notebooks on `Google Colab`,uncomment the following command \n", "# and run it to install the required python libraries. Also, make the test datasets available.\n", "\n", "# !pip install -r requirements.txt" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import os\n", "import json\n", "import datetime\n", "from isatools.model import (\n", " Investigation,\n", " Study,\n", " Assay,\n", " Person,\n", " Material,\n", " DataFile,\n", " OntologySource,\n", " OntologyAnnotation,\n", " Sample,\n", " Source,\n", " Characteristic,\n", " Protocol,\n", " Process,\n", " plink\n", ")\n", "from isatools import isatab\n", "from isatools.isajson import ISAJSONEncoder\n", "\n", "final_dir = os.path.abspath(os.path.join('notebook-output', 'issue-brapi'))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating an ISA Study and boilerplate information" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "investigation = Investigation()\n", "investigation.identifier = \"BRAPI-test-unused-source\"\n", "investigation.title = \"BRAPI-test-unused-source\"\n", "investigation.description = \"this is test to understand the conditions under which ISA-API will serialize or not serialize a Source entity declared but not used in a workflow. Note: while the python ISA-API does not serialize in the Tab format, the information is available from ISA-JSON.\"" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "prs_test_study = Study(filename=\"s_prs_test.txt\")\n", "\n", "prs_test_study.identifier = \"PRS\"\n", "prs_test_study.title = \"Unused Sources\"\n", "prs_test_study.description = \"testing if the python ISA-API supports unusued Sources in ISA-Tab serialization\"\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "T\n" ] } ], "source": [ "prs = Person(last_name=\"Rocca-Serra\", first_name=\"Philippe\", mid_initials=\"T\", affiliation=\"OeRC\", email=\"prs@hotmail.com\" )\n", "prs_test_study.contacts.append(prs)\n", "print(prs.mid_initials)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "ncbi_taxon = OntologySource(name='NCBITaxon', description=\"NCBI Taxonomy\")\n", "human_characteristic= Characteristic(category=OntologyAnnotation(term=\"Organism\"),\n", " value=OntologyAnnotation(term=\"Homo Sapiens\", term_source=ncbi_taxon,\n", " term_accession=\"http://purl.bioontology.org/ontology/NCBITAXON/9606\"))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating ISA Sources" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "subject_0 = Source(name='human individual-0', characteristics=[human_characteristic]) \n", "subject_1 = Source(name='human individual-1', characteristics=[human_characteristic]) \n", "subject_2 = Source(name='human individual-2', characteristics=[human_characteristic]) \n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating ISA Samples" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "sample_0 = Sample(name='SBJ0_sample1')\n", "# note that 2 samples are generated from subject_1\n", "sample_1 = Sample(name='SBJ1_sample1')\n", "sample_2 = Sample(name='SBJ1_sample2')\n", "# note that no sample is generated from subject_\n", "sample_3 = Sample(name='SBJ2')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Associating Sources and Samples to the ISA.Study. object" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "prs_test_study.sources.append(subject_0)\n", "prs_test_study.sources.append(subject_1)\n", "prs_test_study.sources.append(subject_2)\n", "\n", "prs_test_study.samples.append(sample_0)\n", "prs_test_study.samples.append(sample_1)\n", "prs_test_study.samples.append(sample_2)\n", "#prs_test_study.samples.append(subject_2)\n", "prs_test_study.samples.append(sample_3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Declaring Protocol objects" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Don't forget the protocol_type should be declared as an ISA Ontology Annotation" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "prs_protocol = Protocol(name=\"sample collection\",\n", " protocol_type=OntologyAnnotation(term=\"sample collection\"))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Adding the newly created protocol to the list of protocols associated with an ISA Study Object" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "prs_test_study.protocols.append(prs_protocol)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating the ProtocolApplication events connecting Parent to Children Materials" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### executing a protocol minimally or maximally by specifying date and performer of execution" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "prs_process0 = Process(executes_protocol=prs_protocol)\n", "now = str(datetime.datetime.now().strftime(\"%Y-%m-%d\"))\n", "prs_process1 = Process(executes_protocol=prs_protocol, performer=prs.first_name, date_=now)\n", "prs_process2 = Process(executes_protocol=prs_protocol, performer=prs.first_name, date_=now)\n", "prs_process3 = Process(executes_protocol=prs_protocol, performer=prs.first_name, date_=now)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Setting input and outputs of each sample collection protocol application" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "prs_process0.inputs.append(subject_0)\n", "prs_process0.outputs.append(sample_0)\n", "prs_process1.inputs.append(subject_1)\n", "prs_process1.outputs.append(sample_1)\n", "prs_process2.inputs.append(subject_1)\n", "prs_process2.outputs.append(sample_2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Now the following tests if setting a protocol application with no output jinxes the ISA-API" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "prs_process3.inputs.append(subject_2)\n", "prs_process3.outputs.append(sample_3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Here, the ISA Study object is updated by associating all the processes/protocol_applications to the process_sequence attribute.\n" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "prs_test_study.process_sequence.append(prs_process0)\n", "prs_test_study.process_sequence.append(prs_process1)\n", "prs_test_study.process_sequence.append(prs_process2)\n", "prs_test_study.process_sequence.append(prs_process3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating an ISA Assay object - This is to test associating an ISA Source as input to an Assay" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step1 - Create the ISA Assay Object" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "assay_on_source = Assay(measurement_type=OntologyAnnotation(term=\"phenotyping\"),\n", " technology_type=OntologyAnnotation(term=\"\"),\n", " filename=\"a_assay-test.txt\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step2 - Create a new ISA Protocol the type of which is `data acquisition`" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "assay_protocol = Protocol(name=\"assay-on-source\",\n", " protocol_type=\"data acquisition\")\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step3 - Remember to add the new protocol to the ISA.Study object" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "prs_test_study.protocols.append(assay_protocol)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step4 - Create the Protocol Application event which generates an ISA DataFile" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "assay_process = Process(executes_protocol=assay_protocol, performer=prs.first_name)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step5 - Create an ISA DataFile object" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "dummy_file= DataFile(filename=\"dummy.txt\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step6 - Set ProtocolApplication/Process inputs and outputs testing if an ISA.Source can be used in an ISA.Assay" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "assay_process.inputs.append(sample_0)\n", "assay_process.outputs.append(dummy_file)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step7 - Associate the newly created ISA.DataFile with the ISA.Assay object" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "assay_on_source.data_files.append(dummy_file)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step8 - Link and Connect ISA.ProtocolApplications via the process_sequence attribute" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [], "source": [ "assay_on_source.process_sequence.append(prs_process3)\n", "assay_on_source.process_sequence.append(assay_process)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step9 - Update the ISA.Assay Object by listing all ISA.Materials used in the Assay associated ProtocolApplications" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "assay_on_source.samples.append(sample_3)\n", "#assay_on_source.other_material.append(subject_2)\n", "plink(prs_process3, assay_process)" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "prs_test_study.process_sequence.append(assay_process)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step10 - Update the ISA.Study Object by adding the ISA Assay object to the ISA.Study assays attribute" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "prs_test_study.assays.append(assay_on_source)" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "investigation.studies.append(prs_test_study)" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2021-07-21 17:44:03,166 [INFO]: isatab.py(_all_end_to_end_paths:1131) >> [0, 1, 2]\n", "2021-07-21 17:44:03,166 [WARNING]: isatab.py(write_study_table_files:1194) >> [7, 3, 0, 8, 4, 1, 9, 5, 10, 6, 2, 11]\n", "2021-07-21 17:44:03,167 [INFO]: isatab.py(_longest_path_and_attrs:1091) >> [[1, 8, 4], [1, 9, 5], [2, 10, 6]]\n", "2021-07-21 17:44:03,187 [INFO]: isatab.py(_all_end_to_end_paths:1131) >> [6, 3]\n", "2021-07-21 17:44:03,189 [INFO]: isatab.py(_longest_path_and_attrs:1091) >> [[3, 11]]\n", "2021-07-21 17:44:03,189 [INFO]: isatab.py(_longest_path_and_attrs:1091) >> [[3, 11]]\n" ] } ], "source": [ "dataframes = isatab.dump_tables_to_dataframes(investigation)" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Source NameCharacteristics[Organism]Term Source REFTerm Accession NumberProtocol REFDatePerformerSample Name
0human individual-1Homo SapiensNCBITaxonhttp://purl.bioontology.org/ontology/NCBITAXON...sample collection2021-07-21PhilippeSBJ1_sample1
1human individual-1Homo SapiensNCBITaxonhttp://purl.bioontology.org/ontology/NCBITAXON...sample collection2021-07-21PhilippeSBJ1_sample2
2human individual-2Homo SapiensNCBITaxonhttp://purl.bioontology.org/ontology/NCBITAXON...sample collection2021-07-21PhilippeSBJ2
\n", "
" ], "text/plain": [ " Source Name Characteristics[Organism] Term Source REF \\\n", "0 human individual-1 Homo Sapiens NCBITaxon \n", "1 human individual-1 Homo Sapiens NCBITaxon \n", "2 human individual-2 Homo Sapiens NCBITaxon \n", "\n", " Term Accession Number Protocol REF \\\n", "0 http://purl.bioontology.org/ontology/NCBITAXON... sample collection \n", "1 http://purl.bioontology.org/ontology/NCBITAXON... sample collection \n", "2 http://purl.bioontology.org/ontology/NCBITAXON... sample collection \n", "\n", " Date Performer Sample Name \n", "0 2021-07-21 Philippe SBJ1_sample1 \n", "1 2021-07-21 Philippe SBJ1_sample2 \n", "2 2021-07-21 Philippe SBJ2 " ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataframes['s_prs_test.txt']" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [], "source": [ "#dataframes['assay-test.txt']" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2021-07-21 17:44:03,322 [INFO]: isatab.py(_all_end_to_end_paths:1131) >> [0, 1, 2]\n", "2021-07-21 17:44:03,323 [WARNING]: isatab.py(write_study_table_files:1194) >> [7, 3, 0, 8, 4, 1, 9, 5, 10, 6, 2, 11]\n", "2021-07-21 17:44:03,323 [INFO]: isatab.py(_longest_path_and_attrs:1091) >> [[1, 8, 4], [1, 9, 5], [2, 10, 6]]\n", "2021-07-21 17:44:03,340 [INFO]: isatab.py(_all_end_to_end_paths:1131) >> [6, 3]\n", "2021-07-21 17:44:03,341 [INFO]: isatab.py(_longest_path_and_attrs:1091) >> [[3, 11]]\n", "2021-07-21 17:44:03,342 [INFO]: isatab.py(_longest_path_and_attrs:1091) >> [[3, 11]]\n" ] } ], "source": [ "%%capture\n", "isatab.dump(isa_obj=investigation, output_path=final_dir)" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "14821" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "isa_j = json.dumps(investigation, cls=ISAJSONEncoder, sort_keys=True, indent=4, separators=(',', ': '))\n", "open(os.path.join(\"./notebook-output/issue-brapi\",\"isa_as_json_from_dumps.json\"),\"w\").write(isa_j) # this call write the string 'isa_j' to the file called 'isa_as_json_from_dumps.json'" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2021-07-21 17:44:03,364 [INFO]: isatab.py(validate:4206) >> Loading... /Users/philippe/Documents/git/isa-api2/isa-api/isa-cookbook/content/notebooks/notebook-output/issue-brapi/i_investigation.txt\n", "2021-07-21 17:44:03,484 [INFO]: isatab.py(validate:4208) >> Running prechecks...\n", "2021-07-21 17:44:03,494 [ERROR]: isatab.py(check_samples_not_declared_in_study_used_in_assay:2403) >> (E) Some samples in an assay file a_assay-test.txt are not declared in the study file s_prs_test.txt: ['SBJ0_sample1']\n", "2021-07-21 17:44:03,521 [INFO]: isatab.py(validate:4229) >> Finished prechecks...\n", "2021-07-21 17:44:03,522 [INFO]: isatab.py(validate:4230) >> Loading configurations found in /Users/philippe/.pyenv/versions/3.9.0/envs/isa-api-py39/lib/python3.9/site-packages/isatools/resources/config/xml\n", "2021-07-21 17:44:03,552 [INFO]: isatab.py(validate:4235) >> Using configurations found in /Users/philippe/.pyenv/versions/3.9.0/envs/isa-api-py39/lib/python3.9/site-packages/isatools/resources/config/xml\n", "2021-07-21 17:44:03,553 [ERROR]: isatab.py(check_measurement_technology_types:3278) >> (E) Could not load configuration for measurement type 'phenotyping' and technology type '' for STUDY ASSAY.0'\n", "2021-07-21 17:44:03,554 [INFO]: isatab.py(validate:4237) >> Checking investigation file against configuration...\n", "2021-07-21 17:44:03,556 [INFO]: isatab.py(validate:4240) >> Finished checking investigation file\n", "2021-07-21 17:44:03,557 [INFO]: isatab.py(validate:4259) >> Loading... s_prs_test.txt\n", "2021-07-21 17:44:03,560 [INFO]: isatab.py(validate:4265) >> Validating s_prs_test.txt against default study table configuration\n", "2021-07-21 17:44:03,560 [INFO]: isatab.py(validate:4267) >> Checking Factor Value presence...\n", "2021-07-21 17:44:03,561 [INFO]: isatab.py(validate:4270) >> Checking required fields...\n", "2021-07-21 17:44:03,561 [INFO]: isatab.py(validate:4273) >> Checking generic fields...\n", "2021-07-21 17:44:03,562 [INFO]: isatab.py(validate:4281) >> Checking unit fields...\n", "2021-07-21 17:44:03,563 [INFO]: isatab.py(validate:4288) >> Checking protocol fields...\n", "2021-07-21 17:44:03,564 [INFO]: isatab.py(validate:4298) >> Checking ontology fields...\n", "2021-07-21 17:44:03,564 [INFO]: isatab.py(validate:4308) >> Checking study group size...\n", "2021-07-21 17:44:03,564 [INFO]: isatab.py(validate:4312) >> Finished validation on s_prs_test.txt\n", "2021-07-21 17:44:03,565 [ERROR]: isatab.py(validate:4336) >> Could not load config matching (phenotyping, )\n", "2021-07-21 17:44:03,565 [WARNING]: isatab.py(validate:4340) >> Only have configs matching:\n", "2021-07-21 17:44:03,566 [WARNING]: isatab.py(validate:4342) >> ('protein-dna binding site identification', 'dna microarray')\n", "2021-07-21 17:44:03,566 [WARNING]: isatab.py(validate:4342) >> ('loss of heterozygosity profiling', 'dna microarray')\n", "2021-07-21 17:44:03,567 [WARNING]: isatab.py(validate:4342) >> ('histone modification profiling', 'nucleotide sequencing')\n", "2021-07-21 17:44:03,567 [WARNING]: isatab.py(validate:4342) >> ('dna methylation profiling', 'nucleotide sequencing')\n", "2021-07-21 17:44:03,567 [WARNING]: isatab.py(validate:4342) >> ('protein identification', 'mass spectrometry')\n", "2021-07-21 17:44:03,568 [WARNING]: isatab.py(validate:4342) >> ('protein-protein interaction detection', 'protein microarray')\n", "2021-07-21 17:44:03,568 [WARNING]: isatab.py(validate:4342) >> ('snp analysis', 'dna microarray')\n", "2021-07-21 17:44:03,569 [WARNING]: isatab.py(validate:4342) >> ('[sample]', '')\n", "2021-07-21 17:44:03,569 [WARNING]: isatab.py(validate:4342) >> ('protein-dna binding site identification', 'nucleotide sequencing')\n", "2021-07-21 17:44:03,570 [WARNING]: isatab.py(validate:4342) >> ('metabolite profiling', 'mass spectrometry')\n", "2021-07-21 17:44:03,570 [WARNING]: isatab.py(validate:4342) >> ('metabolite profiling', 'nmr spectroscopy')\n", "2021-07-21 17:44:03,571 [WARNING]: isatab.py(validate:4342) >> ('protein expression profiling', 'protein microarray')\n", "2021-07-21 17:44:03,571 [WARNING]: isatab.py(validate:4342) >> ('cell sorting', 'flow cytometry')\n", "2021-07-21 17:44:03,572 [WARNING]: isatab.py(validate:4342) >> ('[investigation]', '')\n", "2021-07-21 17:44:03,573 [WARNING]: isatab.py(validate:4342) >> ('genome sequencing', 'nucleotide sequencing')\n", "2021-07-21 17:44:03,574 [WARNING]: isatab.py(validate:4342) >> ('metagenome sequencing', 'nucleotide sequencing')\n", "2021-07-21 17:44:03,574 [WARNING]: isatab.py(validate:4342) >> ('clinical chemistry analysis', '')\n", "2021-07-21 17:44:03,575 [WARNING]: isatab.py(validate:4342) >> ('transcription factor binding site identification', 'nucleotide sequencing')\n", "2021-07-21 17:44:03,575 [WARNING]: isatab.py(validate:4342) >> ('copy number variation profiling', 'dna microarray')\n", "2021-07-21 17:44:03,576 [WARNING]: isatab.py(validate:4342) >> ('cell counting', 'flow cytometry')\n", "2021-07-21 17:44:03,576 [WARNING]: isatab.py(validate:4342) >> ('transcription factor binding site identification', 'dna microarray')\n", "2021-07-21 17:44:03,576 [WARNING]: isatab.py(validate:4342) >> ('protein expression profiling', 'mass spectrometry')\n", "2021-07-21 17:44:03,577 [WARNING]: isatab.py(validate:4342) >> ('environmental gene survey', 'nucleotide sequencing')\n", "2021-07-21 17:44:03,577 [WARNING]: isatab.py(validate:4342) >> ('transcription profiling', 'real time pcr')\n", "2021-07-21 17:44:03,578 [WARNING]: isatab.py(validate:4342) >> ('histology', '')\n", "2021-07-21 17:44:03,578 [WARNING]: isatab.py(validate:4342) >> ('dna methylation profiling', 'dna microarray')\n", "2021-07-21 17:44:03,579 [WARNING]: isatab.py(validate:4342) >> ('transcription profiling', 'nucleotide sequencing')\n", "2021-07-21 17:44:03,579 [WARNING]: isatab.py(validate:4342) >> ('protein expression profiling', 'gel electrophoresis')\n", "2021-07-21 17:44:03,580 [WARNING]: isatab.py(validate:4342) >> ('transcription profiling', 'dna microarray')\n", "2021-07-21 17:44:03,580 [WARNING]: isatab.py(validate:4342) >> ('hematology', '')\n", "2021-07-21 17:44:03,581 [WARNING]: isatab.py(validate:4345) >> Skipping configuration validation as could not load config...\n", "2021-07-21 17:44:03,581 [INFO]: isatab.py(validate:4426) >> Checking consistencies between study sample table and assay tables...\n", "2021-07-21 17:44:03,581 [INFO]: isatab.py(validate:4431) >> Finished checking study sample table against assay tables...\n", "2021-07-21 17:44:03,582 [INFO]: isatab.py(validate:4435) >> Skipping pooling test as there are outstanding errors\n", "2021-07-21 17:44:03,582 [INFO]: isatab.py(validate:4444) >> Finished validation...\n" ] } ], "source": [ "my_json_report = isatab.validate(open(os.path.join(final_dir, 'i_investigation.txt')))" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'errors': [{'message': 'Measurement/technology type invalid', 'supplemental': 'Measurement phenotyping/technology , STUDY ASSAY.0', 'code': 4002}], 'warnings': [], 'info': [{'message': 'Found -1 study groups in s_prs_test.txt', 'supplemental': 'Found -1 study groups in s_prs_test.txt', 'code': 5001}], 'validation_finished': True}\n" ] } ], "source": [ "print(my_json_report)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## About this notebook\n", "\n", "- authors: philippe.rocca-serra@oerc.ox.ac.uk, massimiliano.izzo@oerc.ox.ac.uk\n", "- license: CC-BY 4.0\n", "- support: isatools@googlegroups.com\n", "- issue tracker: https://github.com/ISA-tools/isa-api/issues" ] } ], "metadata": { "kernelspec": { "display_name": "isa-api-py39", "language": "python", "name": "isa-api-py39" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.0" } }, "nbformat": 4, "nbformat_minor": 4 }