Skip to content

Commit ba33f57

Browse files
authored
Merge pull request #6 from ncbi/dev
Updates to --amrfinder output preparing for new AMRFinderPlus release
2 parents cdcc132 + 94ac374 commit ba33f57

File tree

8 files changed

+133
-29
lines changed

8 files changed

+133
-29
lines changed

.github/workflows/conda.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Bioconda
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '30 10 * * *' #
7+
repository_dispatch:
8+
types: [linux-bioconda-test, install-test]
9+
jobs:
10+
x86_linux:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: When was this run
14+
run: date
15+
- name: configure conda
16+
run: |
17+
. $CONDA/bin/activate
18+
conda config --add channels defaults
19+
conda config --add channels bioconda
20+
conda config --add channels conda-forge
21+
- name: install StxTyper
22+
run: |
23+
. $CONDA/bin/activate
24+
conda install --update-deps -c conda-forge -c bioconda --strict-channel-priority -y ncbi-stxtyper
25+
stxtyper --version
26+
- name: download tests
27+
run: |
28+
BASE_URL=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/master
29+
curl --silent --location -O ${BASE_URL}/test_stxtyper.sh
30+
- name: run tests
31+
run: |
32+
source /usr/share/miniconda/bin/activate
33+
echo CONDA_PREFIX = $CONDA_PREFIX
34+
bash ./test_stxtyper.sh path
35+
x86_mac:
36+
runs-on: macos-latest
37+
steps:
38+
- name: Install conda b/c built-in conda was borked
39+
run: |
40+
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
41+
bash ./Miniconda3-latest-MacOSX-x86_64.sh -b -p /Users/runner/miniconda3
42+
- name: Configure conda
43+
run: |
44+
source /Users/runner/miniconda3/bin/activate
45+
conda init
46+
# THIS DOESN"T WORK! Just install miniconda myself
47+
# . $CONDA/bin/activate
48+
conda config --add channels defaults
49+
conda config --add channels bioconda
50+
conda config --add channels conda-forge
51+
# permissions are messed up on the mac runner
52+
# Is this faster than installing miniconda myself?
53+
# sudo chown -R 501:20 $CONDA
54+
conda update conda
55+
- name: Install StxTyper
56+
run: |
57+
source /Users/runner/miniconda3/bin/activate
58+
conda install --update-deps -c bioconda -c conda-forge -y ncbi-stxtyper
59+
- name: Download tests
60+
run: |
61+
BASE_URL=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/master
62+
curl --silent --location -O ${BASE_URL}/test_stxtyper.sh
63+
- name: Run tests
64+
run: |
65+
source /Users/runner/miniconda3/bin/activate
66+
echo CONDA_PREFIX = $CONDA_PREFIX
67+
bash ./test_stxtyper.sh path
68+
69+
70+

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,17 @@ all: $(BINARIES)
9090

9191
common.o: common.hpp common.inc
9292

93-
stxtyper.o: common.hpp common.inc
93+
stxtyper.o: common.hpp common.inc amrfinder_columns.hpp tsv.hpp version.txt
9494
stxtyperOBJS=stxtyper.o common.o tsv.o
9595
stxtyper: $(stxtyperOBJS)
9696
$(CXX) -o $@ $(stxtyperOBJS) -pthread $(DBDIR)
9797

98-
fasta_check.o: common.hpp common.inc
98+
fasta_check.o: common.hpp common.inc version.txt
9999
fasta_checkOBJS=fasta_check.o common.o
100100
fasta_check: $(fasta_checkOBJS)
101101
$(CXX) -o $@ $(fasta_checkOBJS)
102102

103-
fasta_extract.o: common.hpp common.inc
103+
fasta_extract.o: common.hpp common.inc version.txt
104104
fasta_extractOBJS=fasta_extract.o common.o
105105
fasta_extract: $(fasta_extractOBJS)
106106
$(CXX) -o $@ $(fasta_extractOBJS)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
StxTyper is used to determine stx type from nucleotide sequence. Stx (Shiga-toxin) genes are found in some strains of _Escherichia coli_ and code for powerful toxins that can cause severe illness. StxTyper is software to classify these genes from assembled sequence using a standard algorithm.
44

5+
## WARNING: This is currently beta software and changes and new releases may come quickly. Please report any issues or comments to [email protected] or open an issue on GitHub.
6+
57
# Installation
68

79
## Installing with Bioconda

amrfinder_columns.hpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// AMRFinderPlus column names
2+
// PD-5085
3+
4+
constexpr const char* prot_colName = "Protein id"; // PD-2534
5+
constexpr const char* contig_colName = "Contig id";
6+
// Target
7+
constexpr const char* start_colName = "Start";
8+
constexpr const char* stop_colName = "Stop";
9+
constexpr const char* strand_colName = "Strand";
10+
//
11+
constexpr const char* genesymbol_colName = "Element symbol"; // PD-4924
12+
constexpr const char* elemName_colName = "Element name"; // PD-4910
13+
constexpr const char* scope_colName = "Scope"; // PD-2825
14+
// PD-1856
15+
constexpr const char* type_colName = "Type";
16+
constexpr const char* subtype_colName = "Subtype";
17+
constexpr const char* class_colName = "Class";
18+
constexpr const char* subclass_colName = "Subclass";
19+
//
20+
constexpr const char* method_colName = "Method";
21+
constexpr const char* targetLen_colName = "Element length"; // was: "Target length" ??
22+
constexpr const char* refLen_colName = "Reference sequence length";
23+
constexpr const char* refCov_colName = "% Coverage of reference";
24+
constexpr const char* refIdent_colName = "% Identity to reference";
25+
constexpr const char* alignLen_colName = "Alignment length";
26+
constexpr const char* closestRefAccession_colName = "Closest reference accession";
27+
constexpr const char* closestRefName_colName = "Closest reference name";
28+
constexpr const char* hmmAccession_colName = "HMM accession";
29+
constexpr const char* hmmDescr_colName = "HMM description";
30+
constexpr const char* hierarchyNode_colName = "Hierarchy node";

stxtyper.cpp

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* Dependencies: NCBI BLAST, gunzip (optional)
3333
*
3434
* Release changes:
35+
* 1.0.25 08/16/2024 PD-5085 AMRFinderPlus column names to match MicroBIGG-E
3536
* 1.0.24 08/05/2024 PD-5076 "na" -> "NA"
3637
* 1.0.23 07/29/2024 PD-5064 AMBIGUOUS operon type
3738
* 1.0.22 07/25/2024 First codon L|I|V -> M
@@ -94,6 +95,7 @@
9495
#include "common.hpp"
9596
#include "tsv.hpp"
9697
using namespace Common_sp;
98+
#include "amrfinder_columns.hpp"
9799

98100
#include "common.inc"
99101

@@ -950,31 +952,31 @@ struct ThisApplication : ShellApplication
950952
td << "name";
951953
if (amrfinder)
952954
{
953-
td << /* 1*/ "Protein identifier"
954-
<< /* 2*/ "Contig id"
955-
<< /* 3*/ "Start"
956-
<< /* 4*/ "Stop"
957-
<< /* 5*/ "Strand"
958-
<< /* 6*/ "Element symbol" // PD-4924
959-
<< /* 7*/ "Element name" // PD-4910
960-
<< /* 8*/ "Scope"
961-
<< /* 9*/ "Element type"
962-
<< /*10*/ "Element subtype"
963-
<< /*11*/ "Class"
964-
<< /*12*/ "Subclass"
965-
<< /*13*/ "Method"
966-
<< /*14*/ "Target length"
967-
<< /*15*/ "Reference sequence length"
968-
<< /*16*/ "% Coverage of reference sequence"
969-
<< /*17*/ "% Identity to reference sequence"
970-
<< /*18*/ "Alignment length"
971-
<< /*19*/ "Accession of closest sequence"
972-
<< /*20*/ "Name of closest sequence"
973-
<< /*21*/ "HMM id"
974-
<< /*22*/ "HMM description"
955+
td << /* 1*/ prot_colName
956+
<< /* 2*/ contig_colName
957+
<< /* 3*/ start_colName
958+
<< /* 4*/ stop_colName
959+
<< /* 5*/ strand_colName
960+
<< /* 6*/ genesymbol_colName
961+
<< /* 7*/ elemName_colName
962+
<< /* 8*/ scope_colName
963+
<< /* 9*/ type_colName
964+
<< /*10*/ subtype_colName
965+
<< /*11*/ class_colName
966+
<< /*12*/ subclass_colName
967+
<< /*13*/ method_colName
968+
<< /*14*/ targetLen_colName
969+
<< /*15*/ refLen_colName
970+
<< /*16*/ refCov_colName
971+
<< /*17*/ refIdent_colName
972+
<< /*18*/ alignLen_colName
973+
<< /*19*/ closestRefAccession_colName
974+
<< /*20*/ closestRefName_colName
975+
<< /*21*/ hmmAccession_colName
976+
<< /*22*/ hmmDescr_colName
975977
;
976978
if (print_node)
977-
td << "Hierarchy node";
979+
td << hierarchyNode_colName;
978980
}
979981
else
980982
td << "target_contig"

test/amrfinder_integration.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Protein identifier Contig id Start Stop Strand Element symbol Element name Scope Element type Element subtype Class Subclass Method Target length Reference sequence length % Coverage of reference sequence % Identity to reference sequence Alignment length Accession of closest sequence Name of closest sequence HMM id HMM description
1+
#Protein id Contig id Start Stop Strand Element symbol Element name Scope Type Subtype Class Subclass Method Element length Reference sequence length % Coverage of reference % Identity to reference Alignment length Closest reference accession Closest reference name HMM accession HMM description
22
NA partial 27 1048 + stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL 1022 99.41 337 AAA16362.1, AAS07607.1 Shiga toxin stx2 NA NA
33
NA partial_contig_end 3 661 - stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL_CONTIG_END 659 100.00 216 AAM70046.1, AAA16362.1 Shiga toxin stx2 NA NA
44
NA stx1a 218 1444 + stx1a_operon stx1a operon plus VIRULENCE STX_TYPE STX1 STX1A COMPLETE 1227 100.00 406 AAA98347.1, AAA71894.1 Shiga toxin stx1a NA NA

test/amrfinder_integration2.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Protein identifier Contig id Start Stop Strand Element symbol Element name Scope Element type Element subtype Class Subclass Method Target length Reference sequence length % Coverage of reference sequence % Identity to reference sequence Alignment length Accession of closest sequence Name of closest sequence HMM id HMM description Hierarchy node
1+
#Protein id Contig id Start Stop Strand Element symbol Element name Scope Type Subtype Class Subclass Method Element length Reference sequence length % Coverage of reference % Identity to reference Alignment length Closest reference accession Closest reference name HMM accession HMM description Hierarchy node
22
NA partial 27 1048 + stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL 1022 99.41 337 AAA16362.1, AAS07607.1 Shiga toxin stx2 NA NA stxA2c, stxB2a
33
NA partial_contig_end 3 661 - stx2_operon Partial stx2 operon plus VIRULENCE STX_TYPE STX2 STX2 PARTIAL_CONTIG_END 659 100.00 216 AAM70046.1, AAA16362.1 Shiga toxin stx2 NA NA stxB2a, stxA2c
44
NA stx1a 218 1444 + stx1a_operon stx1a operon plus VIRULENCE STX_TYPE STX1 STX1A COMPLETE 1227 100.00 406 AAA98347.1, AAA71894.1 Shiga toxin stx1a NA NA stxA1a, stxB1a

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.24
1+
1.0.25

0 commit comments

Comments
 (0)