Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions tools/fair_bioheaders/fair_bioheaders_verify.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
## bioheaders exits 1 both when the check fails and when the file cannot be read;
## the messages tell them apart. The status is kept so that the report can be written.
#if $type in ['yaml', 'json', 'jsonld']
#set $check = 'metadata validated against the schema'
#set $check = 'schema validation of the metadata'
bioheaders validate --from '$type' '$input' > messages.txt 2>&1 && status=0 || status=\$? ;
#else
#set $check = 'header validated against the schema and checksum verified'
#set $check = 'schema validation of the header and checksum verification'
bioheaders verify --type '$type' '$input' > messages.txt 2>&1 && status=0 || status=\$? ;
#end if
cat messages.txt &&
Expand Down Expand Up @@ -102,7 +102,7 @@ fi &&
<param name="input" value="example.fhr.yaml" ftype="yaml"/>
<output name="report" ftype="txt">
<assert_contents>
<has_text text="Check: metadata validated against the schema"/>
<has_text text="Check: schema validation of the metadata"/>
<has_text text="Result: PASSED"/>
<has_text text="FHR metadata is valid."/>
</assert_contents>
Expand All @@ -114,6 +114,8 @@ fi &&
<output name="report" ftype="txt">
<assert_contents>
<has_text text="Result: FAILED"/>
<has_line line="Check: schema validation of the header and checksum verification"/>
<not_has_text text="checksum verified"/>
<has_text text="Checksum verification failed"/>
</assert_contents>
</output>
Expand Down Expand Up @@ -188,7 +190,7 @@ fi &&
<param name="input" value="example.fhr.json" ftype="freq.json"/>
<output name="report" ftype="txt">
<assert_contents>
<has_line line="Check: metadata validated against the schema"/>
<has_line line="Check: schema validation of the metadata"/>
<has_line line="Result: PASSED"/>
</assert_contents>
</output>
Expand All @@ -212,6 +214,17 @@ fi &&
</assert_contents>
</output>
</test>
<!-- 16: a failed check labelled with a non-FHR header type (FHGFF3:) is a
FAILED result, not an unreadable file -->
<test expect_num_outputs="1">
<param name="input" value="header-invalid.fhgff3.gff3" ftype="gff3"/>
<output name="report" ftype="txt">
<assert_contents>
<has_text_matching expression="^Result: FAILED\n"/>
<has_text text="FHGFF3: schema validation failed"/>
</assert_contents>
</output>
</test>
</tests>
<help><![CDATA[
.. class:: infomark
Expand Down
2 changes: 1 addition & 1 deletion tools/fair_bioheaders/macros.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<macros>
<token name="@TOOL_VERSION@">0.13.1</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@VERSION_SUFFIX@">1</token>
<token name="@PROFILE@">25.0</token>
<!-- Datatypes of files that can carry a FAIR-bioHeaders header -->
<token name="@HEADED_FORMATS@">fasta,fasta.gz,gfa1,gfa1.gz,gfa2,gfa2.gz,gff3,gff3.gz</token>
Expand Down
20 changes: 20 additions & 0 deletions tools/fair_bioheaders/test-data/header-invalid.fhgff3.gff3
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
##gff-version 3
#~schema: https://w3id.org/fair-bioheaders/fhgff3/v0.6.0
#~schemaVersion: '1.2'
#~annotation: Synthetic FHGFF3 example annotation
#~taxon:
#~ name: Homo sapiens
#~ uri: https://identifiers.org/taxonomy:9606
#~version: 1.0.0
#~metadataAuthor:
#~- name: Synthetic metadata author (placeholder)
#~dateCreated: '2026-10-13'
#~documentation: Synthetic header with no genome link; it fails rule G2.
#~checksum: VT+AD3owBjHlTRVflqZ1ZiIgatjjpwAEOc13zt/n7WE=
##sequence-region ctg1 1 20
##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=9606
#!genome-build Synthetic SyntheticAssembly1
ctg1 synthetic gene 1 20 . + . ID=gene1
ctg1 synthetic mRNA 1 20 . + . ID=mrna1;Parent=gene1
ctg1 synthetic exon 1 20 . + . ID=exon1;Parent=mrna1
ctg1 synthetic CDS 1 18 . + 0 ID=cds1;Parent=mrna1