Skip to content

Commit

Permalink
Merge pull request #13 from andrewjpage/verbose
Browse files Browse the repository at this point in the history
Species list bug
  • Loading branch information
andrewjpage authored Jul 16, 2019
2 parents c13cddb + 0623688 commit 949d62d
Show file tree
Hide file tree
Showing 6 changed files with 631 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.6
2.1.7
2 changes: 1 addition & 1 deletion scripts/socru_species
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ parser.add_argument('--version', action='version', version=str(version))

options = parser.parse_args()

Schemas().print_all()
Schemas(options.verbose).print_all()
2 changes: 2 additions & 0 deletions socru/Fasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def largest_contig_check(self, largest_contig, record):
def calc_fragment_coords(self, boundries):
genome_length = len(self.chromosome.seq)
fragments = []
if not boundries:
return []

start_coord = 0
end_coord = genome_length
Expand Down
2 changes: 2 additions & 0 deletions socru/Socru.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def write_novel_profile_to_file(self, tg, type_output_string):
# refactor
def run_analysis(self, input_file, p, d):
boundries = self.find_rrna_boundries(input_file)
if not boundries:
return ''
fragments = self.populate_fragments_from_chromosome(input_file, boundries)

tmpdir = mkdtemp()
Expand Down
20 changes: 15 additions & 5 deletions socru/tests/Socru_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,19 @@ def test_socru_valid(self):
self.assertTrue(os.path.exists('output_file'))
self.assertTrue(os.path.exists('blast'))

os.remove('blast')
os.remove('output_file')
os.remove('novel')
os.remove('newfrag.fa')
os.remove('output_plot.png')
for file_name in ['blast', 'output_file', 'newfrag.fa', 'output_plot.png', 'novel']:
if os.path.exists(file_name):
os.remove(file_name)

def test_operon_wrapped_around_ends(self):
# If there is no operon identified, then skip and dont throw an error
g = Socru(TestOptions([os.path.join(data_dir, 'wrapped.fa')], 'Salmonella_enterica', None, 1000,1000,1, 'output_file', False, 'novel', 'newfrag.fa', None, 'blast', 'output_plot.png'))
g.run()
self.assertTrue(os.path.exists('output_file'))
self.assertTrue(os.path.exists('blast'))

for file_name in ['blast', 'output_file', 'newfrag.fa', 'output_plot.png', 'novel']:
if os.path.exists(file_name):
os.remove(file_name)


Loading

0 comments on commit 949d62d

Please sign in to comment.