34 const std::string type_name =
"gff_file";
35 const auto& gffmap = internal_json::extract_typed_object_from_metadata(metadata.
other, type_name);
37 const std::string version_name =
"version";
38 const std::string& vstring = internal_json::extract_string_from_typed_object(gffmap, version_name, type_name);
39 auto version = ritsuko::parse_version_string(vstring.c_str(), vstring.size(),
true);
40 if (version.major != 1) {
41 throw std::runtime_error(
"unsupported version string '" + vstring +
"'");
44 auto fpath = path /
"file.";
45 const std::string format_name =
"format";
46 const std::string& fstring = internal_json::extract_string_from_typed_object(gffmap, format_name, type_name);
47 if (fstring ==
"GFF2") {
49 }
else if (fstring ==
"GFF3") {
52 throw std::runtime_error(
"unknown value '" + fstring +
"' for 'gff_file.format' property");
56 bool indexed = internal_files::is_indexed(gffmap);
65 internal_files::check_gzip_signature(fpath);
67 if (fstring ==
"GFF3") {
68 const std::string signature =
"##gff-version 3";
69 internal_files::check_gunzipped_signature(fpath, signature.c_str(), signature.size(),
"GFF3");
75 internal_files::check_gzip_signature(ixpath);
76 internal_files::check_gunzipped_signature(ixpath,
"TBI\1", 4,
"tabix");
void validate(const std::filesystem::path &path, const ObjectMetadata &metadata, Options &options)
Definition gff_file.hpp:33
std::function< void(const std::filesystem::path &, const ObjectMetadata &, Options &, bool)> gff_file_strict_check
Definition utils_public.hpp:214