Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option bowtie2_preset; version bump #23

Merged
merged 2 commits into from
Apr 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ariba/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(self,
gapfiller_exe='GapFiller.pl',
samtools_exe='samtools',
bowtie2_exe='bowtie2',
bowtie2_preset='very-sensitive-local',
smalt_exe='smalt',
spades_exe='spades.py',
sspace_exe='SSPACE_Basic_v2.0.pl',
Expand Down Expand Up @@ -95,6 +96,7 @@ def __init__(self,
self.samtools_exe = samtools_exe
self.smalt_exe = smalt_exe
self.bowtie2_exe = bowtie2_exe
self.bowtie2_preset = bowtie2_preset

if self.assembler == 'velvet':
self.velveth = velvet_exe + 'h'
Expand Down Expand Up @@ -156,6 +158,7 @@ def _get_total_alignment_score(self, gene_name):
threads=self.threads,
samtools=self.samtools_exe,
bowtie2=self.bowtie2_exe,
bowtie2_preset=self.bowtie2_preset,
verbose=self.verbose,
)

Expand Down Expand Up @@ -229,6 +232,7 @@ def _assemble_with_velvet(self):
sort=True,
samtools=self.samtools_exe,
bowtie2=self.bowtie2_exe,
bowtie2_preset=self.bowtie2_preset,
verbose=self.verbose,
)

Expand Down Expand Up @@ -1007,6 +1011,7 @@ def run(self):
sort=True,
samtools=self.samtools_exe,
bowtie2=self.bowtie2_exe,
bowtie2_preset=self.bowtie2_preset,
verbose=self.verbose,
)
self._parse_assembly_bam()
Expand Down
5 changes: 5 additions & 0 deletions ariba/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(self,
samtools_exe='samtools',
smalt_exe='smalt',
bowtie2_exe='bowtie2',
bowtie2_preset='very-sensitive-local',
spades_exe='spades.py',
sspace_exe='SSPACE_Basic_v2.0.pl',
velvet_exe='velvet', # prefix of velvet{g,h}
Expand Down Expand Up @@ -70,6 +71,7 @@ def __init__(self,
self.max_insert = max_insert
self.smalt_exe = smalt_exe
self.bowtie2_exe = bowtie2_exe
self.bowtie2_preset = bowtie2_preset

self.insert_hist_bin = 10
self.insert_hist = histogram.Histogram(self.insert_hist_bin)
Expand Down Expand Up @@ -146,6 +148,7 @@ def _map_reads_to_clustered_genes(self):
threads=self.threads,
samtools=self.samtools_exe,
bowtie2=self.bowtie2_exe,
bowtie2_preset=self.bowtie2_preset,
verbose=self.verbose,
)

Expand Down Expand Up @@ -292,6 +295,8 @@ def _init_and_run_clusters(self):
bcftools_exe=self.bcftools_exe,
gapfiller_exe=self.gapfiller_exe,
samtools_exe=self.samtools_exe,
bowtie2_exe=self.bowtie2_exe,
bowtie2_preset=self.bowtie2_preset,
spades_exe=self.spades_exe,
sspace_exe=self.sspace_exe,
velvet_exe=self.velvet,
Expand Down
2 changes: 1 addition & 1 deletion ariba/common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import subprocess

version = '0.2.0'
version = '0.3.0'

def syscall(cmd, allow_fail=False, verbose=False):
if verbose:
Expand Down
3 changes: 2 additions & 1 deletion ariba/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def run_bowtie2(
sort=False,
samtools='samtools',
bowtie2='bowtie2',
bowtie2_preset='very-sensitive-local',
verbose=False
):

Expand All @@ -36,7 +37,7 @@ def run_bowtie2(
map_cmd = ' '.join([
bowtie2,
'--threads', str(threads),
'--very-sensitive-local',
'--' + bowtie2_preset,
'-X', str(max_insert),
'-x', map_index,
'-1', reads_fwd,
Expand Down
3 changes: 3 additions & 0 deletions ariba/tasks/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def run():
other_group = parser.add_argument_group('Other options')
other_group.add_argument('--genetic_code', type=int, help='Number of genetic code to use. Currently supported 1,4,11 [%(default)s]', choices=[1,4,11], default=11, metavar='INT')
other_group.add_argument('--threads', type=int, help='Number of threads for bowtie2 and spades [%(default)s]', default=1, metavar='INT')
bowtie2_presets = ['very-fast-local', 'fast-local', 'sensitive-local', 'very-sensitive-local']
other_group.add_argument('--bowtie2_preset', choices=bowtie2_presets, help='Preset option for bowtie2 mapping [%(default)s]', default='very-sensitive-local', metavar='|'.join(bowtie2_presets))
other_group.add_argument('--assembled_threshold', type=float, help='If proportion of gene assembled (regardless of into how many contigs) is at least this value then the flag gene_assembled is set [%(default)s]', default=0.95, metavar='FLOAT (between 0 and 1)')
other_group.add_argument('--unique_threshold', type=float, help='If proportion of bases in gene assembled more than once is <= this value, then the flag unique_contig is set [%(default)s]', default=0.03, metavar='FLOAT (between 0 and 1)')
other_group.add_argument('--clean', type=int, choices=[0,1,2], help='Specify how much cleaning to do. 0=none, 1=some, 2=only keep the report [%(default)s]', default=1, metavar='INT')
Expand Down Expand Up @@ -75,6 +77,7 @@ def run():
gapfiller_exe=options.gapfiller,
samtools_exe=options.samtools,
bowtie2_exe=options.bowtie2,
bowtie2_preset=options.bowtie2_preset,
spades_exe=options.spades,
sspace_exe=options.sspace,
velvet_exe=options.velvet,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='ariba',
version='0.2.0',
version='0.3.0',
description='ARIBA: Antibiotic Resistance Identification By Assembly',
packages = find_packages(),
author='Martin Hunt',
Expand Down