The runfolder subdirectory processing tools (firecrest, bustard, gerald, etc.)
were importing runfolder for some common constants, however runfolder
imported them to actually build the runfolder structure.
My previous solution was to only include the imports for the
sub-directory processing in the function that used them.
However that lead to needing nested functions which seemed confusing.
What I did was move the common constants into pipelines.__init__
and just imported them from there.
23 files changed:
the illumina sub-package contains components to interact with the Illumina provided
GAPipeline
"""
the illumina sub-package contains components to interact with the Illumina provided
GAPipeline
"""
+import lxml.etree as ElementTree
+
+EUROPEAN_STRPTIME = "%d-%m-%Y"
+EUROPEAN_DATE_RE = "([0-9]{1,2}-[0-9]{1,2}-[0-9]{4,4})"
+VERSION_RE = "([0-9\.]+)"
+USER_RE = "([a-zA-Z0-9]+)"
+LANES_PER_FLOWCELL = 8
+LANE_LIST = range(1, LANES_PER_FLOWCELL + 1)
+
-from htsworkflow.pipelines.runfolder import \
+from htsworkflow.pipelines import \
ElementTree, \
VERSION_RE, \
EUROPEAN_STRPTIME
ElementTree, \
VERSION_RE, \
EUROPEAN_STRPTIME
-from htsworkflow.pipelines.runfolder import ElementTree, LANE_LIST
+from htsworkflow.pipelines import ElementTree, LANE_LIST
from htsworkflow.pipelines.samplekey import SampleKey
from htsworkflow.pipelines.genomemap import GenomeMap
from htsworkflow.util.ethelp import indent, flatten
from htsworkflow.pipelines.samplekey import SampleKey
from htsworkflow.pipelines.genomemap import GenomeMap
from htsworkflow.util.ethelp import indent, flatten
-from htsworkflow.pipelines.runfolder import \
+from htsworkflow.pipelines import \
ElementTree, \
VERSION_RE, \
EUROPEAN_STRPTIME
ElementTree, \
VERSION_RE, \
EUROPEAN_STRPTIME
from glob import glob
import os
import collections
from glob import glob
import os
import collections
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
vldInfo = collections.namedtuple('vldInfo', 'name is_link')
vldInfo = collections.namedtuple('vldInfo', 'name is_link')
from htsworkflow.pipelines.eland import eland, ELAND
from htsworkflow.pipelines.samplekey import SampleKey
from htsworkflow.pipelines.eland import eland, ELAND
from htsworkflow.pipelines.samplekey import SampleKey
-from htsworkflow.pipelines.runfolder import \
+from htsworkflow.pipelines import \
ElementTree, \
EUROPEAN_STRPTIME, \
LANES_PER_FLOWCELL, \
ElementTree, \
EUROPEAN_STRPTIME, \
LANES_PER_FLOWCELL, \
-from htsworkflow.pipelines.runfolder import \
+from htsworkflow.pipelines import \
ElementTree, \
VERSION_RE, \
EUROPEAN_STRPTIME
ElementTree, \
VERSION_RE, \
EUROPEAN_STRPTIME
from htsworkflow.pipelines.genome_mapper import \
getAvailableGenomes, \
constructMapperDict
from htsworkflow.pipelines.genome_mapper import \
getAvailableGenomes, \
constructMapperDict
-from htsworkflow.pipelines.runfolder import LANE_LIST
+from htsworkflow.pipelines import LANE_LIST
# JSON dictionaries use strings
LANE_LIST_JSON = [ str(l) for l in LANE_LIST ]
# JSON dictionaries use strings
LANE_LIST_JSON = [ str(l) for l in LANE_LIST ]
import tarfile
import time
import tarfile
import time
-import lxml.etree as ElementTree
-
LOGGER = logging.getLogger(__name__)
LOGGER = logging.getLogger(__name__)
-EUROPEAN_STRPTIME = "%d-%m-%Y"
-EUROPEAN_DATE_RE = "([0-9]{1,2}-[0-9]{1,2}-[0-9]{4,4})"
-VERSION_RE = "([0-9\.]+)"
-USER_RE = "([a-zA-Z0-9]+)"
-LANES_PER_FLOWCELL = 8
-LANE_LIST = range(1, LANES_PER_FLOWCELL + 1)
-
+from htsworkflow.pipelines import firecrest
+from htsworkflow.pipelines import ipar
+from htsworkflow.pipelines import bustard
+from htsworkflow.pipelines import gerald
+from htsworkflow.pipelines import ElementTree, \
+ EUROPEAN_STRPTIME, EUROPEAN_DATE_RE, \
+ VERSION_RE, USER_RE, \
+ LANES_PER_FLOWCELL, LANE_LIST
from htsworkflow.util.alphanum import alphanum
from htsworkflow.util.ethelp import indent, flatten
from htsworkflow.util.queuecommands import QueueCommands
from htsworkflow.util.alphanum import alphanum
from htsworkflow.util.ethelp import indent, flatten
from htsworkflow.util.queuecommands import QueueCommands
def set_elements(self, tree):
# this file gets imported by all the others,
# so we need to hide the imports to avoid a cyclic imports
def set_elements(self, tree):
# this file gets imported by all the others,
# so we need to hide the imports to avoid a cyclic imports
- from htsworkflow.pipelines import firecrest
- from htsworkflow.pipelines import ipar
- from htsworkflow.pipelines import bustard
- from htsworkflow.pipelines import gerald
tag = tree.tag.lower()
if tag != PipelineRun.PIPELINE_RUN.lower():
tag = tree.tag.lower()
if tag != PipelineRun.PIPELINE_RUN.lower():
import types
from pprint import pprint
import types
from pprint import pprint
-#from htsworkflow.pipelines.runfolder import ElementTree
from lxml import html
from lxml import etree
from htsworkflow.util.ethelp import indent, flatten
from lxml import html
from lxml import etree
from htsworkflow.util.ethelp import indent, flatten
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *
import tempfile
from unittest2 import TestCase
import tempfile
from unittest2 import TestCase
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines import genomemap
MINI_GENOME_XML = '''<sequenceSizes>
from htsworkflow.pipelines import genomemap
MINI_GENOME_XML = '''<sequenceSizes>
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines import ipar
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines import srf
from htsworkflow.pipelines import ipar
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines import srf
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines.eland import SampleKey
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines.eland import SampleKey
from htsworkflow.pipelines import runfolder
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines.samplekey import SampleKey
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines.samplekey import SampleKey
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines.samplekey import SampleKey
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines.samplekey import SampleKey
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines.samplekey import SampleKey
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines.samplekey import SampleKey
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
from htsworkflow.pipelines import bustard
from htsworkflow.pipelines import gerald
from htsworkflow.pipelines import runfolder
-from htsworkflow.pipelines.runfolder import ElementTree
+from htsworkflow.pipelines import ElementTree
from htsworkflow.pipelines.test.simulate_runfolder import *
from htsworkflow.pipelines.test.simulate_runfolder import *