Skip to content

Commit

Permalink
Escape the species name to be safe
Browse files Browse the repository at this point in the history
  • Loading branch information
ar0ch committed Mar 5, 2019
1 parent 479b0cb commit aaaf0d5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[metadata]
description-file = README.rst
description-file = README.md
59 changes: 33 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
#!/usr/bin/env python
try:
import os
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
from os import path
here = path.abspath(path.dirname(__file__))
long_description="Fast k-mer based tool for alignment and assembly-free multi locus sequence typing (MLST) directly from genome sequencing reads."

setup(
name = 'stringMLST',
scripts = ['stringMLST.py'],
version = '0.5.2',
description = 'Fast k-mer based tool for alignment and assembly-free multi locus sequence typing (MLST) directly from genome sequencing reads.',
long_description=long_description,
author = 'Jordan Lab',
author_email = '[email protected]',
url = 'https://github.com/jordanlab/stringMLST',
keywords = ['MLST', 'kmer', "NGS", "stringMSLT"],
classifiers = [
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
],
install_requires=['lxml','pyfaidx'],
)
#!/usr/bin/env python
try:
import os
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
from os import path
here = path.abspath(path.dirname(__file__))
try:
with open("README.md", "r") as fh:
long_description = fh.read()
except:
pass
else:
long_description = 'Fast k-mer based tool for alignment and assembly-free multi locus sequence typing (MLST) directly from genome sequencing reads.'

setup(
name = 'stringMLST',
scripts = ['stringMLST.py'],
version = '0.6',
description = 'Fast k-mer based tool for alignment and assembly-free multi locus sequence typing (MLST) directly from genome sequencing reads.',
long_description=long_description,
long_description_content_type="text/markdown",
author = 'Jordan Lab',
author_email = '[email protected]',
url = 'https://github.com/jordanlab/stringMLST',
keywords = ['MLST', 'kmer', "NGS", "stringMSLT"],
classifiers = [
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
],
install_requires=['lxml','pyfaidx'],
)
7 changes: 2 additions & 5 deletions stringMLST.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
except ImportError:
from urllib import urlopen, urlretrieve
import argparse
version = """ stringMLST v0.5.2 (updated : January, 7 2018) """
version = """ stringMLST v0.6 (updated : March, 5 2019) """
"""
stringMLST free for academic users and requires permission before any commercial
Expand Down Expand Up @@ -259,13 +259,11 @@
def get_links(xmlData, savePath, speciesName):
lociList = {}
for species in xmlData:
if re.search(speciesName, species.text, re.IGNORECASE):
if re.search(re.escape(speciesName), species.text, re.IGNORECASE, ):
for mlst in species:
for database in mlst:
for child in database:
print(child.text)
if child.tag == "profiles":
print(child[1].text)
profileURL = child[1].text
if child.tag == "loci":
for locus in child:
Expand Down Expand Up @@ -1545,7 +1543,6 @@ def checkParams(buildDB, predict, config, k, listMode, list, batch, dir, fastq1,
else:
filePrefix = dbPrefix
config = filePrefix + "_config.txt"
print("Get URLs")
profileURL, loci = get_links(dbRoot, filePrefix, species)
get_files(filePrefix, loci, profileURL, species)

Expand Down

0 comments on commit aaaf0d5

Please sign in to comment.