[med-svn] [pipasic] 03/03: More fixes needed to pass the test suite
Andreas Tille
tille at debian.org
Fri Oct 2 11:22:43 UTC 2015
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository pipasic.
commit 87553d666fa3d02b948d7503a648ed2d301dadea
Author: Andreas Tille <tille at debian.org>
Date: Fri Oct 2 15:21:21 2015 +0200
More fixes needed to pass the test suite
---
debian/patches/check_output_option_for_file.patch | 18 +++++++++++++
debian/patches/ensure_output_dir.patch | 21 +++++++++++++++
debian/patches/safe_path_names.patch | 33 +++++++++++++++++++++++
debian/patches/series | 3 +++
4 files changed, 75 insertions(+)
diff --git a/debian/patches/check_output_option_for_file.patch b/debian/patches/check_output_option_for_file.patch
new file mode 100644
index 0000000..7a378ac
--- /dev/null
+++ b/debian/patches/check_output_option_for_file.patch
@@ -0,0 +1,18 @@
+Author: Andreas Tille <tille at debian.org>
+Last-update: Tue, 29 Sep 2015 15:21:50 +0200
+Description: The doc for the eyample dataset mentions "-o test_results/" which is
+ plain wrong according to the code a file needs to be specified. Enabling
+ accepting a directory as well.
+
+--- a/pipasic.py
++++ b/pipasic.py
+@@ -85,6 +85,9 @@ Note: Pipasic requires two .fasta for ea
+ if not outfile:
+ print "No output filename given. Writing all output to working directory, 'output'-files\n"
+ outfile = "output.txt"
++ if outfile.endswith('/'):
++ print "given output target is a directory - appending 'output.txt' ...\n"
++ outfile = os.path.join(outfile, 'output.txt')
+ labels = options.labels
+ if labels:
+ labels = labels.split(",")
diff --git a/debian/patches/ensure_output_dir.patch b/debian/patches/ensure_output_dir.patch
new file mode 100644
index 0000000..cc95282
--- /dev/null
+++ b/debian/patches/ensure_output_dir.patch
@@ -0,0 +1,21 @@
+Author: Andreas Tille <tille at debian.org>
+Last-update: Tue, 29 Sep 2015 15:21:50 +0200
+Description: Ensure the output directory exists
+
+--- a/pipasic.py
++++ b/pipasic.py
+@@ -132,7 +132,13 @@ Note: Pipasic requires two .fasta for ea
+ print "Could not find PSM-file '%s' for %s and %s" %(inspectOut,spec,DB)
+ sample_counts.append(0)
+ countList.append(sample_counts)
+- np.array(countList).dump(os.path.splitext(outfile)[0]+"_counts.dat")
++ outputdir=os.path.splitext(outfile)[0]
++ try:
++ os.makedirs(outputdir)
++ except OSError:
++ if not os.path.isdir(outputdir):
++ raise
++ np.array(countList).dump(os.path.join(outputdir,"_counts.dat"))
+ else:
+ print "Aborting. - Spectra and reference proteomes needed as the arguments!"
+ optparser.print_help()
diff --git a/debian/patches/safe_path_names.patch b/debian/patches/safe_path_names.patch
index 72aab99..be99b7f 100644
--- a/debian/patches/safe_path_names.patch
+++ b/debian/patches/safe_path_names.patch
@@ -75,6 +75,24 @@ Description: Make sure directory and file are properly separated
try:
count = parseInspect(inpath=inspectOut,fdr_countcut=fdr,silent=False)[1]
sample_counts.append(count)
+@@ -150,7 +150,7 @@ Note: Pipasic requires two .fasta for ea
+ print "Aborting. - Reference proteomes needed as (only or 2nd) argument!"
+ optparser.print_help()
+ sys.exit(1)
+- dbList = ",".join([options.db_dir+db+".fasta" for db in db_list])
++ dbList = ",".join([os.path.join(options.db_dir,db+".fasta") for db in db_list])
+ from trypticpeptides import unweightedMatrix
+ simiMat_unw = unweightedMatrix(dbList=dbList, verbose=verbose)
+ np.array(simiMat_unw).dump(os.path.splitext(outfile)[0]+"_M_unw.dat")
+@@ -160,7 +160,7 @@ Note: Pipasic requires two .fasta for ea
+ if len(args) == 2:
+ spectra = args[0].split(',')
+ db_list = args[1].split(',')
+- dbList = ",".join([options.db_dir+db+".fasta" for db in db_list])
++ dbList = ",".join([os.path.join(options.db_dir,db+".fasta") for db in db_list])
+ else:
+ print "Aborting. - Spectra and reference proteomes needed as the arguments!"
+ optparser.print_help()
@@ -168,7 +168,7 @@ Note: Pipasic requires two .fasta for ea
from trypticpeptides import weightedMatrix
M_list_wtd = []
@@ -93,3 +111,18 @@ Description: Make sure directory and file are properly separated
try:
count = parseInspect(inpath=inspectOut,fdr_countcut=fdr,silent=False)[1]
sample_counts.append(count)
+--- a/plotting.py
++++ b/plotting.py
+@@ -58,9 +58,9 @@ plot PASiC results.
+ if len(args) < 2:
+ command_parser.print_help()
+ sys.exit(1)
+- obs = np.load(options.f_dir+args[0])
+- corr = np.load(options.f_dir+args[1])
+- if len(args) > 2: wtd = np.load(options.f_dir+args[2])
++ obs = np.load(os.path.join(options.f_dir,args[0]))
++ corr = np.load(os.path.join(options.f_dir,args[1]))
++ if len(args) > 2: wtd = np.load(os.path.join(options.f_dir,args[2]))
+ else: wtd = []
+ input_tags = options.tags.split(",")
+ if options.names: names = options.names.split(",")
diff --git a/debian/patches/series b/debian/patches/series
index 2bb5a96..fc34d87 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,6 @@ inspect_files.patch
verbosity.patch
safe_path_names.patch
config.patch
+ensure_output_dir.patch
+# debug.patch
+check_output_option_for_file.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/pipasic.git
More information about the debian-med-commit
mailing list