projects
/
htsworkflow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1c62310
)
Adapt building qseq or srf archives to use SampleKey identified lanes
author
Diane Trout
<diane@caltech.edu>
Thu, 19 Jul 2012 18:23:40 +0000
(11:23 -0700)
committer
Diane Trout
<diane@caltech.edu>
Thu, 19 Jul 2012 18:23:40 +0000
(11:23 -0700)
htsworkflow/pipelines/srf.py
patch
|
blob
|
history
diff --git
a/htsworkflow/pipelines/srf.py
b/htsworkflow/pipelines/srf.py
index 4f20ce1873fa42527b52619670ffc7caad8dd2ee..d7efc7d0c3b4682b27e8255e586f469576835f54 100644
(file)
--- a/
htsworkflow/pipelines/srf.py
+++ b/
htsworkflow/pipelines/srf.py
@@
-4,6
+4,7
@@
import os
import shutil
from htsworkflow.util import queuecommands
import shutil
from htsworkflow.util import queuecommands
+from htsworkflow.pipelines.samplekey import SampleKey
LOGGER = logging.getLogger(__name__)
LOGGER = logging.getLogger(__name__)
@@
-52,12
+53,15
@@
def make_srf_commands(run_name, bustard_dir, lanes, site_name, destdir, cmdlevel
LOGGER.info("run_name %s" % (run_name,))
cmd_list = []
LOGGER.info("run_name %s" % (run_name,))
cmd_list = []
- for lane in lanes:
+ for key in lanes:
+ if not isinstance(key, SampleKey):
+ errmsg = "Expected %s got %s"
+ raise ValueError(errmsg % (str(SampleKey), str(type(key))))
name_prefix = '%s_%%l_' % (run_name,)
name_prefix = '%s_%%l_' % (run_name,)
- destname = '%s_%s_%d.srf' % (site_name, run_name, lane)
+ destname = '%s_%s_%d.srf' % (site_name, run_name,
key.
lane)
destdir = os.path.normpath(destdir)
dest_path = os.path.join(destdir, destname)
destdir = os.path.normpath(destdir)
dest_path = os.path.join(destdir, destname)
- seq_pattern = 's_%d_*_seq.txt' % (lane,)
+ seq_pattern = 's_%d_*_seq.txt' % (
key.
lane,)
if cmdlevel == SOLEXA2SRF:
cmd = ['solexa2srf',
if cmdlevel == SOLEXA2SRF:
cmd = ['solexa2srf',
@@
-71,7
+75,7
@@
def make_srf_commands(run_name, bustard_dir, lanes, site_name, destdir, cmdlevel
'-o', dest_path,
seq_pattern]
elif cmdlevel == ILLUMINA2SRF11:
'-o', dest_path,
seq_pattern]
elif cmdlevel == ILLUMINA2SRF11:
- seq_pattern = 's_%d_*_qseq.txt' % (lane,)
+ seq_pattern = 's_%d_*_qseq.txt' % (
key.
lane,)
cmd = ['illumina2srf',
'-o', dest_path,
seq_pattern]
cmd = ['illumina2srf',
'-o', dest_path,
seq_pattern]
@@
-132,20
+136,23
@@
def make_qseq_commands(run_name, bustard_dir, lanes, site_name, destdir, cmdleve
LOGGER.info("run_name %s" % (run_name,))
cmd_list = []
LOGGER.info("run_name %s" % (run_name,))
cmd_list = []
- for lane in lanes:
+ for key in lanes:
+ if not isinstance(key, SampleKey):
+ errmsg = "Expected %s got %s"
+ raise ValueError(errmsg % (str(SampleKey), str(type(key))))
name_prefix = '%s_%%l_%%t_' % (run_name,)
destdir = os.path.normpath(destdir)
qseq_patterns = create_qseq_patterns(bustard_dir)
for read, pattern in qseq_patterns:
if read is None:
name_prefix = '%s_%%l_%%t_' % (run_name,)
destdir = os.path.normpath(destdir)
qseq_patterns = create_qseq_patterns(bustard_dir)
for read, pattern in qseq_patterns:
if read is None:
- destname = '%s_%s_l%d.tar.bz2' % (site_name, run_name, lane)
+ destname = '%s_%s_l%d.tar.bz2' % (site_name, run_name,
key.
lane)
dest_path = os.path.join(destdir, destname)
else:
dest_path = os.path.join(destdir, destname)
else:
- destname = '%s_%s_l%d_r%d.tar.bz2' % (site_name, run_name, lane, read)
+ destname = '%s_%s_l%d_r%d.tar.bz2' % (site_name, run_name,
key.
lane, read)
dest_path = os.path.join(destdir, destname)
dest_path = os.path.join(destdir, destname)
- cmd = " ".join(['tar', 'cjf', dest_path, pattern % (lane,) ])
+ cmd = " ".join(['tar', 'cjf', dest_path, pattern % (
key.
lane,) ])
LOGGER.info("Generated command: " + cmd)
cmd_list.append(cmd)
LOGGER.info("Generated command: " + cmd)
cmd_list.append(cmd)