[med-svn] [pbsuite] 01/01: Try to adapt to change of command line syntax of blasr
Andreas Tille
tille at debian.org
Sat Dec 24 11:25:39 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 1191b7d6f8f007d74d8688add16efad1de152ac8
Author: Andreas Tille <tille at debian.org>
Date: Sat Dec 24 12:25:23 2016 +0100
Try to adapt to change of command line syntax of blasr
---
debian/changelog | 8 ++
debian/patches/fix_new_blasr_interface.patch | 208 +++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 217 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index cd73148..72f104c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+pbsuite (15.8.24+dfsg-2) UNRELEASED; urgency=medium
+
+ * Team upload.
+ * Adapt to change of command line syntax of blasr
+ Closes: #844034
+
+ -- Andreas Tille <tille at debian.org> Sat, 24 Dec 2016 12:20:46 +0100
+
pbsuite (15.8.24+dfsg-1) unstable; urgency=medium
* Initial release (Closes: #807802)
diff --git a/debian/patches/fix_new_blasr_interface.patch b/debian/patches/fix_new_blasr_interface.patch
new file mode 100644
index 0000000..3f900d6
--- /dev/null
+++ b/debian/patches/fix_new_blasr_interface.patch
@@ -0,0 +1,208 @@
+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
+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
+@@ -9,7 +9,7 @@ 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)
++#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 "
+ "-minPctIdentity 75 -sdpTupleSize 6")
+@@ -42,9 +42,9 @@ to change how reads are mapped.
+ """
+ def checkBlasrParams(bp):
+ """
+- Ensure -bestn, -nproc, -clipping, -out are not specified
++ Ensure --bestn, --nproc, --clipping, --out are not specified
+ """
+- args = [" -bestn ", " -nproc ", " -clipping ", " -out ", " -m "]
++ args = [" --bestn ", " --nproc ", " --clipping ", " --out ", " -m "]
+ for i in args:
+ if bp.count(i):
+ logging.error("Do not specify %s through Honey.py pie" % (i))
+@@ -61,13 +61,13 @@ def callBlasr(inFile, refFile, params, n
+ else:
+ sa = ""
+ logging.info("Running Blasr")
+- cmd = ("blasr %s %s %s -nproc %d -bestn 1 "
+- "-sam -clipping subread -out %s ") \
++ cmd = ("blasr %s %s %s --nproc %d --bestn 1 "
++ "-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 "
+- #"-out %s -clipping soft -minPctIdentity 75 "
++ #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))
+
+ if r != 0:
+--- a/pbsuite/honey/bakH.py
++++ b/pbsuite/honey/bakH.py
+@@ -187,7 +187,7 @@ def blasr(query, target, format, nproc =
+ """
+ Simple mapper
+ """
+- cmd = ("blasr %s %s %s -nproc %d -bestn 1 -out %s ") \
++ cmd = ("blasr %s %s %s --nproc %d --bestn 1 --out %s ") \
+ % (query, target, format, nproc, outname)
+ #need to figure out how to m5-pie it...maybe
+ if consensus:
+--- a/pbsuite/honey/Valid.py
++++ b/pbsuite/honey/Valid.py
+@@ -28,12 +28,12 @@ Main Commands:
+
+ awk '{print "@" $1 "\n" $10 "\n+\n" $11}' > input.fastq
+
+- OLCAssembly.py input.fastq -nproc 4
++ OLCAssembly.py input.fastq --nproc 4
+
+ mkdir level2 && cd level2
+- OLCAssembly.py ../out.fasta ../out.qual -nproc 4
++ 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/HSpots.py
++++ b/pbsuite/honey/HSpots.py
+@@ -200,7 +200,7 @@ def blasr(query, target, format, nproc =
+ """
+ Simple mapper
+ """
+- cmd = ("blasr %s %s %s -nproc %d -bestn 1 -out %s ") \
++ cmd = ("blasr %s %s %s --nproc %d --bestn 1 --out %s ") \
+ % (query, target, format, nproc, outname)
+ #need to figure out how to m5-pie it...maybe
+ if consensus:
+--- a/pbsuite/jelly/Stages.py
++++ b/pbsuite/jelly/Stages.py
+@@ -56,7 +56,7 @@ def mapping(jobDirs, outDir, reference,
+ logging.basicConfig( stream=sys.stderr, level=level, format=logFormat )
+ logging.info("Running blasr")
+
+- mappingTemplate = Template("blasr ${fasta} ${ref} ${sa} -m 4 -out ${outFile} ${parameters} ")
++ mappingTemplate = Template("blasr ${fasta} ${ref} ${sa} -m 4 --out ${outFile} ${parameters} ")
+ tailTemplate = Template("m4pie.py ${outFile} ${fasta} ${ref} --nproc ${nproc} -i ${extras}")
+
+ ret = []
+@@ -79,7 +79,7 @@ def mapping(jobDirs, outDir, reference,
+ logging.warning("Output File %s already exists and will be overwritten." % (outFile))
+
+ #Build Blasr Command
+- nprocRe = re.compile("-nproc (\d+)")
++ nprocRe = re.compile("--nproc (\d+)")
+ np = nprocRe.findall(parameters + extras)
+ if len(np) == 0:
+ np = '1'
+--- a/pbsuite/jelly/m4pie.py
++++ b/pbsuite/jelly/m4pie.py
+@@ -75,8 +75,8 @@ def mapTails(fq, ref, nproc=1, out="tail
+ sa = "-sa " + ref + ".sa"
+ else:
+ sa = ""
+- cmd = ("blasr %s %s %s -nproc %d -m 4 -bestn 1 -nCandidates 20 -out %s"
+- " -minPctIdentity 75 -sdpTupleSize 6 -noSplitSubreads") \
++ cmd = ("blasr %s %s %s --nproc %d -m 4 --bestn 1 --nCandidates 20 --out %s"
++ " -minPctIdentity 75 --sdpTupleSize 6 -noSplitSubreads") \
+ % (fq, ref, sa, nproc, out)
+
+ logging.debug(cmd)
+--- a/pbsuite/jelly/Assembly.py
++++ b/pbsuite/jelly/Assembly.py
+@@ -18,8 +18,8 @@ def blasr(query, target, fmt="5", bestn=
+ """
+ Simple overlapper
+ """
+- c = ("blasr %s %s -m %s -bestn %d -nCandidates %d -minMatch 8 -sdpTupleSize 6 -affineAlign "
+- "-nproc %d -noSplitSubreads -out %s -minPctIdentity 60 -minReadLength 5") % \
++ c = ("blasr %s %s -m %s --bestn %d --nCandidates %d --minMatch 8 --sdpTupleSize 6 --affineAlign "
++ "--nproc %d -noSplitSubreads --out %s -minPctIdentity 60 --minReadLength 5") % \
+ (query, target, fmt, bestn, nCandidates, nproc, outname)
+ logging.debug(c)
+ r,o,e = exe(c)
+--- a/pbsuite/banana/Banana.py
++++ b/pbsuite/banana/Banana.py
+@@ -23,8 +23,8 @@ def blasr(query, target, nproc = 1, outn
+ """
+ Simple overlapper
+ """
+- r,o,e = exe(("blasr %s %s -m 5 -bestn 200 -nCandidates 200 -minMatch 12 "
+- "-affineExtend 3 -nproc %d -noSplitSubreads -out %s -maxScore -1000") % \
++ r,o,e = exe(("blasr %s %s -m 5 --bestn 200 --nCandidates 200 --minMatch 12 "
++ "-affineExtend 3 --nproc %d -noSplitSubreads --out %s --maxScore -1000") % \
+ (query, target, nproc, outname))
+
+ def m5ToOvlGraph(readNames, fileName):
+--- a/pbsuite/banana/OLCAssembly.py
++++ b/pbsuite/banana/OLCAssembly.py
+@@ -158,9 +158,9 @@ class OLCAssembly:
+ Takes all of the pools and generates their fastq and alignments in their own folder.
+ """
+ logging.info("Creating Overlap")
+- log = _exe(("blasr inputReads.fastq reference.fasta -nproc %d -m 4 "
+- "-out temp.rm4 -noSplitSubreads -useGuidedAlign -allowAdjacentIndels "#-minFrac 0.01
+- "-nCandidates 20 -bestn 15 -minMatch 8 -maxLCPLength 16 ") % (self.options.nproc) )
++ log = _exe(("blasr inputReads.fastq reference.fasta --nproc %d -m 4 "
++ "--out temp.rm4 -noSplitSubreads -useGuidedAlign --allowAdjacentIndels "#-minFrac 0.01
++ "--nCandidates 20 --bestn 15 --minMatch 8 --maxLCPLength 16 ") % (self.options.nproc) )
+ logging.debug(log)
+ logging.info("Sorting the alignments")
+ logging.debug(_exe("sort temp.rm4 > alignments.rm4"))
+--- a/pbsuite/banana/Polish.py
++++ b/pbsuite/banana/Polish.py
+@@ -17,7 +17,7 @@ def blasr(query, target, nproc=1, bestn=
+ """
+ runs blasr
+ """
+- r,o,e = exe("blasr %s %s -bestn %d -affineAlign -m 5 -nproc %d -out %s" \
++ r,o,e = exe("blasr %s %s --bestn %d --affineAlign -m 5 --nproc %d --out %s" \
+ % (query, target, bestn, nproc, outName))
+
+
+--- a/docs/TemplateProtocol.xml
++++ b/docs/TemplateProtocol.xml
+@@ -6,7 +6,7 @@
+ <command notes="For PBS/Moab">echo '${CMD}' | msub -N "${JOBNAME}" -o ${STDOUT} -e ${STDERR} -l nodes=1:ppn=8,mem=48000mb</command>
+ <nJobs>1</nJobs>
+ </cluster>
+- <blasr>-minMatch 8 -sdpTupleSize 8 -minPctIdentity 75 -bestn 1 -nCandidates 10 -maxScore -500 -nproc 8 -noSplitSubreads</blasr>
++ <blasr>--minMatch 8 -sdpTupleSize 8 -minPctIdentity 75 --bestn 1 --nCandidates 10 --maxScore -500 --nproc 8 -noSplitSubreads</blasr>
+ <input baseDir="/FULL/PATH/TO__/PBJelly/lambdaExample/data/reads/">
+ <job>pacbioReads.fasta</job>
+ </input>
+--- a/docs/jellyExample/Protocol.xml
++++ b/docs/jellyExample/Protocol.xml
+@@ -1,7 +1,7 @@
+ <jellyProtocol>
+ <reference>/__PATH__/_TO_/jellyExample/data/reference/lambda.fasta</reference>
+ <outputDir>/__PATH__/_TO_/jellyExample/</outputDir>
+- <blasr>-minMatch 8 -minPctIdentity 70 -bestn 1 -nCandidates 20 -maxScore -500 -nproc 4 -noSplitSubreads</blasr>
++ <blasr>--minMatch 8 -minPctIdentity 70 --bestn 1 --nCandidates 20 --maxScore -500 --nproc 4 -noSplitSubreads</blasr>
+ <input baseDir="/__PATH__/_TO_/jellyExample/data/reads/">
+ <job>filtered_subreads.fastq</job>
+ </input>
diff --git a/debian/patches/series b/debian/patches/series
index 3435ec7..e6d63aa 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ intervaltree-import-statement.patch
rm-intervaltree-dependency.patch
fix-example.patch
fix-shebang-lines.patch
+fix_new_blasr_interface.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