From 198873c9992c9a4c5063b86b9ae9e2a4ab626a91 Mon Sep 17 00:00:00 2001 From: Arjun Prasad Date: Tue, 14 Jan 2025 13:54:37 -0500 Subject: [PATCH] Add Closest reference name back in Also some cosmetic changes to test_stxtyper.sh --- stxtyper.cpp | 3 ++- test/amrfinder_integration.expected | 12 ++++++------ test/amrfinder_integration2.expected | 12 ++++++------ test_stxtyper.sh | 10 +++++----- version.txt | 2 +- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/stxtyper.cpp b/stxtyper.cpp index 663a671..586e5f6 100644 --- a/stxtyper.cpp +++ b/stxtyper.cpp @@ -32,6 +32,7 @@ * Dependencies: NCBI BLAST, gunzip (optional) * * Release changes: +* 1.0.31 01/14/2025 PD-5215 "re-enable reporting Name of closest sequence" * 1.0.30 01/14/2025 PD-5215 "Closest reference accession" field should have two accessions separated by "," for two-subunit operons * 1.0.29 01/10/2025 PD-6215 "Name of closest sequence": na for two-subunit operons * 1.0.28 01/10/2025 PD-5215 blanks fields -> na; "Closest reference accession" is na for two-subunit operons @@ -605,7 +606,7 @@ struct Operon << refIdentity //17 "% Identity to reference sequence" << alignmentLen //18 "Alignment length" << refAccessions //19 "Accession of closest sequence" - << na /*"Shiga toxin " + genesymbol*/ //20 "Name of closest sequence" + << "Shiga toxin " + genesymbol //20 "Name of closest sequence" << na //21 "HMM id" << na //22 "HMM description" ; diff --git a/test/amrfinder_integration.expected b/test/amrfinder_integration.expected index 5274b4a..585a2cd 100644 --- a/test/amrfinder_integration.expected +++ b/test/amrfinder_integration.expected @@ -1,8 +1,8 @@ #Protein id Contig id Start Stop Strand Element symbol Element name Scope Type Subtype Class Subclass Method Target length Reference sequence length % Coverage of reference % Identity to reference Alignment length Closest reference accession Closest reference name HMM accession HMM description -NA partial 27 1048 + stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL 1022 NA NA 99.41 337 NA Shiga toxin stx2 NA NA -NA partial_contig_end 3 661 - stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL_CONTIG_END 659 NA NA 100.00 216 NA Shiga toxin stx2 NA NA -NA stx1a 218 1444 + stx1a_operon stx1a operon plus VIRULENCE STX_TYPE STX1 STX1A COMPLETE 1227 NA NA 100.00 406 NA Shiga toxin stx1a NA NA -NA stx2_fs 2165 3232 + stx2_operon stx2 operon with frameshift plus VIRULENCE STX_TYPE STX2 STX2 FRAMESHIFT 1068 NA NA 99.15 355 NA Shiga toxin stx2c NA NA -NA stx2_novel 216 1456 + stx2_operon Novel stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 COMPLETE_NOVEL 1241 NA NA 99.76 410 NA Shiga toxin stx2c NA NA +NA partial 27 1048 + stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL 1022 NA NA 99.41 337 AAA16362.1,AAS07607.1 Shiga toxin stx2 NA NA +NA partial_contig_end 3 661 - stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL_CONTIG_END 659 NA NA 100.00 216 AAM70046.1,AAA16362.1 Shiga toxin stx2 NA NA +NA stx1a 218 1444 + stx1a_operon stx1a operon plus VIRULENCE STX_TYPE STX1 STX1A COMPLETE 1227 NA NA 100.00 406 AAA98347.1,AAA71894.1 Shiga toxin stx1a NA NA +NA stx2_fs 2165 3232 + stx2_operon stx2 operon with frameshift plus VIRULENCE STX_TYPE STX2 STX2 FRAMESHIFT 1068 NA NA 99.15 355 AAG01033.1,AAA16363.1 Shiga toxin stx2c NA NA +NA stx2_novel 216 1456 + stx2_operon Novel stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 COMPLETE_NOVEL 1241 NA NA 99.76 410 AAA19623.1,AAA16363.1 Shiga toxin stx2c NA NA NA stx2_stop 694 1653 + stx2_operon stx2 operon with internal stop plus VIRULENCE STX_TYPE STX2 STX2 INTERNAL_STOP 960 NA NA 91.25 320 AUM09788.1 Shiga toxin stx2h subunit A NA NA -NA stx2c 1298 2538 - stx2c_operon stx2c operon plus VIRULENCE STX_TYPE STX2 STX2C COMPLETE 1241 NA NA 100.00 410 NA Shiga toxin stx2c NA NA +NA stx2c 1298 2538 - stx2c_operon stx2c operon plus VIRULENCE STX_TYPE STX2 STX2C COMPLETE 1241 NA NA 100.00 410 AAA16363.1,AAS07596.1 Shiga toxin stx2c NA NA diff --git a/test/amrfinder_integration2.expected b/test/amrfinder_integration2.expected index d8c69fc..03d386e 100644 --- a/test/amrfinder_integration2.expected +++ b/test/amrfinder_integration2.expected @@ -1,8 +1,8 @@ #Protein id Contig id Start Stop Strand Element symbol Element name Scope Type Subtype Class Subclass Method Target length Reference sequence length % Coverage of reference % Identity to reference Alignment length Closest reference accession Closest reference name HMM accession HMM description Hierarchy node -NA partial 27 1048 + stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL 1022 NA NA 99.41 337 NA Shiga toxin stx2 NA NA stxA2c::stxB2a -NA partial_contig_end 3 661 - stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL_CONTIG_END 659 NA NA 100.00 216 NA Shiga toxin stx2 NA NA stxB2a::stxA2c -NA stx1a 218 1444 + stx1a_operon stx1a operon plus VIRULENCE STX_TYPE STX1 STX1A COMPLETE 1227 NA NA 100.00 406 NA Shiga toxin stx1a NA NA stxA1a::stxB1a -NA stx2_fs 2165 3232 + stx2_operon stx2 operon with frameshift plus VIRULENCE STX_TYPE STX2 STX2 FRAMESHIFT 1068 NA NA 99.15 355 NA Shiga toxin stx2c NA NA stxA2c::stxB2c -NA stx2_novel 216 1456 + stx2_operon Novel stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 COMPLETE_NOVEL 1241 NA NA 99.76 410 NA Shiga toxin stx2c NA NA stxA2c::stxB2c +NA partial 27 1048 + stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL 1022 NA NA 99.41 337 AAA16362.1,AAS07607.1 Shiga toxin stx2 NA NA stxA2c::stxB2a +NA partial_contig_end 3 661 - stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL_CONTIG_END 659 NA NA 100.00 216 AAM70046.1,AAA16362.1 Shiga toxin stx2 NA NA stxB2a::stxA2c +NA stx1a 218 1444 + stx1a_operon stx1a operon plus VIRULENCE STX_TYPE STX1 STX1A COMPLETE 1227 NA NA 100.00 406 AAA98347.1,AAA71894.1 Shiga toxin stx1a NA NA stxA1a::stxB1a +NA stx2_fs 2165 3232 + stx2_operon stx2 operon with frameshift plus VIRULENCE STX_TYPE STX2 STX2 FRAMESHIFT 1068 NA NA 99.15 355 AAG01033.1,AAA16363.1 Shiga toxin stx2c NA NA stxA2c::stxB2c +NA stx2_novel 216 1456 + stx2_operon Novel stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 COMPLETE_NOVEL 1241 NA NA 99.76 410 AAA19623.1,AAA16363.1 Shiga toxin stx2c NA NA stxA2c::stxB2c NA stx2_stop 694 1653 + stx2_operon stx2 operon with internal stop plus VIRULENCE STX_TYPE STX2 STX2 INTERNAL_STOP 960 NA NA 91.25 320 AUM09788.1 Shiga toxin stx2h subunit A NA NA stxA2h -NA stx2c 1298 2538 - stx2c_operon stx2c operon plus VIRULENCE STX_TYPE STX2 STX2C COMPLETE 1241 NA NA 100.00 410 NA Shiga toxin stx2c NA NA stxB2c::stxA2a +NA stx2c 1298 2538 - stx2c_operon stx2c operon plus VIRULENCE STX_TYPE STX2 STX2C COMPLETE 1241 NA NA 100.00 410 AAA16363.1,AAS07596.1 Shiga toxin stx2c NA NA stxB2c::stxA2a diff --git a/test_stxtyper.sh b/test_stxtyper.sh index 7612c60..4c6930d 100755 --- a/test_stxtyper.sh +++ b/test_stxtyper.sh @@ -38,10 +38,10 @@ FAILURES=0 TESTS=0 TEST_TEXT='' -echo "TERM=$TERM" +# echo "TERM=$TERM" # some color macros -if [ "$TERM" == "" ] || [ "$TERM" == "dumb" ] +if [ "$TERM" == "" ] || [ "$TERM" == "dumb" ] || [ ! -t 1 ] then green='' # no colors red='' @@ -62,7 +62,7 @@ function test_input_file { then echo "${red}not ok: $STXTYPER returned a non-zero exit value indicating a failure of the software${reset}" echo "# $STXTYPER $options -n test/$test_base.fa > test/$test_base.got" - TEST_TEXT="$TEST_TEXT"$'\n'"Failed $test_base" + TEST_TEXT="$TEST_TEXT"$'\n'"${red}Failed $test_base${reset}" return 1 else if ! diff -q "test/$test_base.expected" "test/$test_base.got" @@ -73,7 +73,7 @@ function test_input_file { diff "test/$test_base.expected" "test/$test_base.got" echo "# To approve run:" echo "# mv test/$test_base.got test/$test_base.expected " - TEST_TEXT="$TEST_TEXT"$'\n'"Failed $test_base" + TEST_TEXT="$TEST_TEXT"$'\n'"${red}Failed $test_base${reset}" return 1 else echo "${green}ok:${reset} test/$test_base.fa" @@ -95,7 +95,7 @@ then diff "test/basic.nuc_out.expected" "test/basic.nuc_out.got" echo "# To approve run:" echo "# mv test/basic.nuc_out.got test/basic.nuc_out.expected " - TEST_TEXT="$TEST_TEXT"$'\n'"Failed basic --nucleotide_output test" + TEST_TEXT="$TEST_TEXT"$'\n'"${red}Failed basic --nucleotide_output test${reset}" FAILURES=$(( $FAILURES + 1 )) else echo "${green}ok:${reset} --nucleotide_output test/basic.nuc_out.got options worked" diff --git a/version.txt b/version.txt index 475bda9..9495615 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.30 +1.0.31