diff --git a/bin/fastmlst b/bin/fastmlst index 3e41187..1b24f92 100644 --- a/bin/fastmlst +++ b/bin/fastmlst @@ -48,7 +48,7 @@ def runMLST(margument): if __name__ == '__main__': - V = '%(prog)s v0.0.11' + V = '%(prog)s v0.0.12' parser = argparse.ArgumentParser() parser.add_argument(type=str, nargs='*', dest='genomes') parser.add_argument('-t', '--threads', type=int, default=cpu_count(), @@ -64,9 +64,9 @@ if __name__ == '__main__': help='Set a scheme target (I am not dumb, let me choose a scheme by myself!)') parser.add_argument('--scheme-list', action='store_true', help='Show all schemes supported') - parser.add_argument('-fo', '--fastaoutput', type=str, default='mlst.fasta', + parser.add_argument('-fo', '--fastaoutput', type=str, default='', help='File name of the concatenated alleles output' + - ' (default mlst.fasta)') + ' (default "")') parser.add_argument('-to', '--tableoutput', type=str, default=stdout, help='File name of the MLST table output' + ' (default STDOUT)') @@ -201,14 +201,15 @@ if __name__ == '__main__': str_alleles += genome.str_st str_alleles += '\n' dict_alleles.append(genome.dict_st) - if args.fasta2line: - SeqIO.write(fastaconcat, args.fastaoutput, 'fasta-2line') - if args.novel: - SeqIO.write(fastanovelconcat, args.novel, 'fasta-2line') - else: - SeqIO.write(fastaconcat, args.fastaoutput, 'fasta') - if args.novel: - SeqIO.write(fastanovelconcat, args.novel, 'fasta') + # FastMLSTv0.0.12 by default do not write the fasta file + if args.fasta2line and args.fastaoutput != '': + SeqIO.write(fastaconcat, args.fastaoutput, 'fasta-2line') + if args.novel: + SeqIO.write(fastanovelconcat, args.novel, 'fasta-2line') + elif args.fastaoutput != '': + SeqIO.write(fastaconcat, args.fastaoutput, 'fasta') + if args.novel: + SeqIO.write(fastanovelconcat, args.novel, 'fasta') # output formated if type(args.tableoutput) == str: diff --git a/fastmlst/mlst.py b/fastmlst/mlst.py index 18cc2c7..d3391c3 100644 --- a/fastmlst/mlst.py +++ b/fastmlst/mlst.py @@ -146,6 +146,8 @@ def blast_filter(self, blast_out): dfblast['coverage'] = (dfblast.length - dfblast.gaps) / dfblast.slen dfblast['identity'] = (dfblast.nident - dfblast.gaps) / dfblast.slen # this is a 'global' %identity dfblast[toint] = dfblast[toint].astype(int) + # Bug Fixed on FastMLSTv0.0.12: The contigs identifier of some assemblers like unicycler is just a number, I opted to standardize all searches using strings + dfblast['qseqid'] = dfblast['qseqid'].astype(str) # don't even look at the hits below these cov's and identities dfblast = dfblast.loc[(dfblast['coverage'] <= 1) & (dfblast['coverage'] >= self.coverage) & (dfblast['identity'] >= self.identity)] # insertions can not be processed properly yet # dfblast = dfblast.loc[dfblast['slen'] >= dfblast['length']] # if have an insertion slen < length diff --git a/setup.py b/setup.py index 5ad476f..5c311d5 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup setup(name='fastmlst', - version='0.0.11', + version='0.0.12', description='A multi-core tool for multilocus sequence typing of draft genome assemblies using PubMLST typing schemes', url='https://github.com/EnzoAndree/FastMLST', author='Enzo Guerrero-Araya',