Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tagged version

  • Loading branch information...
commit 2750d8fe927e0d655b8b5ee9834f361eee2f7806 1 parent f852e54
@brantp authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 estimate_error_by_clustering.py
View
26 estimate_error_by_clustering.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+
+import os, sys
+from config import RTDROOT
+from preprocess_radtag_lane import smartopen
+from rtd_run import readlen_from_uniqued
+from glob import glob
+
+if __name__ == "__main__":
+
+ outfile, cutsite, engine, cores, parts, threads, radius = sys.argv[1:]
+
+ readlen = readlen_from_uniqued(outfile)
+
+ err_clust_root = outfile.rstrip('.gz') + '-rtd'
+ cmd = os.path.join(RTDROOT,'rtd_run.py --cleanup -pe %s -np %s -nc %s -I %s -te %s -s %s -cs %s %s' % (engine,parts, cores, radius, threads, cutsite, err_clust_root, outfile))
+ print >> sys.stderr, cmd
+ ret = os.system(cmd)
+ if ret != 0:
+ raise OSError, 'rtd_run failed'
+
+ cdest_file = glob(os.path.join(err_clust_root,'*I%s*.clstats.cdest' % radius))[0]
+ cdest = float(open(cdest_file).read())
+ errest = cdest/readlen
+ print >> sys.stderr, 'sequencing error estimates: cluster dirt %0.4f, per-base error: %0.4f' % (cdest,errest)
+ open(os.path.splitext(cdest_file)[0]+'.errest','w').write(errest.__repr__())
Please sign in to comment.
Something went wrong with that request. Please try again.