import sys
import time
-from htsworkflow.pipelines.runfolder import \
+from htsworkflow.pipelines import \
ElementTree, \
VERSION_RE, \
EUROPEAN_STRPTIME
# make epydoc happy
__docformat__ = "restructuredtext en"
-LANE_LIST = range(1,9)
+LANE_LIST = list(range(1,9))
class Phasing(object):
PHASING = 'Phasing'
for b in base_order:
for value in self.base[b]:
crosstalk_value = ElementTree.SubElement(root, CrosstalkMatrix.ELEMENT)
- crosstalk_value.text = unicode(value)
+ crosstalk_value.text = str(value)
crosstalk_value.tail = os.linesep
return root
self.date = date(*t[0:3])
self.user = groups[2]
+ def _get_sequence_format(self):
+ """Guess sequence format"""
+ project_glob = os.path.join(self.pathname, 'Project_*')
+ LOGGER.debug("Scanning: %s" % (project_glob,))
+ projects = glob(project_glob)
+ if len(projects) > 0:
+ # Hey we look like a demultiplexed run
+ return 'fastq'
+ seqs = glob(os.path.join(self.pathname, '*_seq.txt'))
+ if len(seqs) > 0:
+ return 'srf'
+ return 'qseq'
+ sequence_format = property(_get_sequence_format)
+
def _get_software_version(self):
"""return software name, version tuple"""
if self.bustard_config is None:
# add phasing parameters
for lane in LANE_LIST:
- if self.phasing.has_key(lane):
+ if lane in self.phasing:
params.append(self.phasing[lane].get_elements())
# add crosstalk matrix if it exists
else:
b = bustard_from_ga1(pathname)
+ if not b:
+ raise RuntimeError("Unable to parse base-call directory at %s" % (pathname,))
+
return b
def bustard_from_ga1(pathname):
if len(groups) < 3:
msg = "Not enough information to create attributes"\
" from directory name: %s"
- LOGGER.error(msg % (self.pathname,))
+ LOGGER.error(msg % (pathname,))
return None
b = Bustard()
opts, args = parser.parse_args(cmdline)
for bustard_dir in args:
- print u'analyzing bustard directory: ' + unicode(bustard_dir)
+ print('analyzing bustard directory: ' + str(bustard_dir))
bustard_object = bustard(bustard_dir)
bustard_object.dump()
b2 = ElementTree.tostring(b2_tree).split(os.linesep)
for line1, line2 in zip(b1, b2):
if b1 != b2:
- print "b1: ", b1
- print "b2: ", b2
+ print("b1: ", b1)
+ print("b2: ", b2)
if __name__ == "__main__":
main(sys.argv[1:])