Mercurial > repos > imgteam > iscc_sum_verify
comparison iscc_verify.xml @ 0:9fee6d81910d draft default tip
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/iscc-sum commit 6db86b8b65a0e05b7f3541d505fbe900633fc72a
| author | imgteam |
|---|---|
| date | Fri, 19 Dec 2025 15:02:49 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:9fee6d81910d |
|---|---|
| 1 <tool id="iscc_sum_verify" name="Verify ISCC-CODE" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="24.1"> | |
| 2 <description>with ISCC-SUM</description> | |
| 3 <macros> | |
| 4 <import>macros.xml</import> | |
| 5 <import>creators.xml</import> | |
| 6 </macros> | |
| 7 <expand macro="requirements" /> | |
| 8 <expand macro="version_command" /> | |
| 9 <creator> | |
| 10 <expand macro="creators/iscc" /> | |
| 11 <expand macro="creators/lco" /> | |
| 12 <expand macro="creators/maartenpaul" /> | |
| 13 <expand macro="creators/etzm" /> | |
| 14 </creator> | |
| 15 | |
| 16 <command detect_errors="exit_code"><![CDATA[ | |
| 17 ## Generate ISCC-CODE for input dataset | |
| 18 GENERATED=\$(iscc-sum '${input_file}' | cut -d':' -f2 | cut -d' ' -f1) && | |
| 19 | |
| 20 ## Get expected ISCC-CODE | |
| 21 EXPECTED='${expected_code}' && | |
| 22 | |
| 23 ## Validate expected ISCC-CODE length | |
| 24 if [ \${#EXPECTED} -ne 55 ]; then | |
| 25 echo "ERROR: Expected ISCC-CODE must be exactly 55 characters" >&2; | |
| 26 echo "Found: \${#EXPECTED} characters" >&2; | |
| 27 exit 1; | |
| 28 fi && | |
| 29 | |
| 30 ## Output verification report | |
| 31 if [ "\$GENERATED" = "\$EXPECTED" ]; then | |
| 32 echo "OK - ISCC-CODEs match" > '${output_file}'; | |
| 33 else | |
| 34 echo "FAILED - ISCC-CODEs do not match" > '${output_file}'; | |
| 35 fi && | |
| 36 echo "Expected: \$EXPECTED" >> '${output_file}' && | |
| 37 echo "Generated: \$GENERATED" >> '${output_file}' && | |
| 38 echo "" >> '${output_file}' | |
| 39 | |
| 40 ]]></command> | |
| 41 | |
| 42 <inputs> | |
| 43 <param name="input_file" type="data" format="data" label="Dataset to verify" | |
| 44 help="Verify this dataset's ISCC-CODE. When a collection is provided, each dataset is verified separately against the same expected ISCC-CODE."/> | |
| 45 <param name="expected_code" type="text" label="Expected ISCC-CODE" | |
| 46 help="The 55-character ISCC-CODE to verify against"> | |
| 47 <validator type="length" min="55" max="55" message="ISCC-CODE must be exactly 55 characters"/> | |
| 48 </param> | |
| 49 </inputs> | |
| 50 | |
| 51 <outputs> | |
| 52 <data name="output_file" format="txt" label="${tool.name} on ${on_string}"/> | |
| 53 </outputs> | |
| 54 | |
| 55 <tests> | |
| 56 <!-- Test 1: Successful verification --> | |
| 57 <test expect_num_outputs="1"> | |
| 58 <param name="input_file" value="test1.png"/> | |
| 59 <param name="expected_code" value="K4AOMGOGQJA4Y46PAC4YPPA63GKD5RVFPR7FU3I4OOEW44TYXNYOTMY"/> | |
| 60 <output name="output_file"> | |
| 61 <assert_contents> | |
| 62 <has_text text="OK - ISCC-CODEs match"/> | |
| 63 <has_text text="Expected: K4AOMGOGQJA4Y46PAC4YPPA63GKD5RVFPR7FU3I4OOEW44TYXNYOTMY"/> | |
| 64 <has_text text="Generated: K4AOMGOGQJA4Y46PAC4YPPA63GKD5RVFPR7FU3I4OOEW44TYXNYOTMY"/> | |
| 65 <has_n_lines n="4"/> | |
| 66 </assert_contents> | |
| 67 </output> | |
| 68 </test> | |
| 69 | |
| 70 <!-- Test 2: Failed verification --> | |
| 71 <test expect_num_outputs="1"> | |
| 72 <param name="input_file" value="test1.png"/> | |
| 73 <param name="expected_code" value="K4AGSPOSB5SS2X427WZ27QASTSBVTS55DXLMFDF7WOJKEOSTDEI3OXQ"/> | |
| 74 <output name="output_file"> | |
| 75 <assert_contents> | |
| 76 <has_text text="FAILED - ISCC-CODEs do not match"/> | |
| 77 <has_text text="Expected: K4AGSPOSB5SS2X427WZ27QASTSBVTS55DXLMFDF7WOJKEOSTDEI3OXQ"/> | |
| 78 <has_text text="Generated: K4AOMGOGQJA4Y46PAC4YPPA63GKD5RVFPR7FU3I4OOEW44TYXNYOTMY"/> | |
| 79 <has_n_lines n="4"/> | |
| 80 </assert_contents> | |
| 81 </output> | |
| 82 </test> | |
| 83 | |
| 84 <!-- Test 3: FASTA file verification --> | |
| 85 <test expect_num_outputs="1"> | |
| 86 <param name="input_file" value="test3.fasta"/> | |
| 87 <param name="expected_code" value="K4AKF7PTZ7JTAAYZ7YZHZPR5RETKYXXE7RTBTJA4JX5GQQMSLZRC6QQ"/> | |
| 88 <output name="output_file"> | |
| 89 <assert_contents> | |
| 90 <has_text text="OK - ISCC-CODEs match"/> | |
| 91 <has_text text="Expected: K4AKF7PTZ7JTAAYZ7YZHZPR5RETKYXXE7RTBTJA4JX5GQQMSLZRC6QQ"/> | |
| 92 <has_text text="Generated: K4AKF7PTZ7JTAAYZ7YZHZPR5RETKYXXE7RTBTJA4JX5GQQMSLZRC6QQ"/> | |
| 93 <has_n_lines n="4"/> | |
| 94 </assert_contents> | |
| 95 </output> | |
| 96 </test> | |
| 97 </tests> | |
| 98 | |
| 99 <help><![CDATA[ | |
| 100 What it does | |
| 101 ============ | |
| 102 | |
| 103 Verifies that a file (dataset) matches an expected ISCC-CODE (International Standard Content Code) for exact content verification. This tool uses ISCC-SUM, which generates an ISCC-CODE containing Data-Code and Instance-Code units for bit-level file comparison. | |
| 104 | |
| 105 Exit Codes | |
| 106 ========== | |
| 107 | |
| 108 The tool uses exit codes for workflow logic: | |
| 109 | |
| 110 - **0**: Verification successful (OK - ISCC-CODEs match) | |
| 111 - **1**: Verification failed (FAILED - ISCC-CODEs do not match) | |
| 112 | |
| 113 Dataset Mapping | |
| 114 =============== | |
| 115 | |
| 116 When you provide a collection, Galaxy automatically runs verification once per dataset. All datasets are verified against the same expected ISCC-CODE. | |
| 117 | |
| 118 Output | |
| 119 ====== | |
| 120 | |
| 121 A verification report containing: | |
| 122 | |
| 123 - Filename (or element identifier) | |
| 124 - Expected ISCC-CODE | |
| 125 - Generated ISCC-CODE | |
| 126 - Status: OK or FAILED | |
| 127 | |
| 128 Example output:: | |
| 129 Status: OK - ISCC-CODEs match | |
| 130 | |
| 131 Expected: K4AOMGOGQJA4Y46PAC4YPPA63GKD5RVFPR7FU3I4OOEW44TYXNYOTMY | |
| 132 Generated: K4AOMGOGQJA4Y46PAC4YPPA63GKD5RVFPR7FU3I4OOEW44TYXNYOTMY | |
| 133 | |
| 134 Use Cases | |
| 135 ========= | |
| 136 | |
| 137 - Verify file integrity after transfer or storage | |
| 138 - Confirm downloaded datasets match reference ISCC-CODEs | |
| 139 - Validate that backups are identical to originals | |
| 140 - Quality control for data archiving | |
| 141 | |
| 142 Workflow Examples | |
| 143 ================= | |
| 144 | |
| 145 Verify a single dataset | |
| 146 ----------------------- | |
| 147 | |
| 148 :: | |
| 149 | |
| 150 Input: document.pdf | |
| 151 Expected ISCC-CODE: K4AOMG... | |
| 152 ↓ | |
| 153 [Verify ISCC-CODE] | |
| 154 ↓ | |
| 155 Output: "OK" or "FAILED" | |
| 156 | |
| 157 Verify against reference table | |
| 158 ------------------------------- | |
| 159 | |
| 160 Generate reference ISCC-CODEs first:: | |
| 161 | |
| 162 Original files → [Generate ISCC-CODE] → Reference ISCC-CODEs | |
| 163 | |
| 164 Later verify:: | |
| 165 | |
| 166 New datasets → [Generate ISCC-CODE] → New ISCC-CODEs | |
| 167 ↓ | |
| 168 [Join two Datasets] on filename | |
| 169 ↓ | |
| 170 Compare ISCC-CODE columns | |
| 171 ↓ | |
| 172 Result: Which files match/differ | |
| 173 | |
| 174 Working with ISCC-CODE Files in Workflows | |
| 175 ========================================== | |
| 176 | |
| 177 If you have the expected ISCC-CODE in a dataset (e.g., from Generate ISCC tool): | |
| 178 | |
| 179 1. In the workflow editor, connect the ISCC-CODE file to this tool | |
| 180 2. The ISCC-CODE file content will be used automatically | |
| 181 3. Or manually copy the ISCC-CODE from the file into the text field | |
| 182 | |
| 183 Important Notes | |
| 184 =============== | |
| 185 | |
| 186 - **Exact match only**: Any change to the file will cause verification to fail | |
| 187 - **Bit-level comparison**: Even metadata changes are detected | |
| 188 - **For similarity detection**: Use "Find similar ISCC-CODEs" tool instead | |
| 189 | |
| 190 More Information | |
| 191 ================ | |
| 192 | |
| 193 For details about ISCC: https://sum.iscc.codes/ and https://iscc.codes/ | |
| 194 For ISCC structure and subtypes: https://ieps.iscc.codes/iep-0001/ | |
| 195 ]]></help> | |
| 196 <expand macro="citations" /> | |
| 197 </tool> |
