From 9676cd1d334159a9c5c43e813f24e7a9ea0ddcf3 Mon Sep 17 00:00:00 2001 From: eppinglen Date: Wed, 26 Feb 2020 18:05:00 +0100 Subject: [PATCH 1/5] add --max_noncoding_length to build the serotyping db --- seroba/ref_db_creator.py | 6 ++++-- setup.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/seroba/ref_db_creator.py b/seroba/ref_db_creator.py index f3b0851..b530605 100644 --- a/seroba/ref_db_creator.py +++ b/seroba/ref_db_creator.py @@ -128,7 +128,7 @@ def _check_meta_data(meta_tsv,gene_fasta): @staticmethod def _create_ariba_db(fasta_file,cluster_meta_data,cdhit_clusters,serogroup,out_dir,subdir): ariba_dir = os.path.join(out_dir,'ariba_db',serogroup,subdir) - command = ['ariba prepareref','-f',fasta_file,'-m',cluster_meta_data,'--cdhit_clusters',cdhit_clusters, ariba_dir] + command = ['ariba prepareref','-f',fasta_file,'-m',cluster_meta_data,'--max_noncoding_length 50000 --cdhit_clusters',cdhit_clusters, ariba_dir] print(' '.join(command)) os.system(' '.join(command)) @@ -155,8 +155,10 @@ def _create_complete_cdhit_cluster(meta_data_tsv,out_dir): def _create_complete_ariba_db(self,complete_cdhit_cluster): temp_dir = tempfile.mkdtemp(prefix = 'temp_ariba', dir=os.getcwd()) temp_dir = os.path.join(temp_dir,'ariba') - command = ['ariba prepareref','-f',self.ref_fasta,'--all_coding no --cdhit_clusters',complete_cdhit_cluster, temp_dir] + command = ['ariba prepareref','-f',self.ref_fasta,'--all_coding no --max_noncoding_length 50000 --cdhit_clusters',complete_cdhit_cluster, temp_dir] + print(' '.join(command)) os.system(' '.join(command)) + print(' '.join(command)) shutil.copyfile(os.path.join(temp_dir,'02.cdhit.clusters.tsv'),os.path.join(self.out_dir,'cd_cluster.tsv')) shutil.rmtree(temp_dir) diff --git a/setup.py b/setup.py index 0d66437..a0f0cf7 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='seroba', - version='1.0.1', + version='1.0.2', description='SEROBA: Serotyping for illumina reads', packages = find_packages(), author='Lennard Epping', From 9caff27ba7bd5688d24cf299b25e1b2380ffd284 Mon Sep 17 00:00:00 2001 From: eppinglen Date: Wed, 26 Feb 2020 18:05:23 +0100 Subject: [PATCH 2/5] add --max_noncoding_length to build the serotyping db --- seroba/ref_db_creator.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/seroba/ref_db_creator.py b/seroba/ref_db_creator.py index b530605..2818b7a 100644 --- a/seroba/ref_db_creator.py +++ b/seroba/ref_db_creator.py @@ -156,9 +156,7 @@ def _create_complete_ariba_db(self,complete_cdhit_cluster): temp_dir = tempfile.mkdtemp(prefix = 'temp_ariba', dir=os.getcwd()) temp_dir = os.path.join(temp_dir,'ariba') command = ['ariba prepareref','-f',self.ref_fasta,'--all_coding no --max_noncoding_length 50000 --cdhit_clusters',complete_cdhit_cluster, temp_dir] - print(' '.join(command)) os.system(' '.join(command)) - print(' '.join(command)) shutil.copyfile(os.path.join(temp_dir,'02.cdhit.clusters.tsv'),os.path.join(self.out_dir,'cd_cluster.tsv')) shutil.rmtree(temp_dir) From b64a154372939eab5d7e1ae5a72276415dfe6af9 Mon Sep 17 00:00:00 2001 From: eppinglen Date: Thu, 27 Feb 2020 12:49:25 +0100 Subject: [PATCH 3/5] update python version for travisCI --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 21ac05d..cf909c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ addons: - libgfortran3 - libncurses5-dev python: - - "3.4" + - "3.7" sudo: false install: - "source ./install_dependencies.sh" @@ -17,4 +17,4 @@ before_script: script: - "coverage run setup.py test" after_success: - - codecov \ No newline at end of file + - codecov From 0ba32c14be4fa7a0353e154a55b6a5077f3dd99e Mon Sep 17 00:00:00 2001 From: eppinglen Date: Thu, 27 Feb 2020 13:28:21 +0100 Subject: [PATCH 4/5] fixed create_ariba_db unittest --- seroba/tests/ref_db_creator_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seroba/tests/ref_db_creator_test.py b/seroba/tests/ref_db_creator_test.py index 5fa09df..fccc8dc 100644 --- a/seroba/tests/ref_db_creator_test.py +++ b/seroba/tests/ref_db_creator_test.py @@ -123,8 +123,8 @@ def test__create_ariba_db(self): for i in range(len(db_files)): with self.subTest (i= i): - exp = os.path.join(data_dir,'ariba_db',db_files[i]) - + exp = os.path.join(out_dir,'ariba_db','06A','ref',db_files[i]) + print(exp) self.assertTrue(os.path.isfile(exp) , 'files does not exists') shutil.rmtree(out_dir) From cf83c1d123c027d9975d5e3dfc41aa3350aa2eb5 Mon Sep 17 00:00:00 2001 From: eppinglen Date: Mon, 2 Mar 2020 14:12:15 +0100 Subject: [PATCH 5/5] correct typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e694ab2..27672bb 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ Clone the git repository: git clone https://github.com/sanger-pathogens/seroba.git ``` -Copy the databse to a directory: +Copy the database to a directory: ``` cp -r seroba/database my_directory ```