[med-svn] [pbsuite] 01/02: More blasr adaptations

Andreas Tille tille at debian.org
Sat Dec 24 13:14:20 UTC 2016


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

tille pushed a commit to branch master
in repository pbsuite.

commit 8602e60d1e8510cd140fa9845cc6b2c179ac9574
Author: Andreas Tille <tille at debian.org>
Date:   Sat Dec 24 13:56:37 2016 +0100

    More blasr adaptations
---
 debian/patches/fix_new_blasr_interface-sam.patch | 117 +++++++++++++++++++++++
 debian/patches/fix_new_blasr_interface.patch     |  11 +++
 debian/patches/series                            |   1 +
 3 files changed, 129 insertions(+)

diff --git a/debian/patches/fix_new_blasr_interface-sam.patch b/debian/patches/fix_new_blasr_interface-sam.patch
new file mode 100644
index 0000000..ff5ef11
--- /dev/null
+++ b/debian/patches/fix_new_blasr_interface-sam.patch
@@ -0,0 +1,117 @@
+Description: Adapt to change of command line syntax of blasr
+ There does not seem to be a real consistency in blasr options,
+ some of them are even spelled differently inside the code -
+ sometimes one '-' is used and sometimes '--' for the very same
+ option and the doc also does not seem to be up to date.
+ .
+ This patch tries the best to use the correct option spelling
+ .
+ Despite the fact that blasr documentation says '--sam' is deprecated
+ it seems to work better than only '-sam'
+ .
+ It also turned out that '-affineAlign' needs to be '--affineAlign'.
+Bug-Debian: https://bus.debian.org/844034
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Sat, 24 Dec 2016 12:20:46 +0100
+
+--- a/pbsuite/honey/bampie.py
++++ b/pbsuite/honey/bampie.py
+@@ -11,11 +11,11 @@ from pbsuite.utils.setupLogging import s
+ #Edit this string to set which parameters blasr will use by default
+ #DO NOT! Set --nproc, -bestn, --clipping, or any output (e.g. -out -m 5)
+ #Remove -noSpotSubreads if your inputs are bax.h5 files [i think]
+-BLASRPARAMS = (" -affineAlign -noSplitSubreads -nCandidates 20 "
++BLASRPARAMS = (" --affineAlign -noSplitSubreads -nCandidates 20 "
+                "-minPctIdentity 75 -sdpTupleSize 6")
+ #Parameters used in the eichler experiments
+ EEBLASRPARAMS = (" -maxAnchorsPerPosition 100 -advanceExactMatches 10 "
+-               "-affineAlign -affineOpen 100 -affineExtend 0 "
++               "--affineAlign -affineOpen 100 -affineExtend 0 "
+                "-insertion 5 -deletion 5 -extend -maxExtendDropoff 20 "
+                "-noSplitSubreads -nCandidates 20 ")
+                #"-minPctIdentity 75 ") #didn't use this, but aybe should
+@@ -62,11 +62,11 @@ def callBlasr(inFile, refFile, params, n
+         sa = ""
+     logging.info("Running Blasr")
+     cmd = ("blasr %s %s %s --nproc %d --bestn 1 "
+-           "-sam --clipping subread --out %s ") \
++           "--sam --clipping subread --out %s ") \
+            % (inFile, refFile, sa, nproc, outFile)
+     r, o, e = exe(cmd + params)
+     
+-    #r,o,e = exe(("blasr %s %s %s --nproc %d -sam --bestn 1 -nCandidates 20 "
++    #r,o,e = exe(("blasr %s %s %s --nproc %d --sam --bestn 1 -nCandidates 20 "
+                  #"--out %s --clipping soft -minPctIdentity 75 "
+                  #" -noSplitSubreads") % (fq, ref, sa, nproc, out))
+     
+--- a/pbsuite/honey/HSpots.pyx
++++ b/pbsuite/honey/HSpots.pyx
+@@ -510,7 +510,7 @@ def consensusCalling(spot, args):
+     
+     #map consensus to refregion
+     varSam = NamedTemporaryFile(suffix=".sam")
+-    cmd = "blasr %s %s -sam --bestn 1 --affineAlign -out %s" % (conOut.name, refOut.name, varSam.name)
++    cmd = "blasr %s %s --sam --bestn 1 --affineAlign -out %s" % (conOut.name, refOut.name, varSam.name)
+     logging.debug(cmd)
+     logging.debug(exe(cmd))
+     
+--- a/pbsuite/honey/Valid.py
++++ b/pbsuite/honey/Valid.py
+@@ -33,7 +33,7 @@ Main Commands:
+     mkdir level2 && cd level2
+     OLCAssembly.py ../out.fasta ../out.qual --nproc 4
+ 
+-    blasr out.fasta ~/pacbio/data/references/human_g1k_v37/sequence/human_g1k_v37.fasta -sa ~/pacbio/data/references/human_g1k_v37/sequence/human_g1k_v37.fasta.sa --nproc 4 --out remap.sam -sam --bestn 1
++    blasr out.fasta ~/pacbio/data/references/human_g1k_v37/sequence/human_g1k_v37.fasta -sa ~/pacbio/data/references/human_g1k_v37/sequence/human_g1k_v37.fasta.sa --nproc 4 --out remap.sam --sam --bestn 1
+ """
+ 
+ VCFEntry = namedtuple("VCFEntry", "region sample haplotype")
+@@ -203,7 +203,7 @@ def remapReads( reads, outName):
+     remaps reads to the provided reference (only setup for hg19 -- see 
+     global variable reference)
+     """
+-    return exe("blasr {0} {1} --sa {1}.sa --nproc 4 --out {2} -sam --bestn 1"\
++    return exe("blasr {0} {1} --sa {1}.sa --nproc 4 --out {2} --sam --bestn 1"\
+                .format(reads, reference, outName))
+     
+ @exeLog
+--- a/pbsuite/honey/bakH.py
++++ b/pbsuite/honey/bakH.py
+@@ -1013,7 +1013,7 @@ class ConsensusCaller():
+         
+         #map consensus to refregion
+         varSam = NamedTemporaryFile(suffix=".sam")
+-        blasr(conOut.name, refOut.name, format="-sam", outname=varSam.name)
++        blasr(conOut.name, refOut.name, format="--sam", outname=varSam.name)
+             #consensus=False) -- would this help?
+             #or what if I fed it through leftalign?
+         
+--- a/pbsuite/honey/HSpots.py
++++ b/pbsuite/honey/HSpots.py
+@@ -205,12 +205,12 @@ def blasr(query, target, format, nproc =
+     #need to figure out how to m5-pie it...maybe
+     if consensus:
+         r, o, e = exe(cmd + " -noSplitSubreads -minMatch 5 " + \
+-                     "-nCandidates 20 -sdpTupleSize 6 -insertion 1 -deletion 1 -bestn 1")
++                     "--nCandidates 20 --sdpTupleSize 6 --insertion 1 --deletion 1 --bestn 1")
+     else:
+-        r, o, e = exe(cmd + " -maxAnchorsPerPosition 100 "
+-               "-affineAlign -affineOpen 100 -affineExtend 0 "
+-               "-insertion 10 -deletion 10 "
+-               "-noSplitSubreads -nCandidates 20 ")
++        r, o, e = exe(cmd + " --maxAnchorsPerPosition 100 "
++               "--affineAlign --affineOpen 100 --affineExtend 0 "
++               "--insertion 10 --deletion 10 "
++               "-noSplitSubreads --nCandidates 20 ")
+         
+     logging.debug("blasr - %d - %s - %s" % (r, o, e))
+ 
+@@ -1000,7 +1000,7 @@ class ConsensusCaller():
+             
+             #map consensus to refregion
+             varSam = NamedTemporaryFile(suffix=".sam")
+-            blasr(conOut.name, refOut.name, format="-sam", outname=varSam.name,\
++            blasr(conOut.name, refOut.name, format="--sam", outname=varSam.name,\
+                 consensus=False) #-- would this help?
+                 #or what if I fed it through leftalign?
+             #os.system("cp %s ." % (refOut.name))
diff --git a/debian/patches/fix_new_blasr_interface.patch b/debian/patches/fix_new_blasr_interface.patch
index 3f900d6..fc49de7 100644
--- a/debian/patches/fix_new_blasr_interface.patch
+++ b/debian/patches/fix_new_blasr_interface.patch
@@ -206,3 +206,14 @@ Last-Update: Sat, 24 Dec 2016 12:20:46 +0100
      <input baseDir="/__PATH__/_TO_/jellyExample/data/reads/">
          <job>filtered_subreads.fastq</job>
      </input>
+--- a/pbsuite/honey/HSpots.pyx
++++ b/pbsuite/honey/HSpots.pyx
+@@ -510,7 +510,7 @@ def consensusCalling(spot, args):
+     
+     #map consensus to refregion
+     varSam = NamedTemporaryFile(suffix=".sam")
+-    cmd = "blasr %s %s -sam -bestn 1 -affineAlign -out %s" % (conOut.name, refOut.name, varSam.name)
++    cmd = "blasr %s %s -sam --bestn 1 --affineAlign -out %s" % (conOut.name, refOut.name, varSam.name)
+     logging.debug(cmd)
+     logging.debug(exe(cmd))
+     
diff --git a/debian/patches/series b/debian/patches/series
index e6d63aa..3138d3c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ rm-intervaltree-dependency.patch
 fix-example.patch
 fix-shebang-lines.patch
 fix_new_blasr_interface.patch
+fix_new_blasr_interface-sam.patch

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



More information about the debian-med-commit mailing list