Commit aebaf03a authored by Karoly Erdos's avatar Karoly Erdos
Browse files

Add missing tests for the negative checklist tests

Add the newly generated, fixed checklists
Fix valid and invalid sample examples
parent 6cf84833
......@@ -24,7 +24,6 @@ module.exports = function isValidTaxonomy(ajv) {
generateNotExistsErrorMessage();
} else {
let jsonBody = JSON.parse(body);
logger.log("debug", `Response JSON: ${JSON.stringify(jsonBody, null, 2)}`);
if (jsonBody) {
let numFound = jsonBody.length;
......
{
"$schema" : "http://json-schema.org/draft-07/schema#",
"description" : "Minimum information required for the sample",
"type" : "object",
"title" : "ENA default sample checklist",
"$async" : true,
"author" : "ENA",
"properties" : {
"attributes" : {
"properties" : {
"serotype" : {
"description" : "serological variety of a species characterized by its antigenic properties",
"items" : {}
},
"tissue_type" : {
"description" : "tissue type from which the sample was obtained",
"items" : {}
},
"isolate" : {
"description" : "individual isolate from which the sample was obtained",
"items" : {}
},
"geographic location (country and/or sea)" : {
"description" : "The geographical origin of the sample as defined by the country or sea. Country or sea names should be chosen from the INSDC country list (http://insdc.org/country.html).",
"items" : {}
},
"sub_species" : {
"description" : "name of sub-species of organism from which sample was obtained",
"items" : {}
},
"isolation_source" : {
"sex" : {
"items" : {},
"description" : "describes the physical, environmental and/or local geographical source of the biological sample from which the sample was derived"
"description" : "sex of the organism from which the sample was obtained"
},
"culture_collection" : {
"variety" : {
"items" : {},
"description" : "institution code and identifier for the culture from which the sample was obtained, with optional collection code."
},
"collected_by" : {
"description" : "name of persons or institute who collected the specimen",
"items" : {}
"description" : "variety (= varietas, a formal Linnaean rank) of organism from which sample was derived."
},
"host scientific name" : {
"items" : {},
"description" : "Scientific name of the natural (as opposed to laboratory) host to the organism from which sample was obtained."
},
"strain" : {
"description" : "Name of the strain from which the sample was obtained.",
"items" : {}
"mating_type" : {
"items" : {},
"description" : "mating type of the organism from which the sequence was obtained; mating type is used for prokaryotes, and for eukaryotes that undergo meiosis without sexually dimorphic gametes"
},
"cell_line" : {
"dev_stage" : {
"items" : {},
"description" : "cell line from which the sample was obtained"
"description" : "if the sample was obtained from an organism in a specific developmental stage, it is specified with this qualifier"
},
"lat_lon" : {
"description" : "geographical coordinates of the location where the specimen was collected",
"strain" : {
"description" : "Name of the strain from which the sample was obtained.",
"items" : {}
},
"variety" : {
"serotype" : {
"items" : {},
"description" : "variety (= varietas, a formal Linnaean rank) of organism from which sample was derived."
"description" : "serological variety of a species characterized by its antigenic properties"
},
"geographic location (region and locality)" : {
"description" : "The geographical origin of the sample as defined by the specific region name followed by the locality name.",
"items" : {}
},
"specimen_voucher" : {
"items" : {},
"description" : "identifier for the specimen from which the sample was obtained"
},
"bio_material" : {
"description" : "identifier for the biological material from which the sample was obtained, with optional institution code and collection code for the place where it is currently stored.",
"sub_strain" : {
"description" : "name or identifier of a genetically or otherwise modified strain from which sample was obtained, derived from a parental strain (which should be annotated in the strain field; sub_strain from which sample was obtained",
"items" : {}
},
"serovar" : {
"items" : {},
"description" : "serological variety of a species (usually a prokaryote) characterized by its antigenic properties"
"description" : "serological variety of a species (usually a prokaryote) characterized by its antigenic properties",
"items" : {}
},
"ecotype" : {
"items" : {},
"description" : "a population within a given species displaying genetically based, phenotypic traits that reflect adaptation to a local habitat."
"specimen_voucher" : {
"description" : "identifier for the specimen from which the sample was obtained",
"items" : {}
},
"dev_stage" : {
"items" : {},
"description" : "if the sample was obtained from an organism in a specific developmental stage, it is specified with this qualifier"
"environmental_sample" : {
"description" : "identifies sequences derived by direct molecular isolation from a bulk environmental DNA sample (by PCR with or without subsequent cloning of the product, DGGE, or other anonymous methods) with no reliable identification of the source organism",
"items" : {
"properties" : {
"value" : {
"enum" : [
"No",
"Yes"
]
}
}
}
},
"cell_type" : {
"description" : "cell type from which the sample was obtained",
"cultivar" : {
"description" : "cultivar (cultivated variety) of plant from which sample was obtained",
"items" : {}
},
"collection_date" : {
"germline" : {
"items" : {},
"description" : "date that the specimen was collected"
"description" : "the sample described presented in the entry has not undergone somatic genomic rearrangement as part of an adaptive immune response; it is the unrearranged molecule that was inherited from the parental germline"
},
"tissue_lib" : {
"tissue_type" : {
"items" : {},
"description" : "tissue library from which sample was obtained"
"description" : "tissue type from which the sample was obtained"
},
"sub_strain" : {
"geographic location (country and/or sea)" : {
"items" : {
"properties" : {
"value" : {
"enum" : [
"Afghanistan",
"Albania",
"Algeria",
"American Samoa",
"Andorra",
"Angola",
"Anguilla",
"Antarctica",
"Antigua and Barbuda",
"Arctic Ocean",
"Argentina",
"Armenia",
"Aruba",
"Ashmore and Cartier Islands",
"Atlantic Ocean",
"Australia",
"Austria",
"Azerbaijan",
"Bahamas",
"Bahrain",
"Baker Island",
"Baltic Sea",
"Bangladesh",
"Barbados",
"Bassas da India",
"Belarus",
"Belgium",
"Belize",
"Benin",
"Bermuda",
"Bhutan",
"Bolivia",
"Borneo",
"Bosnia and Herzegovina",
"Botswana",
"Bouvet Island",
"Brazil",
"British Virgin Islands",
"Brunei",
"Bulgaria",
"Burkina Faso",
"Burundi",
"Cambodia",
"Cameroon",
"Canada",
"Cape Verde",
"Cayman Islands",
"Central African Republic",
"Chad",
"Chile",
"China",
"Christmas Island",
"Clipperton Island",
"Cocos Islands",
"Colombia",
"Comoros",
"Cook Islands",
"Coral Sea Islands",
"Costa Rica",
"Cote d'Ivoire",
"Croatia",
"Cuba",
"Curacao",
"Cyprus",
"Czech Republic",
"Democratic Republic of the Congo",
"Denmark",
"Djibouti",
"Dominica",
"Dominican Republic",
"East Timor",
"Ecuador",
"Egypt",
"El Salvador",
"Equatorial Guinea",
"Eritrea",
"Estonia",
"Ethiopia",
"Europa Island",
"Falkland Islands (Islas Malvinas)",
"Faroe Islands",
"Fiji",
"Finland",
"France",
"French Guiana",
"French Polynesia",
"French Southern and Antarctic Lands",
"Gabon",
"Gambia",
"Gaza Strip",
"Georgia",
"Germany",
"Ghana",
"Gibraltar",
"Glorioso Islands",
"Greece",
"Greenland",
"Grenada",
"Guadeloupe",
"Guam",
"Guatemala",
"Guernsey",
"Guinea",
"Guinea-Bissau",
"Guyana",
"Haiti",
"Heard Island and McDonald Islands",
"Honduras",
"Hong Kong",
"Howland Island",
"Hungary",
"Iceland",
"India",
"Indian Ocean",
"Indonesia",
"Iran",
"Iraq",
"Ireland",
"Isle of Man",
"Israel",
"Italy",
"Jamaica",
"Jan Mayen",
"Japan",
"Jarvis Island",
"Jersey",
"Johnston Atoll",
"Jordan",
"Juan de Nova Island",
"Kazakhstan",
"Kenya",
"Kerguelen Archipelago",
"Kingman Reef",
"Kiribati",
"Kosovo",
"Kuwait",
"Kyrgyzstan",
"Laos",
"Latvia",
"Lebanon",
"Lesotho",
"Liberia",
"Libya",
"Liechtenstein",
"Lithuania",
"Luxembourg",
"Macau",
"Macedonia",
"Madagascar",
"Malawi",
"Malaysia",
"Maldives",
"Mali",
"Malta",
"Marshall Islands",
"Martinique",
"Mauritania",
"Mauritius",
"Mayotte",
"Mediterranean Sea",
"Mexico",
"Micronesia",
"Midway Islands",
"Moldova",
"Monaco",
"Mongolia",
"Montenegro",
"Montserrat",
"Morocco",
"Mozambique",
"Myanmar",
"Namibia",
"Nauru",
"Navassa Island",
"Nepal",
"Netherlands",
"New Caledonia",
"New Zealand",
"Nicaragua",
"Niger",
"Nigeria",
"Niue",
"Norfolk Island",
"North Korea",
"North Sea",
"Northern Mariana Islands",
"Norway",
"Oman",
"Pacific Ocean",
"Pakistan",
"Palau",
"Palmyra Atoll",
"Panama",
"Papua New Guinea",
"Paracel Islands",
"Paraguay",
"Peru",
"Philippines",
"Pitcairn Islands",
"Poland",
"Portugal",
"Puerto Rico",
"Qatar",
"Republic of the Congo",
"Reunion",
"Romania",
"Ross Sea",
"Russia",
"Rwanda",
"Saint Helena",
"Saint Kitts and Nevis",
"Saint Lucia",
"Saint Pierre and Miquelon",
"Saint Vincent and the Grenadines",
"Samoa",
"San Marino",
"Sao Tome and Principe",
"Saudi Arabia",
"Senegal",
"Serbia",
"Seychelles",
"Sierra Leone",
"Singapore",
"Sint Maarten",
"Slovakia",
"Slovenia",
"Solomon Islands",
"Somalia",
"South Africa",
"South Georgia and the South Sandwich Islands",
"South Korea",
"Southern Ocean",
"Spain",
"Spratly Islands",
"Sri Lanka",
"Sudan",
"Suriname",
"Svalbard",
"Swaziland",
"Sweden",
"Switzerland",
"Syria",
"Taiwan",
"Tajikistan",
"Tanzania",
"Tasman Sea",
"Thailand",
"Togo",
"Tokelau",
"Tonga",
"Trinidad and Tobago",
"Tromelin Island",
"Tunisia",
"Turkey",
"Turkmenistan",
"Turks and Caicos Islands",
"Tuvalu",
"USA",
"Uganda",
"Ukraine",
"United Arab Emirates",
"United Kingdom",
"Uruguay",
"Uzbekistan",
"Vanuatu",
"Venezuela",
"Viet Nam",
"Virgin Islands",
"Wake Island",
"Wallis and Futuna",
"West Bank",
"Western Sahara",
"Yemen",
"Zambia",
"Zimbabwe",
"not applicable",
"not collected",
"not provided",
"restricted access"
]
}
}
},
"description" : "The geographical origin of the sample as defined by the country or sea. Country or sea names should be chosen from the INSDC country list (http://insdc.org/country.html)."
},
"lat_lon" : {
"items" : {},
"description" : "name or identifier of a genetically or otherwise modified strain from which sample was obtained, derived from a parental strain (which should be annotated in the strain field; sub_strain from which sample was obtained"
"description" : "geographical coordinates of the location where the specimen was collected"
},
"sex" : {
"sub_species" : {
"items" : {},
"description" : "sex of the organism from which the sample was obtained"
"description" : "name of sub-species of organism from which sample was obtained"
},
"environmental_sample" : {
"description" : "identifies sequences derived by direct molecular isolation from a bulk environmental DNA sample (by PCR with or without subsequent cloning of the product, DGGE, or other anonymous methods) with no reliable identification of the source organism",
"identified_by" : {
"items" : {},
"description" : "name of the expert who identified the specimen taxonomically"
},
"ecotype" : {
"description" : "a population within a given species displaying genetically based, phenotypic traits that reflect adaptation to a local habitat.",
"items" : {}
},
"mating_type" : {
"description" : "mating type of the organism from which the sequence was obtained; mating type is used for prokaryotes, and for eukaryotes that undergo meiosis without sexually dimorphic gametes",
"culture_collection" : {
"description" : "institution code and identifier for the culture from which the sample was obtained, with optional collection code.",
"items" : {}
},
"collection_date" : {
"items" : {
"properties" : {
"value" : {
"pattern" : "^[0-9]{4}(-[0-9]{2}(-[0-9]{2}(T[0-9]{2}:[0-9]{2}(:[0-9]{2})?Z?([+-][0-9]{1,2})?)?)?)?(/[0-9]{4}(-[0-9]{2}(-[0-9]{2}(T[0-9]{2}:[0-9]{2}(:[0-9]{2})?Z?([+-][0-9]{1,2})?)?)?)?)?$"
}
}
},
"description" : "date that the specimen was collected"
},
"lab_host" : {
"items" : {},
"description" : "scientific name of the laboratory host used to propagate the source organism from which the sample was obtained"
},
"germline" : {
"description" : "the sample described presented in the entry has not undergone somatic genomic rearrangement as part of an adaptive immune response; it is the unrearranged molecule that was inherited from the parental germline",
"items" : {}
"cell_type" : {
"items" : {},
"description" : "cell type from which the sample was obtained"
},
"identified_by" : {
"description" : "name of the expert who identified the specimen taxonomically",
"cell_line" : {
"items" : {},
"description" : "cell line from which the sample was obtained"
},
"collected_by" : {
"items" : {},
"description" : "name of persons or institute who collected the specimen"
},
"bio_material" : {
"description" : "identifier for the biological material from which the sample was obtained, with optional institution code and collection code for the place where it is currently stored.",
"items" : {}
},
"cultivar" : {
"description" : "cultivar (cultivated variety) of plant from which sample was obtained",
"tissue_lib" : {
"items" : {},
"description" : "tissue library from which sample was obtained"
},
"isolation_source" : {
"items" : {},
"description" : "describes the physical, environmental and/or local geographical source of the biological sample from which the sample was derived"
},
"isolate" : {
"description" : "individual isolate from which the sample was obtained",
"items" : {}
}
},
"required" : []
}
},
"$id" : "ERC000011",
"version" : "1.0.0",
"description" : "Minimum information required for the sample",
"required" : [
"attributes"
],
"title" : "ENA default sample checklist",
"$async" : true,
"definitions" : {
"attribute" : {
"items" : {
"required" : [
"value"
],
"properties" : {
"value" : {
"type" : "string",
"minLength" : 1
},
"units" : {
"type" : "string",
"minLength" : 1
},
"terms" : {
"$ref" : "#/definitions/terms"
}
}
},
"minItems" : 1,
"type" : "array"
},
"terms" : {
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
......@@ -170,23 +446,48 @@
"required" : [
"url"
]
}
},
"type" : "array"
},
"properties" : {
"attributes" : {
"type" : "object",
"description" : "Attributes for describing a sample.",
"properties" : {},
"patternProperties" : {
"^.*$" : {
"$ref" : "#/definitions/attribute"
}
},
"required" : []
"type" : "object",
"required" : [],
"properties" : {},
"description" : "Attributes for describing a sample."
}
},
"attribute" : {
"minItems" : 1,
"items" : {
"required" : [
"value"