This makes a number of changes, and is meant to replace the previous merge request.
Implements staramr db restore-default which can be used to restore the default database (or build a database with the proper revisions initially). This involves making a class AMRDatabasesManager.py to handle restoring the default database.
Inverts the direction of BLAST, so I'm BLASTing the AMR database files (amr genes) against the input genomes. To do this, I must first run makeblastdb on all input files (I make symlinks to them first to not clutter up your input files directory). This is done in BlastHandler.py. Most of the rest of the changes involves inverting the BLAST fields I access in AMRHitHSP.py.
Inverting BLAST means that running staramr against the latest ResFinder/PointFinder databases will work. But, I found I get weird results since some genes aren't labelled properly in the fasta files. So, I print out a WARNING if you are using the latest database. Done in Search.py.
Since I no longer need to makeblastdb on the AMR gene files, I've removed this code when building the database.
I also no longer need to check for the strand when searching for point mutations because of the BLAST direction switch (there is a field for sstrand or subject strand, but nothing for qstrand or query strand available in the results, and the AMR gene string/genome contig string always appear in the same strand). Removing strand checking is mostly done in MutationPosition.py and subclasses.
I do still need to check sstrand when it comes to making BLAST hit partitions though. This is where the changes in BlastHitPartitions.py come from.
I changed to using an OrderedDict when getting database info since it makes it easier to check specific keys. Done in AMRDatabaseHandler.py.
This makes a number of changes, and is meant to replace the previous merge request.
staramr db restore-default
which can be used to restore the default database (or build a database with the proper revisions initially). This involves making a class AMRDatabasesManager.py to handle restoring the default database.makeblastdb
on all input files (I make symlinks to them first to not clutter up your input files directory). This is done in BlastHandler.py. Most of the rest of the changes involves inverting the BLAST fields I access in AMRHitHSP.py.staramr
against the latest ResFinder/PointFinder databases will work. But, I found I get weird results since some genes aren't labelled properly in the fasta files. So, I print out aWARNING
if you are using the latest database. Done in Search.py.makeblastdb
on the AMR gene files, I've removed this code when building the database.strand
when searching for point mutations because of the BLAST direction switch (there is a field forsstrand
or subject strand, but nothing forqstrand
or query strand available in the results, and the AMR gene string/genome contig string always appear in the same strand). Removing strand checking is mostly done in MutationPosition.py and subclasses.sstrand
when it comes to making BLAST hit partitions though. This is where the changes in BlastHitPartitions.py come from.OrderedDict
when getting database info since it makes it easier to check specific keys. Done in AMRDatabaseHandler.py.