[med-svn] [iva] 01/01: add missing patches

Sascha Steinbiss sascha at steinbiss.name
Wed May 4 10:28:03 UTC 2016


This is an automated email from the git hooks/post-receive script.

sascha-guest pushed a commit to branch master
in repository iva.

commit 8be1037f0b4265003cfe2d332952dd7083ea66fa
Author: Sascha Steinbiss <sascha at steinbiss.name>
Date:   Wed May 4 10:28:06 2016 +0000

    add missing patches
---
 debian/patches/adjust_required_pysam_version.patch |  17 +++
 debian/patches/samtools_fix.patch                  | 120 +++++++++++++++++++++
 debian/patches/spelling.patch                      |  18 ++++
 3 files changed, 155 insertions(+)

diff --git a/debian/patches/adjust_required_pysam_version.patch b/debian/patches/adjust_required_pysam_version.patch
new file mode 100644
index 0000000..99f6f81
--- /dev/null
+++ b/debian/patches/adjust_required_pysam_version.patch
@@ -0,0 +1,17 @@
+Description: relax pysam version
+ Upstream has fixed pysm to version 0.8.3 because there are building issues
+ with newer versions and pip. These are not present in Debian, so I'm relaxing the
+ version requirements. 
+Author: Sascha Steinbiss <sascha at steinbiss.name>
+Forwarded: not-needed, upstream insists on using 0.8.3
+--- a/setup.py
++++ b/setup.py
+@@ -45,7 +45,7 @@
+     install_requires=[
+         'pyfastaq >= 3.10.0',
+         'networkx >= 1.7',
+-        'pysam >= 0.8.1, <= 0.8.3',
++        'pysam >= 0.8.1',
+     ],
+     license='GPLv3',
+     classifiers=[
diff --git a/debian/patches/samtools_fix.patch b/debian/patches/samtools_fix.patch
new file mode 100644
index 0000000..19233a9
--- /dev/null
+++ b/debian/patches/samtools_fix.patch
@@ -0,0 +1,120 @@
+From ed16c9b1a940fe11b14c8adfbe3853e889604ac4 Mon Sep 17 00:00:00 2001
+From: Sascha Steinbiss <sascha at steinbiss.name>
+Date: Tue, 3 May 2016 18:48:07 +0100
+Subject: [PATCH 1/3] make IVA compatible with new 'samtools sort' syntax
+
+---
+ iva/external_progs.py | 4 ++--
+ iva/mapping.py        | 6 +++++-
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/iva/external_progs.py b/iva/external_progs.py
+index 8b42054..c8056b1 100644
+--- a/iva/external_progs.py
++++ b/iva/external_progs.py
+@@ -23,10 +23,10 @@ def is_in_path(prog):
+     'nucmer': ('nucmer --version', re.compile('^NUCmer \(NUCleotide MUMmer\) version (.*)$')),
+     'R': ('R --version', re.compile('^R version (.*) \(.*\) --')),
+     'smalt': ('smalt version', re.compile('^Version: (.*)$')),
+-    'samtools': ('samtools', re.compile('^Version: (.*)$')),
++    'samtools': ('samtools', re.compile('^Version: ([^ ]+)')),
+ }
+ 
+- 
++
+ minimum_versions = {
+     'samtools': '0.1.19'
+ }
+diff --git a/iva/mapping.py b/iva/mapping.py
+index 681b5be..63bfd90 100644
+--- a/iva/mapping.py
++++ b/iva/mapping.py
+@@ -5,6 +5,7 @@
+ import pyfastaq
+ import pysam
+ from iva import common
++from iva import external_progs
+ 
+ class Error (Exception): pass
+ 
+@@ -78,7 +79,10 @@ def map_reads(reads_fwd, reads_rev, ref_fa, out_prefix, index_k=15, index_s=3, t
+     if sort:
+         threads = min(4, threads)
+         thread_mem = int(500 / threads)
+-        sort_cmd = 'samtools sort -@' + str(threads) + ' -m ' + str(thread_mem) + 'M ' + intermediate_bam + ' ' + out_prefix
++        if str(external_progs.get_version('samtools')) >= '1.2':
++            sort_cmd = 'samtools sort -@' + str(threads) + ' -m ' + str(thread_mem) + 'M -o ' + final_bam + ' ' + intermediate_bam
++        else:
++            sort_cmd = 'samtools sort -@' + str(threads) + ' -m ' + str(thread_mem) + 'M ' + intermediate_bam + ' ' + out_prefix
+         index_cmd = 'samtools index ' + final_bam
+         if verbose >= 2:
+             print('        map reads. sort:  ', sort_cmd)
+
+From 5fac89d891fb0932b60f06d8225f44a3642c2035 Mon Sep 17 00:00:00 2001
+From: Sascha Steinbiss <sascha at steinbiss.name>
+Date: Wed, 4 May 2016 08:52:50 +0000
+Subject: [PATCH 2/3] clean up test directories
+
+---
+ iva/qc_external.py | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/iva/qc_external.py b/iva/qc_external.py
+index b04bbb1..ae76718 100644
+--- a/iva/qc_external.py
++++ b/iva/qc_external.py
+@@ -142,9 +142,10 @@ def run_ratt(embl_dir, assembly, outdir, config_file=None, transfer='Species', c
+     cwd = os.getcwd()
+     try:
+         os.mkdir(outdir)
+-        os.chdir(outdir)
+     except:
+-        raise Error('Error mkdir ' + outdir)
++        pass
++    os.chdir(outdir)
++    iva.common.syscall('rm -rf ./*')
+ 
+     extractor = iva.egg_extract.Extractor(os.path.abspath(os.path.join(os.path.dirname(iva.__file__), os.pardir)))
+     ratt_code_indir = os.path.join('iva', 'ratt')
+@@ -200,7 +201,7 @@ def run_ratt(embl_dir, assembly, outdir, config_file=None, transfer='Species', c
+             except:
+                 pass
+ 
+-        iva.common.syscall('rm query.* Reference.* nucmer.* out.*')
++        iva.common.syscall('rm -f query.* Reference.* nucmer.* out.*')
+ 
+     os.chdir(cwd)
+     return stats
+
+From 3b25765ac1eeb4bab5246087ed3c2ef6c0648e36 Mon Sep 17 00:00:00 2001
+From: Sascha Steinbiss <sascha at steinbiss.name>
+Date: Wed, 4 May 2016 09:00:36 +0000
+Subject: [PATCH 3/3] make outdir recreation more robust
+
+---
+ iva/qc_external.py | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/iva/qc_external.py b/iva/qc_external.py
+index ae76718..bed1c58 100644
+--- a/iva/qc_external.py
++++ b/iva/qc_external.py
+@@ -140,12 +140,13 @@ def run_ratt(embl_dir, assembly, outdir, config_file=None, transfer='Species', c
+     assembly = os.path.abspath(assembly)
+ 
+     cwd = os.getcwd()
+-    try:
+-        os.mkdir(outdir)
+-    except:
+-        pass
++    if os.path.exists(outdir):
++        if os.path.isdir(outdir):
++            shutil.rmtree(outdir)
++        else:
++            os.unlink(outdir)
++    os.mkdir(outdir)
+     os.chdir(outdir)
+-    iva.common.syscall('rm -rf ./*')
+ 
+     extractor = iva.egg_extract.Extractor(os.path.abspath(os.path.join(os.path.dirname(iva.__file__), os.pardir)))
+     ratt_code_indir = os.path.join('iva', 'ratt')
diff --git a/debian/patches/spelling.patch b/debian/patches/spelling.patch
new file mode 100644
index 0000000..463be8a
--- /dev/null
+++ b/debian/patches/spelling.patch
@@ -0,0 +1,18 @@
+Description: spelling fixes
+Author: Sascha Steinbiss <sascha at steinbiss.name>
+--- a/scripts/iva
++++ b/scripts/iva
+@@ -15,10 +15,10 @@
+ 
+ 
+ io_group = parser.add_argument_group('Input and output')
+-io_group.add_argument('-f', '--reads_fwd', action=iva.common.abspathAction, help='Name of forward reads fasta/q file. Must be used in conjuction with --reads_rev', metavar='filename[.gz]')
+-io_group.add_argument('-r', '--reads_rev', action=iva.common.abspathAction, help='Name of reverse reads fasta/q file. Must be used in conjuction with --reads_fwd', metavar='filename[.gz]')
++io_group.add_argument('-f', '--reads_fwd', action=iva.common.abspathAction, help='Name of forward reads fasta/q file. Must be used in conjunction with --reads_rev', metavar='filename[.gz]')
++io_group.add_argument('-r', '--reads_rev', action=iva.common.abspathAction, help='Name of reverse reads fasta/q file. Must be used in conjunction with --reads_fwd', metavar='filename[.gz]')
+ io_group.add_argument('--fr', action=iva.common.abspathAction, dest='reads', help='Name of interleaved fasta/q file', metavar='filename[.gz]')
+-io_group.add_argument('--keep_files', action='store_true', help='Keep intermediate files (could be many!). Default is to delete all unecessary files')
++io_group.add_argument('--keep_files', action='store_true', help='Keep intermediate files (could be many!). Default is to delete all unnecessary files')
+ io_group.add_argument('--contigs', action=iva.common.abspathAction, help='Fasta file of contigs to be extended. Incompatible with --reference', metavar='filename[.gz]')
+ io_group.add_argument('--reference', action=iva.common.abspathAction, help='Fasta file of reference genome, or parts thereof. IVA will try to assemble one contig per sequence in this file. Incompatible with --contigs', metavar='filename[.gz]')
+ io_group.add_argument('-v', '--verbose', action='count', help='Be verbose by printing messages to stdout. Use up to three times for increasing verbosity.', default=0)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/iva.git



More information about the debian-med-commit mailing list