[hg] galaxy 3799: Unreverted js changes from JG - for some stran...
details: http://www.bx.psu.edu/hg/galaxy/rev/e5bbcf6ebf6c changeset: 3799:e5bbcf6ebf6c user: fubar: ross Lazarus at gmail period com date: Fri May 21 13:43:50 2010 -0400 description: Unreverted js changes from JG - for some strange reason they break the tool upload form here although functional tests seem fine diffstat: lib/galaxy/datatypes/interval.py | 50 ++++++++++++++++++++++++++++--------- lib/galaxy/tools/__init__.py | 2 + tools/rgenetics/rgEigPCA.xml | 3 +- tools/rgenetics/rgHaploView.xml | 6 ++-- tools/rgenetics/rgtest_one_tool.sh | 7 +++- 5 files changed, 49 insertions(+), 19 deletions(-) diffs (163 lines): diff -r 3ad722e3c101 -r e5bbcf6ebf6c lib/galaxy/datatypes/interval.py --- a/lib/galaxy/datatypes/interval.py Thu May 20 17:00:12 2010 -0400 +++ b/lib/galaxy/datatypes/interval.py Fri May 21 13:43:50 2010 -0400 @@ -140,28 +140,32 @@ else: empty_line_count += 1 + def get_estimated_display_viewport( self, dataset ): """Return a chrom, start, stop tuple for viewing a file.""" if dataset.has_data() and dataset.state == dataset.states.OK: try: c, s, e = dataset.metadata.chromCol, dataset.metadata.startCol, dataset.metadata.endCol c, s, e = int(c)-1, int(s)-1, int(e)-1 - + try: + skipme = int(dataset.metadata.comment_lines) + except: + skipme = 0 peek = [] for idx, line in enumerate(file(dataset.file_name)): if line[0] != '#': peek.append( line.rstrip( '\n\r' ).split() ) - if idx > 10: + if idx > 100 and idx > skipme: # viewport should have at least 100 features break - chr, start, stop = peek[0][c], int( peek[0][s] ), int( peek[0][e] ) + chr, start, stop = peek[skipme][c], int( peek[skipme][s] ), int( peek[skipme][e] ) - for p in peek[1:]: + for p in peek[(skipme+1):]: if p[0] == chr: start = min( start, int( p[s] ) ) stop = max( stop, int( p[e] ) ) except Exception, exc: - #log.error( 'Viewport generation error -> %s ' % str(exc) ) + log.error( 'Viewport generation error -> %s ' % str(exc) ) (chr, start, stop) = 'chr1', 1, 1000 return (chr, str( start ), str( stop )) else: @@ -864,20 +868,42 @@ Tabular.__init__( self, **kwd ) self.add_display_app( 'ucsc', 'display at UCSC', 'as_ucsc_display_file', 'ucsc_links' ) self.add_display_app( 'gbrowse', 'display in Gbrowse', 'as_gbrowse_display_file', 'gbrowse_links' ) + def get_estimated_display_viewport( self, dataset ): - value = ( "", "", "" ) num_check_lines = 100 # only check up to this many non empty lines + vstart = None + vend = 0 + vwig_chr = '?' + value = None for i, line in enumerate( file( dataset.file_name ) ): line = line.rstrip( '\r\n' ) - if line and line.startswith( "browser" ): - chr_info = line.split()[-1] - wig_chr, coords = chr_info.split( ":" ) - start, end = coords.split( "-" ) - value = ( wig_chr, start, end ) - break + if line: + if line.startswith( "browser" ): + chr_info = line.split()[-1] + wig_chr, coords = chr_info.split( ":" ) + start, end = coords.split( "-" ) + value = ( wig_chr, start, end ) + break + # variableStep chrom=chr20 + if line and (line.lower().startswith( "variablestep" ) or line.lower().startswith( "fixedstep" )): + c = line.split("chr")[-1] + c = c.split()[0] + vwig_chr = 'chr%s' % c + else: + try: + offset = line.split()[0] + offset = int(offset) + vend = max(vend,offset) + if not vstart: + vstart = offset # first + except: + pass if i > num_check_lines: break + if value == None: + value = (vwig_chr, vstart, vend) return value + def _get_viewer_range( self, dataset ): """Retrieve the chromosome, start, end for an external viewer.""" if dataset.has_data: diff -r 3ad722e3c101 -r e5bbcf6ebf6c lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py Thu May 20 17:00:12 2010 -0400 +++ b/lib/galaxy/tools/__init__.py Fri May 21 13:43:50 2010 -0400 @@ -563,6 +563,7 @@ attributes = {} attributes['compare'] = attrib.pop( 'compare', 'diff' ).lower() #method of comparison attributes['lines_diff'] = int( attrib.pop( 'lines_diff', '0' ) ) # allow a few lines (dates etc) to vary in logs + attributes['delta'] = int( attrib.pop( 'delta', '10000' ) ) # allow a file size to vary if sim_size compare attributes['sort'] = util.string_as_bool( attrib.pop( 'sort', False ) ) attributes['extra_files'] = [] for extra in output_elem.findall( 'extra_files' ): @@ -573,6 +574,7 @@ assert extra_value is not None, 'extra_files requires a value attribute' extra_attributes = {} extra_attributes['compare'] = extra.get( 'compare', 'diff' ).lower() #method of comparison + extra_attributes['delta'] = extra.get( 'delta', '0' ) # allow a file size to vary if sim_size compare extra_attributes['lines_diff'] = int( extra.get( 'lines_diff', '0' ) ) # allow a few lines (dates etc) to vary in logs extra_attributes['sort'] = util.string_as_bool( extra.get( 'sort', False ) ) attributes['extra_files'].append( ( extra_type, extra_value, extra_name, extra_attributes ) ) diff -r 3ad722e3c101 -r e5bbcf6ebf6c tools/rgenetics/rgEigPCA.xml --- a/tools/rgenetics/rgEigPCA.xml Thu May 20 17:00:12 2010 -0400 +++ b/tools/rgenetics/rgEigPCA.xml Fri May 21 13:43:50 2010 -0400 @@ -48,8 +48,7 @@ <param name="t" value="2" /> <param name="s" value="2" /> <output name='out_file1' file='rgtestouts/rgEigPCA/rgEigPCAtest1.html' ftype='html' compare='diff' lines_diff='195'> - <extra_files type="file" name='rgEigPCAtest1_PCAPlot.pdf' value="rgtestouts/rgEigPCA/rgEigPCAtest1_PCAPlot.pdf" compare="diff" - lines_diff="27"/> + <extra_files type="file" name='rgEigPCAtest1_PCAPlot.pdf' value="rgtestouts/rgEigPCA/rgEigPCAtest1_PCAPlot.pdf" compare="sim_size" delta="30000"/> </output> <output name='pca' file='rgtestouts/rgEigPCA/rgEigPCAtest1.txt' compare='diff'/> </test> diff -r 3ad722e3c101 -r e5bbcf6ebf6c tools/rgenetics/rgHaploView.xml --- a/tools/rgenetics/rgHaploView.xml Thu May 20 17:00:12 2010 -0400 +++ b/tools/rgenetics/rgHaploView.xml Fri May 21 13:43:50 2010 -0400 @@ -101,9 +101,9 @@ <param name='infoTrack' value='noinfo' /> <param name='hires' value='lo' /> <param name='memsize' value='2048' /> - <output name='out_file1' file='rgtestouts/rgHaploView/rgHaploViewtest1.html' ftype='html' lines_diff="16"> - <extra_files type="file" name='alljoin.pdf' value="rgtestouts/rgHaploView/alljoin.pdf" compare="diff" lines_diff="3625"/> - <extra_files type="file" name='allnup.pdf' value="rgtestouts/rgHaploView/allnup.pdf" compare="diff" lines_diff="3675" /> + <output name='out_file1' file='rgtestouts/rgHaploView/rgHaploViewtest1.html' ftype='html' lines_diff="18"> + <extra_files type="file" name='alljoin.pdf' value="rgtestouts/rgHaploView/alljoin.pdf" compare="sim_size" delta="3000"/> + <extra_files type="file" name='allnup.pdf' value="rgtestouts/rgHaploView/allnup.pdf" compare="sim_size" delta="3000" /> <extra_files type="file" name='Log_rgHaploViewtest1.txt' value="rgtestouts/rgHaploView/Log_rgHaploViewtest1.txt" compare="diff" lines_diff="20"/> <extra_files type="file" name='rgHaploViewtest1.ped.TESTS' value="rgtestouts/rgHaploView/rgHaploViewtest1.ped.TESTS" compare="diff" lines_diff="20"/> diff -r 3ad722e3c101 -r e5bbcf6ebf6c tools/rgenetics/rgtest_one_tool.sh --- a/tools/rgenetics/rgtest_one_tool.sh Thu May 20 17:00:12 2010 -0400 +++ b/tools/rgenetics/rgtest_one_tool.sh Fri May 21 13:43:50 2010 -0400 @@ -6,7 +6,8 @@ *) esac GALAXYROOT=`pwd` -PATHTOGALAXY='/opt/galaxy' # whatever +#PATHTOGALAXY='/opt/galaxy' # whatever +PATHTOGALAXY='/share/shared/galaxy' # whatever echo "using $GALAXYROOT" # change this as needed for your local install INPATH="${GALAXYROOT}/test-data" @@ -56,7 +57,9 @@ echo "now doing $TOOL" OUTPATH="$OROOT/$TOOL" rm -rf $OUTPATH/* -python $TOOLPATH/$TOOL.py -i "$INPATH/tinywga" -o $NPRE -s ${OUTPATH}/${NPRE}.html -p $OUTPATH +CMD="python $TOOLPATH/$TOOL.py -i $INPATH/tinywga -o $NPRE -s ${OUTPATH}/${NPRE}.html -p $OUTPATH" +echo "doing $CMD" +$CMD # rgQC.py -i '$input_file.extra_files_path/$input_file.metadata.base_name' -o "$out_prefix" # -s '$html_file' -p '$html_file.files_path' #
participants (1)
-
Nate Coraor