1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
Author: Andreas Tille <tille@debian.org>
Last-Update: Wed, 20 Apr 2016 10:31:32 +0200
Description: Some plain debugging was helpful to understand how parsnp works
leave this as a deactivated patch
--- a/Parsnp.py
+++ b/Parsnp.py
@@ -936,6 +936,7 @@ if __name__ == "__main__":
#3)run parsnp (cores, grid?)
print "-->Running Parsnp multi-MUM search and libMUSCLE aligner.."
if not os.path.exists(outputDir+os.sep+"blocks"):
+ print "DEBUG: mkdir", outputDir+os.sep+"blocks"
os.mkdir(outputDir+os.sep+"blocks")
command = ""
run_parsnp = 1
@@ -951,14 +952,16 @@ if __name__ == "__main__":
command = "/usr/lib/parsnp/parsnp %sparsnpAligner.ini"%(outputDir+os.sep)
else:
command = "/usr/lib/parsnp/parsnp %spsnn.ini"%(outputDir+os.sep)
+ print "DEBUG not inifile_exists -> command:", command
else:
if not os.path.exists(inifile):
sys.stderr.write("Error: ini file %s does not exist!\n"%(inifile))
sys.exit(1)
command = "/usr/lib/parsnp/parsnp %s"%(inifile)
+ print "DEBUG inifile_exists -> command:", command
run_command(command)
-
+ print "DEBUG command successful:", command
if not os.path.exists(outputDir+os.sep+"parsnpAligner.xmfa"):
successful_run = False
@@ -971,6 +974,7 @@ if __name__ == "__main__":
runcnt +=1
break
os.system("mv "+outputDir+os.sep+"parsnpAligner.xmfa "+outputDir+os.sep+"parsnp.xmfa")
+ print "DEBUG 'if run_parsnp' is done"
xmfafile = open(outputDir+os.sep+"parsnp.xmfa",'r')
file2hdr_dict = {}
@@ -995,6 +999,7 @@ if __name__ == "__main__":
sys.exit(1)
#update thresholds
+ print "DEBUG update thresholds"
if coverage <= 0.01:
sys.stderr.write( " |->["+ERROR_RED+"ERROR"+ENDC+"]"+": aligned regions cover less than 1% of reference genome, something is not right.. please adjust params and rerun. If problem persists please contact developers (treangen@gmail.com)"+ENDC)
sys.exit(1)
--- a/src/parsnp.cpp
+++ b/src/parsnp.cpp
@@ -517,6 +517,7 @@ void Aligner::writeOutput(string psnp,ve
test.append("/parsnpAligner.log");
lcbdir.append("/blocks/");
lcbprefix.append("/blocks/b");
+cerr << "DEBUG: Try to create testfile " << test.c_str() << endl;
try
{
ofstream testfile ( test.c_str() );
@@ -525,12 +526,13 @@ void Aligner::writeOutput(string psnp,ve
}
catch ( char const * str )
{
- string command = "mkdir ";
+cerr << "DEBUG: Opening testfile " << test.c_str() << " failed - try to create directory " << this->outdir << endl;
+ string command = "mkdir -p ";
command.append(this->outdir);
int result = system(command.c_str());
if ( result )
{
- cerr << "ParSNP:: error creating output directory, exiting.." << endl;
+ cerr << "ParSNP:: error creating output directory" << this->outdir << ", exiting.." << endl;
exit(1);
}
}
|