Commit 4851e365 authored by Nikos Sidiropoulos's avatar Nikos Sidiropoulos
Browse files

Tidy code

parent da5002cf
Loading
Loading
Loading
Loading
+13 −11
Changes for PBS/scripts/split_rmdups.awk: 13 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -35,13 +35,14 @@ BEGIN{
	if (tot >= 1000000) {
		if (p1 != $1 || p2 != $2 || p4 != $4 || p5 != $5 || p8 != $8) {
			print "this is the beginging part of split rmdups awk";
            cmd=sprintf("qstat | grep osplit%s |cut -c 1-7", groupname);
			cmd=sprintf("qstat | grep osplit%s |cut -c 1-8", groupname);
			cmd |& getline jID_osplit;
			sname=sprintf("%s_msplit%04d_", groupname, name);
			sysstring1=sprintf("qsub -l %s -o %s_%s.log -j oe -q %s -N DDuP%s%s -l mem=4gb -l nodes=1:ppn=1:AMD -W depend=afterok:%s <<-EOF\nawk -f  %s/scripts/dups.awk -v name=%s/%s %s/split%04d;\nEOF\n", walltime, outfile, sname, queue, name, groupname, jID_osplit ,juicedir, dir, sname, dir, name, dir, name);
			sysstring1=sprintf("qsub -l %s -o %s_%s.log -j oe -W group_list=cu_10027 -A cu_10027 -q %s -N DDuP%s%s -l mem=4gb -l nodes=1:ppn=1:thinnode -W depend=afterok:%s <<-EOF\nawk -f  %s/scripts/dups.awk -v name=%s/%s %s/split%04d;\nEOF\n", walltime, outfile, sname, queue, name, groupname, jID_osplit ,juicedir, dir, sname, dir, name, dir, name);
			system(sysstring1);
            cmd1=sprintf("qstat | grep DDuP%s%s | cut -d ' ' -f 1",name,groupname);
			cmd1=sprintf("qstat | grep DDuP%s%s | cut -d ' ' -f 1 | cut -d '.' -f 1-2",name,groupname);
			cmd1 |& getline jID;

			close(cmd1);
			if (name==0){
				waitstring=sprintf("%s",jID );
@@ -65,9 +66,11 @@ END {
   	sname=sprintf("%s_msplit%04d_", groupname, name);
    print "This is the begining of END step, submitting _dedup job in END step";
	sysstring2=sprintf("qsub -l %s -o %s_%s_dedup%s.log -j oe -q %s -N DDuP%s%s -W depend=afterok:%s <<-EOF\nawk -f %s/scripts/dups.awk -v name=%s/%s %s/split%04d;\nEOF\n", walltime, outfile, sname, name, queue, name, groupname, jID_osplit ,juicedir, dir, sname, dir, name, dir, name);
    system(sysstring2);
	sname=sprintf("%s_msplit%04d_", groupname, name);
	system(sysstring2);

    cmd2=sprintf("qstat | grep DDuP%s%s | cut -d ' ' -f 1",name,groupname);
	cmd2=sprintf("qstat | grep DDuP%s%s | cut -d ' ' -f 1 | cut -d '.' -f 1-2",name,groupname);
	cmd2 |& getline jID;
	close(cmd2);
	if ( name==0 ){
@@ -83,23 +86,22 @@ END {
	close(cmd3)
	print "below is the waitingstring1 and waitingstring2";
	print waitstring;
	sysstring = sprintf("qsub -l %s -o %s_catsplit.log -j oe -q %s -N CtSplt%s -W depend=afterok:%s <<-EOF\ncat %s/%s_msplit*_optdups.txt > %s/opt_dups.txt;  cat %s/%s_msplit*_dups.txt > %s/dups.txt; cat %s/%s_msplit*_merged_nodups.txt > %s/merged_nodups.txt; \nEOF\n", walltime, outfile, queue, groupname, waitstring, dir, groupname, dir, dir, groupname, dir, dir, groupname, dir, dir);
	print waitstring2;
    print "below is te waited job status before qsub"
    print $waitedjobstatus;
	print "below is the waited job status before qsub"
	print waitedjobstatus;
	print "submitting _catsplit jobs";
	sysstring = sprintf("qsub -l %s -o %s_catsplit.log -j oe -q %s -N CtSplt%s -W depend=afterok:%s <<-EOF\ncat %s/%s_msplit*_optdups.txt > %s/opt_dups.txt;  cat %s/%s_msplit*_dups.txt > %s/dups.txt; cat %s/%s_msplit*_merged_nodups.txt > %s/merged_nodups.txt; \nEOF\n", walltime, outfile, queue, groupname, waitstring, dir, groupname, dir, dir, groupname, dir, dir, groupname, dir, dir);
	system(sysstring);
    cmd4=sprintf("qstat | grep CtSplt%s | cut -d ' ' -f 1",groupname);
	cmd4=sprintf("qstat | grep CtSplt%s | cut -d ' ' -f 1 | cut -d '.' -f 1-2",groupname);
	cmd4 |& getline jID_catsplit;
	close(cmd4);
	print "below is the _catsplit id";
	print jID_catsplit;
    print "submitting _rmsplit jobs";
	sysstring=sprintf("qsub -l %s -o %s_rmsplit.log -j oe -q %s -N RmSplt%s -W depend=afterok:%s <<-EOF\n rm %s/*_msplit*_optdups.txt; rm %s/*_msplit*_dups.txt; rm %s/*_msplit*_merged_nodups.txt; rm %s/split*;\nEOF", walltime, outfile, queue, groupname,jID_catsplit, dir, dir, dir, dir);
	print "submitting _rmsplit jobs";
	system(sysstring);
    cmd=sprintf("qstat | grep RmSplt%s | cut -d ' ' -f 1",groupname);
	cmd=sprintf("qstat | grep RmSplt%s | cut -d ' ' -f 1 | cut -d '.' -f 1-2",groupname);
	cmd |& getline jID_rmsplit;
	print "below is the jID_rmsplit:";
	print jID_rmsplit;
}