Merging heads

This commit is contained in:
Nate Coraor
2008-11-10 12:42:40 -05:00
4 changed files with 100 additions and 2 deletions
+1
View File
@@ -327,6 +327,7 @@ class RootController( BaseController ):
# Are *all* of the job's other output datasets deleted?
if job.check_if_output_datasets_deleted():
job.mark_deleted()
self.app.job_manager.job_stop_queue.put( job )
self.app.model.flush()
@web.expose
+17 -1
View File
@@ -7,6 +7,7 @@ from itertools import *
import twill
import twill.commands as tc
from twill.other_packages._mechanize_dist import ClientForm
pkg_resources.require( "elementtree" )
from elementtree import ElementTree
buffer = StringIO.StringIO()
@@ -255,7 +256,7 @@ class TwillTestCase( unittest.TestCase ):
self.assertTrue( data_list )
if hid is None: # take last hid
elem = data_list[-1]
hid = elem.get('hid')
hid = int( elem.get('hid') )
self.assertTrue( hid )
self.visit_page( 'edit?hid=%d' % hid )
if form_no == 0:
@@ -511,6 +512,21 @@ class TwillTestCase( unittest.TestCase ):
tc.find( 'runtool_btn' )
self.submit_form( **kwd )
def run_ucsc_main( self, track_params, output_params ):
"""Gets Data From UCSC"""
tool_id = "ucsc_table_direct1"
track_string = urllib.urlencode( track_params )
galaxy_url = urllib.quote_plus( "%s/tool_runner/index?" % self.url )
self.visit_url( "http://genome.ucsc.edu/cgi-bin/hgTables?GALAXY_URL=%s&hgta_compressType=none&tool_id=%s&%s" % ( galaxy_url, tool_id, track_string ) )
tc.fv( "1","hgta_doTopSubmit", "get output" )
self.submit_form( button="get output" )#, **track_params )
tc.fv( "1","hgta_doGalaxyQuery", "Send query to Galaxy" )
self.submit_form( button="Send query to Galaxy" )#, **output_params ) #AssertionError: Attempting to set field 'fbQual' to value '['whole']' in form 'None' threw exception: no matching forms! control: <RadioControl(fbQual=[whole, upstreamAll, endAll])>
def wait( self, maxiter=20 ):
"""Waits for the tools to finish"""
count = 0
+3 -1
View File
@@ -16,6 +16,7 @@ from galaxy.app import UniverseApplication
from galaxy.web import buildapp
import test_toolbox
from galaxy import tools
from galaxy.util import bunch
log = logging.getLogger( __name__ )
@@ -93,7 +94,8 @@ def setup():
else:
# FIXME: This doesn't work at all now that toolbox requires an 'app' instance
# (to get at datatypes, might just pass a datatype registry directly)
test_toolbox.toolbox = tools.ToolBox( 'tool_conf.xml.test', 'tools' )
my_app = bunch.Bunch( datatypes_registry = galaxy.datatypes.registry.Registry() )
test_toolbox.toolbox = tools.ToolBox( 'tool_conf.xml.test', 'tools', my_app )
# Test if the server is up
conn = httplib.HTTPConnection( galaxy_test_host, galaxy_test_port )
@@ -0,0 +1,79 @@
from base.twilltestcase import TwillTestCase
""" A sample analysis"""
class AnalysisDNAseHSSFlankedGenes( TwillTestCase ):
def test_get_DNAseHSS_flanked_genes( self ):
self.login()
self.new_history()
track_params = dict(
db="hg17",
hgta_group="regulation",
hgta_table="dukeDnaseCd4Sites",
hgta_track="dukeDnaseCd4Sites",
hgta_regionType="range",
position="chr22",
hgta_outputType="bed",
sendToGalaxy="1"
)
output_params = dict(
fbQual="whole",
)
self.run_ucsc_main( track_params, output_params )
self.wait()
self.verify_dataset_correctness('DNAseHSS.dat')
self.edit_metadata( name="DNAse HS" )
self.check_metadata_for_string( "DNAse HS" )
track_params = dict(
db="hg17",
hgta_group="genes",
hgta_table="knownGene",
hgta_track="knownGene",
hgta_regionType="range",
position="chr22",
hgta_outputType="bed",
sendToGalaxy="1"
)
output_params = dict(
fbQual="whole",
)
self.run_ucsc_main( track_params, output_params )
self.wait()
self.verify_dataset_correctness('hg17chr22KnownGenes.dat')
self.edit_metadata( name="Genes" )
self.check_metadata_for_string( "Genes" )
self.run_tool( 'get_flanks1', input="2", region="whole", direction="Upstream", offset="0", size="500" )
self.wait()
self.verify_dataset_correctness( 'knownGeneUpstream500Flanks.dat' )
self.edit_metadata( name="Flanks" )
self.check_metadata_for_string( "Flanks" )
self.run_tool( 'gops_join_1', input1="3", input2="1", min="1", fill="none" )
self.wait()
#self.verify_dataset_correctness( 'joinFlanksDNAse.dat' ) #we cannot verify this dataset, because this tool spits out data in a non-deterministic order
self.run_tool( 'Filter1', input="4", cond="c17==1000" )
self.wait()
self.verify_dataset_correctness( 'filteredJoinedFlanksDNAse.dat' )
self.delete_history()
self.logout()