From c876f93de934c87aff1462f481ddaaeaaa7473b7 Mon Sep 17 00:00:00 2001 From: Hasindu Gamaarachchi Date: Sat, 12 Aug 2023 10:36:18 +1000 Subject: [PATCH] update slow5lib and --index option for get --- README.md | 2 +- docs/commands.md | 2 ++ docs/getting_started.md | 2 +- slow5lib | 2 +- src/get.c | 27 +++++++++++++++++---- test/test.sh | 26 ++++++++++++++++++++ test/test_all.sh | 24 +++++++++++++++++- test/test_cat.sh | 28 ++++++++++++++++++++- test/test_extensive.sh | 24 ++++++++++++++++++ test/test_f2s.sh | 27 +++++++++++++++++++++ test/test_f2s_s2f_integrity.sh | 27 +++++++++++++++++++++ test/test_f2s_view_diff.sh | 26 ++++++++++++++++++++ test/test_get.sh | 39 ++++++++++++++++++++++++++++++ test/test_index.sh | 27 +++++++++++++++++++++ test/test_merge.sh | 30 +++++++++++++++++++++-- test/test_merge_split_integrity.sh | 27 +++++++++++++++++++++ test/test_quickcheck.sh | 26 ++++++++++++++++++++ test/test_s2f.sh | 27 +++++++++++++++++++++ test/test_skim.sh | 26 ++++++++++++++++++++ test/test_split.sh | 27 +++++++++++++++++++++ test/test_stats.sh | 26 ++++++++++++++++++++ test/test_view.sh | 26 ++++++++++++++++++++ test/test_view_integrity.sh | 26 ++++++++++++++++++++ test/test_with_guppy.sh | 26 ++++++++++++++++++++ 24 files changed, 538 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8b4caad8..b0c53342 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Full documentation: https://hasindu2008.github.io/slow5tools
Publication (SLOW5 format): https://www.nature.com/articles/s41587-021-01147-4
Publication (slow5tools): https://genomebiology.biomedcentral.com/articles/10.1186/s13059-023-02910-3
SLOW5 specification: https://hasindu2008.github.io/slow5specs
-slow5lib: https://github.com/hasindu2008/slow5lib
+slow5 ecosystem: https://hasindu2008.github.io/slow5
To convert to and from ONT's new POD5 format, you use [blue_crab](https://github.com/Psy-Fer/blue-crab). If POD5 format and the associated POD5 C/C++ API reaches maturity/stability and adheres to C++11 standard, capabilities for POD5 <-> SLOW5 conversion will be added to slow5tools. slow5tools is strictly adhering to C++11 standard for wider compatibility. diff --git a/docs/commands.md b/docs/commands.md index 5d0d6fce..a7fd5fed 100755 --- a/docs/commands.md +++ b/docs/commands.md @@ -170,6 +170,8 @@ slow5tools get [OPTIONS] file1.blow5 --list readids.txt The batch size. This is the number of records on the memory at once [default value: 4096]. An increased batch size improves multi-threaded performance at cost of higher RAM. * `-l, --list FILE`:
List of read ids provided as a single-column text file with one read id per line. +* `--index FILE`:
+ Path to a custom slow5 index (experimental). Useful if your index file is located somewhere other than in the same directory as the input S/BLOW5 file. * `-h`, `--help`:
Prints the help menu. diff --git a/docs/getting_started.md b/docs/getting_started.md index 95806cd1..bb35e49c 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -10,7 +10,7 @@ SLOW5 is a new file format for storing signal data from Oxford Nanopore Technolo Publication (SLOW5 format): https://www.nature.com/articles/s41587-021-01147-4
Publication (slow5tools): https://genomebiology.biomedcentral.com/articles/10.1186/s13059-023-02910-3
SLOW5 specification: https://hasindu2008.github.io/slow5specs
-slow5lib: https://github.com/hasindu2008/slow5lib
+slow5 ecosystem: https://hasindu2008.github.io/slow5
To convert to and from ONT's new POD5 format, you use [blue_crab](https://github.com/Psy-Fer/blue-crab). If POD5 format and the associated POD5 C/C++ API reaches maturity/stability and adheres to C++11 standard, capabilities for POD5 <-> SLOW5 conversion will be added to slow5tools. slow5tools is strictly adhering to C++11 standard for wider compatibility. diff --git a/slow5lib b/slow5lib index d67f1203..20d63c64 160000 --- a/slow5lib +++ b/slow5lib @@ -1 +1 @@ -Subproject commit d67f12037a1bd03ad5b8c049c8fe11d0e9617309 +Subproject commit 20d63c64457967a6fe66402bd4866281c93918aa diff --git a/src/get.c b/src/get.c index 8546275b..5c22b881 100644 --- a/src/get.c +++ b/src/get.c @@ -28,6 +28,7 @@ HELP_MSG_BATCH \ " -l --list [FILE] list of read ids provided as a single-column text file with one read id per line.\n" \ " --skip warn and continue if a read_id was not found.\n" \ + " --index [FILE] path to a custom slow5 index (experimental).\n" \ HELP_MSG_HELP \ HELP_FORMATS_METHODS @@ -117,6 +118,7 @@ int get_main(int argc, char **argv, struct program_meta *meta) { {"threads", required_argument, NULL, 't' }, //7 {"help", no_argument, NULL, 'h' }, //8 {"benchmark", no_argument, NULL, 'e' }, //9 + {"index", required_argument, NULL, 0 }, //10 {NULL, 0, NULL, 0 } }; @@ -128,6 +130,7 @@ int get_main(int argc, char **argv, struct program_meta *meta) { // Input arguments char* read_list_file_in = NULL; + const char *slow5_index = NULL; int opt; int longindex = 0; @@ -173,8 +176,12 @@ int get_main(int argc, char **argv, struct program_meta *meta) { case 6: skip_flag = 1; break; + case 10: + slow5_index = optarg; + break; } break; + default: // case '?' fprintf(stderr, HELP_SMALL_MSG, argv[0]); EXIT_MSG(EXIT_FAILURE, argv, meta); @@ -274,11 +281,21 @@ int get_main(int argc, char **argv, struct program_meta *meta) { } } - int ret_idx = slow5_idx_load(slow5file); - if (ret_idx < 0) { - ERROR("Error loading index file for %s\n", f_in_name); - EXIT_MSG(EXIT_FAILURE, argv, meta); - return EXIT_FAILURE; + if(slow5_index == NULL){ + int ret_idx = slow5_idx_load(slow5file); + if (ret_idx < 0) { + ERROR("Error loading index file for %s\n", f_in_name); + EXIT_MSG(EXIT_FAILURE, argv, meta); + return EXIT_FAILURE; + } + } else { + WARNING("%s","Loading index from custom path is an experimental feature. keep an eye."); + int ret_idx = slow5_idx_load_with(slow5file, slow5_index); + if (ret_idx < 0) { + ERROR("Error loading index file for %s from file path %s\n", f_in_name, slow5_index); + EXIT_MSG(EXIT_FAILURE, argv, meta); + return EXIT_FAILURE; + } } if (read_stdin) { diff --git a/test/test.sh b/test/test.sh index f9ab2422..3518a025 100755 --- a/test/test.sh +++ b/test/test.sh @@ -1,5 +1,31 @@ #!/bin/sh +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + FIRST_FAILED_SET_OF_TESTCASES="NOT SET" FLAG_FIRST_FAILED_SET_OF_TESTCASES=0 diff --git a/test/test_all.sh b/test/test_all.sh index 8662b526..447ce2b9 100755 --- a/test/test_all.sh +++ b/test/test_all.sh @@ -1,6 +1,28 @@ #!/bin/bash -# @author: Hiruna Samarakoon (hirunas@eng.pdn.ac.lk) +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. ############################################################################### diff --git a/test/test_cat.sh b/test/test_cat.sh index 5b2aefd5..a1e10191 100755 --- a/test/test_cat.sh +++ b/test/test_cat.sh @@ -1,5 +1,31 @@ #!/bin/bash +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # steps # cat slow5 files # cat blow5 files @@ -11,7 +37,7 @@ RED='\033[0;31m' ; GREEN='\033[0;32m' ; NC='\033[0m' # No Color die() { echo -e "${RED}$1${NC}" >&2 ; echo ; exit 1 ; } # terminate script info() { echo ; echo -e "${GREEN}$1${NC}" >&2 ; } # Relative path to "slow5/tests/" -REL_PATH="$(dirname $0)/" +REL_PATH="$(dirname $0)/" #...directories files tools arguments commands clean OUTPUT_DIR="$REL_PATH/data/out/cat" diff --git a/test/test_extensive.sh b/test/test_extensive.sh index 7cbe8029..44e7c173 100755 --- a/test/test_extensive.sh +++ b/test/test_extensive.sh @@ -1,5 +1,29 @@ #!/bin/bash +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + ############################################################################### Usage="test_extensive.sh" diff --git a/test/test_f2s.sh b/test/test_f2s.sh index 39a85705..a739c24e 100755 --- a/test/test_f2s.sh +++ b/test/test_f2s.sh @@ -1,4 +1,31 @@ #!/bin/bash + +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # Run f2s with different file, input and output formats. Usage="test_s2f.sh" diff --git a/test/test_f2s_s2f_integrity.sh b/test/test_f2s_s2f_integrity.sh index e4b98c96..de09f171 100755 --- a/test/test_f2s_s2f_integrity.sh +++ b/test/test_f2s_s2f_integrity.sh @@ -1,4 +1,31 @@ #!/bin/bash + +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # Run f2s, s2f, and again f2s and check if first produced slow5s are same as the last set. Usage1="f2s_s2f_integrity_test.sh" Usage2="f2s_s2f_integrity_test.sh [path to fast5 directory] [path to create a temporary directory][-c or --to (optional) [clean_fscache -f (optional)]" diff --git a/test/test_f2s_view_diff.sh b/test/test_f2s_view_diff.sh index ebf7eea1..aca2b19a 100755 --- a/test/test_f2s_view_diff.sh +++ b/test/test_f2s_view_diff.sh @@ -1,5 +1,31 @@ #!/bin/bash +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # steps # f2s fast5 to blow5 # view blow5 to slow5 diff --git a/test/test_get.sh b/test/test_get.sh index 8e5f51a7..0bf5d617 100755 --- a/test/test_get.sh +++ b/test/test_get.sh @@ -1,4 +1,31 @@ #!/bin/bash + +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # Run f2s with different file, input and output formats. Usage="get_test.sh" @@ -131,5 +158,17 @@ $SLOW5_EXEC get "$RAW_DIR/example2.slow5" --skip --list "$RAW_DIR/list_with_inva slow5tools_quickcheck $OUTPUT_DIR info "testcase $TESTCASE passed" +TESTCASE=9 +info "------------------- slow5tools get testcase $TESTCASE -------------------" +$SLOW5_EXEC get "$RAW_DIR/example2.slow5" --index $RAW_DIR/example2.slow5.idx r1 r5 r3 --to blow5 -c zlib -s none > "$OUTPUT_DIR/extracted_reads2.blow5" || die "testcase $TESTCASE failed" +slow5tools_quickcheck $OUTPUT_DIR +diff -q "$EXP_DIR/expected_extracted_reads.blow5" "$OUTPUT_DIR/extracted_reads2.blow5" &>/dev/null +if [ $? -ne 0 ]; then + info "${RED}ERROR: diff failed for 'slow5tools get testcase $TESTCASE'${NC}" + exit 1 +fi +info "testcase $TESTCASE passed" + + rm -r $OUTPUT_DIR || die "Removing $OUTPUT_DIR failed" 1>&3 2>&4 exit 0 diff --git a/test/test_index.sh b/test/test_index.sh index fde64368..da49df93 100755 --- a/test/test_index.sh +++ b/test/test_index.sh @@ -1,4 +1,31 @@ #!/bin/bash + +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # test slow5 index # Relative path to "slow5/tests/" diff --git a/test/test_merge.sh b/test/test_merge.sh index f329f0eb..9d2734b7 100755 --- a/test/test_merge.sh +++ b/test/test_merge.sh @@ -1,5 +1,31 @@ #!/bin/bash +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # steps # run merge for different testcases # diff @@ -49,7 +75,7 @@ fi # quick check if redundant here as we any way do a diff slow5tools_quickcheck() { if $REL_PATH/../slow5tools quickcheck $1; then - echo -e "${GREEN}SUCCESS: slow5tools_quickcheck passed!${NC}" + echo -e "${GREEN}SUCCESS: slow5tools_quickcheck passed!${NC}" else echo -e "${RED}ERROR: slow5tools_quickcheck failed${NC}" 1>&3 2>&4 exit 1 @@ -182,7 +208,7 @@ $SLOW5_EXEC merge $INPUT_FILES -o $OUTPUT_DIR/merged_output_enum2.slow5 || die " diff -q $REL_PATH/data/exp/merge/merged_output_enum2.slow5 $OUTPUT_DIR/merged_output_enum2.slow5 || die "testcase $TESTCASE: diff for $TESTNAME failed" echo -e "${GREEN}testcase $TESTCASE passed${NC}" 1>&3 2>&4 -# enum different labels +# enum different labels TESTCASE=2.3 TESTNAME="different enum labels" info "-------------------testcase $TESTCASE: $TESTNAME-------------------" diff --git a/test/test_merge_split_integrity.sh b/test/test_merge_split_integrity.sh index b9e2a762..ff2662dd 100755 --- a/test/test_merge_split_integrity.sh +++ b/test/test_merge_split_integrity.sh @@ -1,4 +1,31 @@ #!/bin/bash + +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # Run merge, split, merge, split and again merge and check if the original merged output is same as the last. # We cannot directly compare after the first two merges because the merged files are not sorted according to the run_ids, hence could be different. Usage="merge_split_integrity_test.sh [path to slow5 directory] [path to create a temporary directory] [path to slow5tools executable]" diff --git a/test/test_quickcheck.sh b/test/test_quickcheck.sh index 63721fde..f3967ed8 100755 --- a/test/test_quickcheck.sh +++ b/test/test_quickcheck.sh @@ -1,5 +1,31 @@ #!/bin/bash +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # steps # run quickcheck program # diff ouput with the expected diff --git a/test/test_s2f.sh b/test/test_s2f.sh index f6b12e72..c877a0cb 100755 --- a/test/test_s2f.sh +++ b/test/test_s2f.sh @@ -1,4 +1,31 @@ #!/bin/bash + +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # Run s2f with different file, input and output formats. Usage="test_s2f.sh" diff --git a/test/test_skim.sh b/test/test_skim.sh index b10a6b24..16a93ed9 100644 --- a/test/test_skim.sh +++ b/test/test_skim.sh @@ -1,5 +1,31 @@ #!/bin/bash +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # steps # run stats program # diff ouput with the expected diff --git a/test/test_split.sh b/test/test_split.sh index f5404340..f3a273f3 100755 --- a/test/test_split.sh +++ b/test/test_split.sh @@ -1,4 +1,31 @@ #!/bin/bash + +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # WARNING: this file should be stored inside test directory # WARNING: the executable should be found at ../ # WARNING: expected slow5s/directories should be found at ./data/exp/split diff --git a/test/test_stats.sh b/test/test_stats.sh index f5081911..07ec5fb7 100755 --- a/test/test_stats.sh +++ b/test/test_stats.sh @@ -1,5 +1,31 @@ #!/bin/bash +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # steps # run stats program # diff ouput with the expected diff --git a/test/test_view.sh b/test/test_view.sh index 74f9a2e3..8aebded5 100755 --- a/test/test_view.sh +++ b/test/test_view.sh @@ -1,5 +1,31 @@ #!/bin/bash +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # Testing output of slow5tools S5T='./slow5tools' diff --git a/test/test_view_integrity.sh b/test/test_view_integrity.sh index d83a2534..51457ffb 100755 --- a/test/test_view_integrity.sh +++ b/test/test_view_integrity.sh @@ -1,5 +1,31 @@ #!/bin/bash +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # steps # view slow5 # view blow5 diff --git a/test/test_with_guppy.sh b/test/test_with_guppy.sh index 7867f51f..58c9ae50 100755 --- a/test/test_with_guppy.sh +++ b/test/test_with_guppy.sh @@ -1,5 +1,31 @@ #!/bin/bash +# MIT License + +# Copyright (c) 2020 Hiruna Samarakoon +# Copyright (c) 2020 Sasha Jenner +# Copyright (c) 2020,2023 Hasindu Gamaarachchi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +############################################################################### + # @author: Hiruna Samarakoon (hirunas@eng.pdn.ac.lk) ###############################################################################