Skip to content

Commit

Permalink
Merge pull request #6 from ncbi/dev
Browse files Browse the repository at this point in the history
Updates to --amrfinder output preparing for new AMRFinderPlus release
  • Loading branch information
evolarjun authored Oct 18, 2024
2 parents cdcc132 + 94ac374 commit ba33f57
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 29 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Bioconda

on:
workflow_dispatch:
schedule:
- cron: '30 10 * * *' #
repository_dispatch:
types: [linux-bioconda-test, install-test]
jobs:
x86_linux:
runs-on: ubuntu-latest
steps:
- name: When was this run
run: date
- name: configure conda
run: |
. $CONDA/bin/activate
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
- name: install StxTyper
run: |
. $CONDA/bin/activate
conda install --update-deps -c conda-forge -c bioconda --strict-channel-priority -y ncbi-stxtyper
stxtyper --version
- name: download tests
run: |
BASE_URL=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/master
curl --silent --location -O ${BASE_URL}/test_stxtyper.sh
- name: run tests
run: |
source /usr/share/miniconda/bin/activate
echo CONDA_PREFIX = $CONDA_PREFIX
bash ./test_stxtyper.sh path
x86_mac:
runs-on: macos-latest
steps:
- name: Install conda b/c built-in conda was borked
run: |
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash ./Miniconda3-latest-MacOSX-x86_64.sh -b -p /Users/runner/miniconda3
- name: Configure conda
run: |
source /Users/runner/miniconda3/bin/activate
conda init
# THIS DOESN"T WORK! Just install miniconda myself
# . $CONDA/bin/activate
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
# permissions are messed up on the mac runner
# Is this faster than installing miniconda myself?
# sudo chown -R 501:20 $CONDA
conda update conda
- name: Install StxTyper
run: |
source /Users/runner/miniconda3/bin/activate
conda install --update-deps -c bioconda -c conda-forge -y ncbi-stxtyper
- name: Download tests
run: |
BASE_URL=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/master
curl --silent --location -O ${BASE_URL}/test_stxtyper.sh
- name: Run tests
run: |
source /Users/runner/miniconda3/bin/activate
echo CONDA_PREFIX = $CONDA_PREFIX
bash ./test_stxtyper.sh path
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ all: $(BINARIES)

common.o: common.hpp common.inc

stxtyper.o: common.hpp common.inc
stxtyper.o: common.hpp common.inc amrfinder_columns.hpp tsv.hpp version.txt
stxtyperOBJS=stxtyper.o common.o tsv.o
stxtyper: $(stxtyperOBJS)
$(CXX) -o $@ $(stxtyperOBJS) -pthread $(DBDIR)

fasta_check.o: common.hpp common.inc
fasta_check.o: common.hpp common.inc version.txt
fasta_checkOBJS=fasta_check.o common.o
fasta_check: $(fasta_checkOBJS)
$(CXX) -o $@ $(fasta_checkOBJS)

fasta_extract.o: common.hpp common.inc
fasta_extract.o: common.hpp common.inc version.txt
fasta_extractOBJS=fasta_extract.o common.o
fasta_extract: $(fasta_extractOBJS)
$(CXX) -o $@ $(fasta_extractOBJS)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

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.

## 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.

# Installation

## Installing with Bioconda
Expand Down
30 changes: 30 additions & 0 deletions amrfinder_columns.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// AMRFinderPlus column names
// PD-5085

constexpr const char* prot_colName = "Protein id"; // PD-2534
constexpr const char* contig_colName = "Contig id";
// Target
constexpr const char* start_colName = "Start";
constexpr const char* stop_colName = "Stop";
constexpr const char* strand_colName = "Strand";
//
constexpr const char* genesymbol_colName = "Element symbol"; // PD-4924
constexpr const char* elemName_colName = "Element name"; // PD-4910
constexpr const char* scope_colName = "Scope"; // PD-2825
// PD-1856
constexpr const char* type_colName = "Type";
constexpr const char* subtype_colName = "Subtype";
constexpr const char* class_colName = "Class";
constexpr const char* subclass_colName = "Subclass";
//
constexpr const char* method_colName = "Method";
constexpr const char* targetLen_colName = "Element length"; // was: "Target length" ??
constexpr const char* refLen_colName = "Reference sequence length";
constexpr const char* refCov_colName = "% Coverage of reference";
constexpr const char* refIdent_colName = "% Identity to reference";
constexpr const char* alignLen_colName = "Alignment length";
constexpr const char* closestRefAccession_colName = "Closest reference accession";
constexpr const char* closestRefName_colName = "Closest reference name";
constexpr const char* hmmAccession_colName = "HMM accession";
constexpr const char* hmmDescr_colName = "HMM description";
constexpr const char* hierarchyNode_colName = "Hierarchy node";
48 changes: 25 additions & 23 deletions stxtyper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* Dependencies: NCBI BLAST, gunzip (optional)
*
* Release changes:
* 1.0.25 08/16/2024 PD-5085 AMRFinderPlus column names to match MicroBIGG-E
* 1.0.24 08/05/2024 PD-5076 "na" -> "NA"
* 1.0.23 07/29/2024 PD-5064 AMBIGUOUS operon type
* 1.0.22 07/25/2024 First codon L|I|V -> M
Expand Down Expand Up @@ -94,6 +95,7 @@
#include "common.hpp"
#include "tsv.hpp"
using namespace Common_sp;
#include "amrfinder_columns.hpp"

#include "common.inc"

Expand Down Expand Up @@ -950,31 +952,31 @@ struct ThisApplication : ShellApplication
td << "name";
if (amrfinder)
{
td << /* 1*/ "Protein identifier"
<< /* 2*/ "Contig id"
<< /* 3*/ "Start"
<< /* 4*/ "Stop"
<< /* 5*/ "Strand"
<< /* 6*/ "Element symbol" // PD-4924
<< /* 7*/ "Element name" // PD-4910
<< /* 8*/ "Scope"
<< /* 9*/ "Element type"
<< /*10*/ "Element subtype"
<< /*11*/ "Class"
<< /*12*/ "Subclass"
<< /*13*/ "Method"
<< /*14*/ "Target length"
<< /*15*/ "Reference sequence length"
<< /*16*/ "% Coverage of reference sequence"
<< /*17*/ "% Identity to reference sequence"
<< /*18*/ "Alignment length"
<< /*19*/ "Accession of closest sequence"
<< /*20*/ "Name of closest sequence"
<< /*21*/ "HMM id"
<< /*22*/ "HMM description"
td << /* 1*/ prot_colName
<< /* 2*/ contig_colName
<< /* 3*/ start_colName
<< /* 4*/ stop_colName
<< /* 5*/ strand_colName
<< /* 6*/ genesymbol_colName
<< /* 7*/ elemName_colName
<< /* 8*/ scope_colName
<< /* 9*/ type_colName
<< /*10*/ subtype_colName
<< /*11*/ class_colName
<< /*12*/ subclass_colName
<< /*13*/ method_colName
<< /*14*/ targetLen_colName
<< /*15*/ refLen_colName
<< /*16*/ refCov_colName
<< /*17*/ refIdent_colName
<< /*18*/ alignLen_colName
<< /*19*/ closestRefAccession_colName
<< /*20*/ closestRefName_colName
<< /*21*/ hmmAccession_colName
<< /*22*/ hmmDescr_colName
;
if (print_node)
td << "Hierarchy node";
td << hierarchyNode_colName;
}
else
td << "target_contig"
Expand Down
2 changes: 1 addition & 1 deletion test/amrfinder_integration.expected
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#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
#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
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
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
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
Expand Down
2 changes: 1 addition & 1 deletion test/amrfinder_integration2.expected
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#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
#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
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
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
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
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.24
1.0.25

0 comments on commit ba33f57

Please sign in to comment.