commit/galaxy-central: 2 new changesets
2 new changesets in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/48bbe32beefe/ changeset: 48bbe32beefe user: galaxy galaxy date: 2011-07-05 04:40:43 summary: branch merge affected #: 250 files (5.2 KB) --- a/lib/galaxy/security/__init__.py Mon Jul 04 11:06:04 2011 -0400 +++ b/lib/galaxy/security/__init__.py Tue Jul 05 12:40:43 2011 +1000 @@ -1005,7 +1005,8 @@ ucsc_main = ( 'hgw1.cse.ucsc.edu', 'hgw2.cse.ucsc.edu', 'hgw3.cse.ucsc.edu', 'hgw4.cse.ucsc.edu', 'hgw5.cse.ucsc.edu', 'hgw6.cse.ucsc.edu', 'hgw7.cse.ucsc.edu', 'hgw8.cse.ucsc.edu' ), ucsc_test = ( 'hgwdev.cse.ucsc.edu', ), - ucsc_archaea = ( 'lowepub.cse.ucsc.edu', ) + ucsc_archaea = ( 'lowepub.cse.ucsc.edu', ), + ucsc_bhri = ('ucsc.omics.bhri.internal','galaxy.omics.bhri.internal'), ) def __init__( self, model, permitted_actions=None ): self.model = model @@ -1036,7 +1037,7 @@ # We're going to search in order, but if the remote site is load # balancing their connections (as UCSC does), this is okay. try: - if socket.gethostbyname( server ) == addr: + if socket.gethostbyname( server ) == addr or server == '127.0.0.1' or server == '172.16.0.38': break # remote host is in the server list except ( socket.error, socket.gaierror ): pass # can't resolve, try next --- a/lib/galaxy/tools/__init__.py Mon Jul 04 11:06:04 2011 -0400 +++ b/lib/galaxy/tools/__init__.py Tue Jul 05 12:40:43 2011 +1000 @@ -922,6 +922,8 @@ if not self.check_values: return for input in self.inputs.itervalues(): + if input.name not in value: + value[input.name] = input.get_initial_value( None, value ) if isinstance( input, ToolParameter ): callback( "", input, value[input.name] ) else: --- a/lib/galaxy/tools/parameters/basic.py Mon Jul 04 11:06:04 2011 -0400 +++ b/lib/galaxy/tools/parameters/basic.py Tue Jul 05 12:40:43 2011 +1000 @@ -748,9 +748,6 @@ # Dependency on a value that does not yet exist if isinstance( dep_value, RuntimeValue ): return True - #dataset not ready yet - if hasattr( self, 'ref_input' ) and isinstance( dep_value, self.tool.app.model.HistoryDatasetAssociation ) and ( dep_value.is_pending or not isinstance( dep_value.datatype, self.ref_input.formats ) ): - return True # Dynamic, but all dependenceis are known and have values return False def get_initial_value( self, trans, context ): @@ -881,7 +878,6 @@ self.force_select = string_as_bool( elem.get( "force_select", True )) self.accept_default = string_as_bool( elem.get( "accept_default", False )) self.data_ref = elem.get( "data_ref", None ) - self.ref_input = None self.default_value = elem.get( "default_value", None ) self.is_dynamic = True def from_html( self, value, trans=None, context={} ): @@ -977,7 +973,7 @@ if not dataset.metadata.columns: # Only allow late validation if the dataset is not yet ready # (since we have reason to expect the metadata to be ready eventually) - if dataset.is_pending or not isinstance( dataset.datatype, self.ref_input.formats ): + if dataset.is_pending: return True # No late validation return False @@ -1357,7 +1353,7 @@ selected = ( value and ( hda in value ) ) field.add_option( "%s: %s" % ( hid, hda_name ), hda.id, selected ) else: - target_ext, converted_dataset = hda.find_conversion_destination( self.formats ) + target_ext, converted_dataset = hda.find_conversion_destination( self.formats, converter_safe = self.converter_safe( other_values, trans ) ) if target_ext: if converted_dataset: hda = converted_dataset @@ -1406,22 +1402,13 @@ pass #no valid options def dataset_collector( datasets ): def is_convertable( dataset ): - target_ext, converted_dataset = dataset.find_conversion_destination( self.formats ) + target_ext, converted_dataset = dataset.find_conversion_destination( self.formats, converter_safe = self.converter_safe( context, trans ) ) if target_ext is not None: return True return False for i, data in enumerate( datasets ): - if data.visible and not data.deleted and data.state not in [data.states.ERROR, data.states.DISCARDED]: - is_valid = False - if isinstance( data.datatype, self.formats ): - is_valid = True - else: - target_ext, converted_dataset = data.find_conversion_destination( self.formats ) - if target_ext: - is_valid = True - if converted_dataset: - data = converted_dataset - if not is_valid or ( self.options and self._options_filter_attribute( data ) != filter_value ): + if data.visible and not data.deleted and data.state not in [data.states.ERROR, data.states.DISCARDED] and ( isinstance( data.datatype, self.formats) or is_convertable( data ) ): + if self.options and self._options_filter_attribute( data ) != filter_value: continue most_recent_dataset[0] = data # Also collect children via association object --- a/lib/galaxy/web/framework/middleware/remoteuser.py Mon Jul 04 11:06:04 2011 -0400 +++ b/lib/galaxy/web/framework/middleware/remoteuser.py Tue Jul 05 12:40:43 2011 +1000 @@ -36,6 +36,7 @@ """ UCSC_MAIN_SERVERS = ( + 'omics.bhri.internal', 'hgw1.cse.ucsc.edu', 'hgw2.cse.ucsc.edu', 'hgw3.cse.ucsc.edu', @@ -49,6 +50,7 @@ 'lowepub.cse.ucsc.edu', ) + class RemoteUser( object ): def __init__( self, app, maildomain=None, ucsc_display_sites=[], admin_users=[] ): self.app = app @@ -56,7 +58,7 @@ self.allow_ucsc_main = False self.allow_ucsc_archaea = False self.admin_users = admin_users - if 'main' in ucsc_display_sites or 'test' in ucsc_display_sites: + if 'main' in ucsc_display_sites or 'test' in ucsc_display_sites or 'bhri' in ucsc_display_sites: self.allow_ucsc_main = True if 'archaea' in ucsc_display_sites: self.allow_ucsc_archaea = True --- a/scripts/cleanup_datasets/purge_libraries.sh Mon Jul 04 11:06:04 2011 -0400 +++ b/scripts/cleanup_datasets/purge_libraries.sh Tue Jul 05 12:40:43 2011 +1000 @@ -1,4 +1,5 @@ #!/bin/sh cd `dirname $0`/../.. -python ./scripts/cleanup_datasets/cleanup_datasets.py ./universe_wsgi.ini -d 10 -4 -r $@ >> ./scripts/cleanup_datasets/purge_libraries.log +#python ./scripts/cleanup_datasets/cleanup_datasets.py ./universe_wsgi.ini -d 10 -4 -r $@ >> ./scripts/cleanup_datasets/purge_libraries.log +python ./scripts/cleanup_datasets/cleanup_datasets.py ./universe_wsgi.ini -d 2 -4 -r $@ >> ./scripts/cleanup_datasets/purge_libraries.log --- a/tool-data/shared/ucsc/ucsc_build_sites.txt Mon Jul 04 11:06:04 2011 -0400 +++ b/tool-data/shared/ucsc/ucsc_build_sites.txt Tue Jul 05 12:40:43 2011 +1000 @@ -1,5 +1,6 @@ #Harvested from http://genome.ucsc.edu/cgi-bin/das/dsn main http://genome.ucsc.edu/cgi-bin/hgTracks? priPac1,danRer4,mm9,mm8,droAna1,mm5,caeRem2,mm7,mm6,panTro1,dm3,panTro2,anoCar1,ce4,galGal3,galGal2,ce1,rn3,rn2,droMoj1,droMoj2,rn4,droYak1,droYak2,dp3,dp2,dm1,canFam1,danRer5,canFam2,danRer3,danRer2,ornAna1,ci2,ci1,tetNig1,bosTau1,bosTau3,bosTau2,equCab1,oryLat1,droAna2,droEre1,ponAbe2,rheMac2,sacCer1,droPer1,droSim1,monDom1,cb1,dm2,droSec1,strPur1,droVir2,droVir1,strPur2,sc1,xenTro1,droGri1,xenTro2,cb3,gasAcu1,caePb1,anoGam1,fr2,fr1,hg15,hg16,hg17,hg18,felCat3,apiMel2,monDom4,apiMel1,ce2 +bhri http://ucsc.omics.bhri.internal/cgi-bin/hgTracks? hg18,hg19,mm8,mm9,rn4 #Harvested from http://archaea.ucsc.edu/cgi-bin/das/dsn archaea http://archaea.ucsc.edu/cgi-bin/hgTracks? alkaEhrl_MLHE_1,shewW318,idioLoih_L2TR,sulSol1,erwiCaro_ATROSEPTICA,symbTher_IAM14863,moorTher_ATCC39073,therFusc_YX,methHung1,bradJapo,therElon,shewPutrCN32,pediPent_ATCC25745,mariMari_MCS10,nanEqu1,baciSubt,chlaTrac,magnMagn_AMB_1,chroViol,ralsSola,acidCryp_JF_5,erytLito_HTCC2594,desuVulg_HILDENBOROUG,pyrAer1,sulfToko1,shewANA3,paraSp_UWE25,geobKaus_HTA426,rhizEtli_CFN_42,uncuMeth_RCI,candBloc_FLORIDANUS,deinRadi,yersPest_CO92,saccEryt_NRRL_2338,rhodRHA1,candCars_RUDDII,burkMall_ATCC23344,eschColi_O157H7,burk383,psycIngr_37,rhodSpha_2_4_1,wolbEndo_OF_DROSOPHIL,burkViet_G4,propAcne_KPA171202,enteFaec_V583,campJeju_81_176,acidJS42,heliPylo_26695,pseuHalo_TAC125,chroSale_DSM3043,methVann1,archFulg1,neisMeni_Z2491_1,fusoNucl,vermEise_EF01_2,anabVari_ATCC29413,tropWhip_TW08_27,heliHepa,acinSp_ADP1,anapMarg_ST_MARIES,natrPhar1,haheChej_KCTC_2396,therPetr_RKU_1,neisGono_FA1090_1,colwPsyc_34H,desuPsyc_LSV54,hyphNept_ATCC15444,vibrChol1,deinGeot_DSM11300,strePyog_M1_GAS,franCcI3,salmTyph,metaSedu,lactSali_UCC118,trepPall,neisMeni_MC58_1,syntWolf_GOETTINGEN,flavJohn_UW101,methBoon1,haemSomn_129PT,shewLoihPV4,igniHosp1,haemInfl_KW20,haloHalo_SL1,ferrAcid1,sphiAlas_RB2256,candPela_UBIQUE_HTCC1,caldSacc_DSM8903,aerPer1,lactPlan,carbHydr_Z_2901,therTher_HB8,vibrVuln_YJ016_1,rhodPalu_CGA009,acidCell_11B,siliPome_DSS_3,therVolc1,haloWals1,rubrXyla_DSM9941,shewAmaz,nocaJS61,vibrVuln_CMCP6_1,sinoMeli,ureaUrea,baciHalo,bartHens_HOUSTON_1,nitrWino_NB_255,hypeButy1,methBurt2,polaJS66,mesoLoti,methMari_C7,caulCres,neisMeni_FAM18_1,acidBact_ELLIN345,caldMaqu1,salmEnte_PARATYPI_ATC,glucOxyd_621H,cytoHutc_ATCC33406,nitrEuro,therMari,coxiBurn,woliSucc,heliPylo_HPAG1,mesoFlor_L1,pyrHor1,methAeol1,procMari_CCMP1375,pyroArse1,oenoOeni_PSU_1,alcaBork_SK2,wiggBrev,actiPleu_L20,lactLact,methJann1,paraDeni_PD1222,borrBurg,pyroIsla1,orieTsut_BORYONG,shewMR4,methKand1,methCaps_BATH,onioYell_PHYTOPLASMA,bordBron,cenaSymb1,burkCeno_HI2424,franTula_TULARENSIS,pyrFur2,mariAqua_VT8,heliPylo_J99,psycArct_273_4,vibrChol_MO10_1,vibrPara1,rickBell_RML369_C,metAce1,buchSp,ehrlRumi_WELGEVONDEN,methLabrZ_1,chlaPneu_CWL029,thioCrun_XCL_2,pyroCali1,chloTepi_TLS,stapAure_MU50,novoArom_DSM12444,magnMC1,zymoMobi_ZM4,salmTyph_TY2,chloChlo_CAD3,azoaSp_EBN1,therTher_HB27,bifiLong,picrTorr1,listInno,bdelBact,gramFors_KT0803,sulfAcid1,geobTher_NG80_2,peloCarb,ralsEutr_JMP134,mannSucc_MBEL55E,syneSp_WH8102,methTherPT1,clavMich_NCPPB_382,therAcid1,syntAcid_SB,porpGing_W83,therNeut0,leifXyli_XYLI_CTCB0,shewFrig,photProf_SS9,thioDeni_ATCC25259,methMaze1,desuRedu_MI_1,burkThai_E264,campFetu_82_40,blocFlor,jannCCS1,nitrMult_ATCC25196,streCoel,soliUsit_ELLIN6076,pastMult,saliRube_DSM13855,methTher1,nostSp,shigFlex_2A,saccDegr_2_40,oceaIhey,dehaEthe_195,rhodRubr_ATCC11170,arthFB24,shewMR7,pireSp,anaeDeha_2CP_C,haloVolc1,dichNodo_VCS1703A,tricEryt_IMS101,mycoGeni,thioDeni_ATCC33889,methSmit1,geobUran_RF4,shewDeni,halMar1,desuHafn_Y51,methStad1,granBeth_CGDNIH1,therPend1,legiPneu_PHILADELPHIA,vibrChol_O395_1,nitrOcea_ATCC19707,campJeju_RM1221,methPetr_PM1,heliAcin_SHEEBA,eschColi_APEC_O1,peloTher_SI,haloHalo1,syntFuma_MPOB,xyleFast,gloeViol,leucMese_ATCC8293,bactThet_VPI_5482,xantCamp,sodaGlos_MORSITANS,geobSulf,roseDeni_OCH_114,coryEffi_YS_314,brucMeli,mycoTube_H37RV,vibrFisc_ES114_1,pyrAby1,burkXeno_LB400,polyQLWP,stapMari1,peloLute_DSM273,burkCeno_AU_1054,shewBalt,nocaFarc_IFM10152,ente638,mculMari1,saliTrop_CNB_440,neorSenn_MIYAYAMA,aquiAeol,dechArom_RCB,myxoXant_DK_1622,burkPseu_1106A,burkCepa_AMMD,methMari_C5_1,azorCaul2,methFlag_KT,leptInte,eschColi_K12,synePCC6,baumCica_HOMALODISCA,methBark1,pseuAeru,geobMeta_GS15,eschColi_CFT073,photLumi,metMar1,hermArse,campJeju,therKoda1,aeroHydr_ATCC7966,baciAnth_AMES,shewOnei,therTeng,lawsIntr_PHE_MN1_00 #Harvested from http://genome-test.cse.ucsc.edu/cgi-bin/das/dsn --- a/tool_conf.xml.sample Mon Jul 04 11:06:04 2011 -0400 +++ b/tool_conf.xml.sample Tue Jul 05 12:40:43 2011 +1000 @@ -368,6 +368,7 @@ </section><section name="NGS: Simulation" id="ngs-simulation"><tool file="ngs_simulation/ngs_simulation.xml" /> + <tool file="rgenetics/EpiD.xml" /></section><section name="SNP/WGA: Data; Filters" id="rgdat"><label text="Data: Import and upload" id="rgimport" /> --- a/tools/data_source/ucsc_tablebrowser.xml Mon Jul 04 11:06:04 2011 -0400 +++ b/tools/data_source/ucsc_tablebrowser.xml Tue Jul 05 12:40:43 2011 +1000 @@ -5,27 +5,27 @@ initial response ( in addition to 'URL' ) will be encoded and appended to URL and a post will be performed. --><tool name="UCSC Main" id="ucsc_table_direct1" tool_type="data_source"> - <description>table browser</description> - <command interpreter="python">data_source.py $output $__app__.config.output_size_limit</command> - <inputs action="http://genome.ucsc.edu/cgi-bin/hgTables" check_values="false" method="get"> - <display>go to UCSC Table Browser $GALAXY_URL</display> - <param name="GALAXY_URL" type="baseurl" value="/tool_runner" /> - <param name="tool_id" type="hidden" value="ucsc_table_direct1" /> - <param name="sendToGalaxy" type="hidden" value="1" /> - <param name="hgta_compressType" type="hidden" value="none" /> - <param name="hgta_outputType" type="hidden" value="bed" /> - </inputs> - <request_param_translation> + <description>table browser</description> + <command interpreter="python">data_source.py $output $__app__.config.output_size_limit</command> + <inputs action="http://ucsc.omics.bhri.internal/cgi-bin/hgTables" check_values="false" method="get"> + <display>go to UCSC Table Browser $GALAXY_URL</display> + <param name="GALAXY_URL" type="baseurl" value="/tool_runner" /> + <param name="tool_id" type="hidden" value="ucsc_table_direct1" /> + <param name="sendToGalaxy" type="hidden" value="1" /> + <param name="hgta_compressType" type="hidden" value="none" /> + <param name="hgta_outputType" type="hidden" value="bed" /> + </inputs> + <request_param_translation><request_param galaxy_name="URL_method" remote_name="URL_method" missing="post" /><request_param galaxy_name="URL" remote_name="URL" missing="" /><request_param galaxy_name="dbkey" remote_name="db" missing="?" /><request_param galaxy_name="organism" remote_name="org" missing="unknown species" /> - <request_param galaxy_name="table" remote_name="hgta_table" missing="unknown table" /> - <request_param galaxy_name="description" remote_name="hgta_regionType" missing="no description" /> - <request_param galaxy_name="data_type" remote_name="hgta_outputType" missing="auto" > + <request_param galaxy_name="table" remote_name="hgta_table" missing="unknown table" /> + <request_param galaxy_name="description" remote_name="hgta_regionType" missing="no description" /> + <request_param galaxy_name="data_type" remote_name="hgta_outputType" missing="tabular" ><value_translation> - <value galaxy_value="auto" remote_value="primaryTable" /> - <value galaxy_value="auto" remote_value="selectedFields" /> + <value galaxy_value="tabular" remote_value="primaryTable" /> + <value galaxy_value="tabular" remote_value="selectedFields" /><value galaxy_value="wig" remote_value="wigData" /><value galaxy_value="interval" remote_value="tab" /><value galaxy_value="html" remote_value="hyperlinks" /> @@ -33,10 +33,10 @@ <value galaxy_value="gtf" remote_value="gff" /></value_translation></request_param> - </request_param_translation> - <uihints minwidth="800"/> - <outputs> - <data name="output" format="tabular" label="${tool.name} on ${organism}: ${table} (#if $description == 'range' then $getVar( 'position', 'unknown position' ) else $description#)"/> - </outputs> - <options sanitize="False" refresh="True"/> + </request_param_translation> + <uihints minwidth="800"/> + <outputs> + <data name="output" format="tabular" /> + </outputs> + <options sanitize="False" refresh="True"/></tool> --- a/tools/meme/meme.xml Mon Jul 04 11:06:04 2011 -0400 +++ b/tools/meme/meme.xml Tue Jul 05 12:40:43 2011 +1000 @@ -304,7 +304,7 @@ </when></conditional> - <param name="non_commercial_use" label="I certify that I am not using this tool for commercial purposes." type="boolean" truevalue="NON_COMMERCIAL_USE" falsevalue="COMMERCIAL_USE" checked="False"> + <param name="non_commercial_use" label="I certify that I am not using this tool for commercial purposes." type="boolean" truevalue="NON_COMMERCIAL_USE" falsevalue="COMMERCIAL_USE" checked="True"><validator type="expression" message="This tool is only available for non-commercial use.">value == True</validator></param> --- a/tools/peak_calling/macs_wrapper.py Mon Jul 04 11:06:04 2011 -0400 +++ b/tools/peak_calling/macs_wrapper.py Tue Jul 05 12:40:43 2011 +1000 @@ -51,7 +51,8 @@ cmdline = "macs -t %s" % ",".join( options['input_chipseq'] ) if options['input_control']: cmdline = "%s -c %s" % ( cmdline, ",".join( options['input_control'] ) ) - cmdline = "%s --format='%s' --name='%s' --gsize='%s' --tsize='%s' --bw='%s' --pvalue='%s' --mfold='%s' %s --lambdaset='%s' %s" % ( cmdline, options['format'], experiment_name, options['gsize'], options['tsize'], options['bw'], options['pvalue'], options['mfold'], options['nolambda'], options['lambdaset'], options['futurefdr'] ) + cmdline = "%s --format='%s' --name='%s' --gsize='%s' --tsize='%s' --bw='%s' --pvalue='%s' --mfold='%s' %s %s" %\ + ( cmdline, options['format'], experiment_name, options['gsize'], options['tsize'], options['bw'], options['pvalue'], options['mfold'], options['nolambda'], options['futurefdr'] ) if 'wig' in options: wigextend = int( options['wig']['wigextend'] ) if wigextend >= 0: --- a/tools/peak_calling/macs_wrapper.xml Mon Jul 04 11:06:04 2011 -0400 +++ b/tools/peak_calling/macs_wrapper.xml Tue Jul 05 12:40:43 2011 +1000 @@ -28,7 +28,8 @@ <param name="tsize" type="integer" label="Tag size" value="25"/><param name="bw" type="integer" label="Band width" value="300"/><param name="pvalue" type="float" label="Pvalue cutoff for peak detection" value="1e-5" help="default: 1e-5"/> - <param name="mfold" type="integer" label="Select the regions with MFOLD high-confidence enrichment ratio against background to build model" value="32"/> + <param name="mfold" type="text" label="Select the regions with MFOLD high-confidence enrichment ratio against background to build model" value="10,30" + help="Range for high-confidence enrichment ratio against background for model are within this range. DEFAULT:10,30" /><param name="xls_to_interval" label="Parse xls files into into distinct interval files" type="boolean" truevalue="create" falsevalue="do_not_create" checked="False"/><conditional name="wig_type"><param name="wig_type_selector" type="select" label="Save shifted raw tag count at every bp into a wiggle file"> @@ -44,7 +45,6 @@ </when></conditional><param name="nolambda" label="Use fixed background lambda as local lambda for every peak region" type="boolean" truevalue="--nolambda" falsevalue="" checked="False" help="up to 9X more time consuming"/> - <param name="lambdaset" type="text" label="3 levels of regions around the peak region to calculate the maximum lambda as local lambda" value="1000,5000,10000" size="50"/><conditional name="nomodel_type"><param name="nomodel_type_selector" type="select" label="Build Model"><option value="nomodel">Do not build the shifting model</option> @@ -95,7 +95,7 @@ <configfile name="options_file"><% import simplejson %> -#set $__options = { 'experiment_name':str( $experiment_name ), 'gsize':int( float( str( $gsize ) ) ), 'tsize':str( $tsize ), 'bw':str( $bw ), 'pvalue':str( $pvalue ), 'mfold':str( $mfold ), 'nolambda':str( $nolambda ), 'lambdaset': str( $lambdaset ), 'futurefdr':str( $futurefdr ) } +#set $__options = { 'experiment_name':str( $experiment_name ), 'gsize':int( float( str( $gsize ) ) ), 'tsize':str( $tsize ), 'bw':str( $bw ), 'pvalue':str( $pvalue ), 'mfold':str( $mfold ), 'nolambda':str( $nolambda ), 'futurefdr':str( $futurefdr ) } #if str( $xls_to_interval ) == 'create': #set $__options['xls_to_interval'] = { 'peaks_file': str( $output_xls_to_interval_peaks_file ), 'negative_peaks_file': str( $output_xls_to_interval_negative_peaks_file ) } #else: @@ -145,14 +145,13 @@ <param name="input_control_file1" value="chipseq_input.bed.gz" ftype="bed" /><param name="experiment_name" value="Galaxy Test Run" /><param name="tsize" value="36" /> - <param name="mfold" value="13" /> + <param name="mfold" value="10,30" /><param name="gsize" value="2.7e+9" /><param name="bw" value="300" /><param name="pvalue" value="1e-5" /><param name="xls_to_interval" /><param name="wig_type_selector" value="no_wig" /><param name="nolambda"/> - <param name="lambdaset" value="1000,5000,10000"/><param name="nomodel_type_selector" value="create_model" /><param name="diag_type_selector" value="no_diag" /><param name="futurefdr"/> @@ -171,14 +170,13 @@ <param name="input_control_file1" value="chipseq_input.bed.gz" ftype="bed" /><param name="experiment_name" value="Galaxy Test Run" /><param name="tsize" value="36" /> - <param name="mfold" value="13" /> + <param name="mfold" value="10,30" /><param name="gsize" value="2.7e+9" /><param name="bw" value="300" /><param name="pvalue" value="1e-5" /><param name="xls_to_interval" value="true" /><param name="wig_type_selector" value="no_wig" /><param name="nolambda"/> - <param name="lambdaset" value="1000,5000,10000"/><param name="nomodel_type_selector" value="create_model" /><param name="diag_type_selector" value="no_diag" /><param name="futurefdr"/> @@ -195,7 +193,7 @@ <param name="input_control_file1" value="chipseq_input.bed.gz" ftype="bed" /><param name="experiment_name" value="Galaxy Test Run" /><param name="tsize" value="36" /> - <param name="mfold" value="13" /> + <param name="mfold" value="10,30" /><param name="gsize" value="2.7e+9" /><param name="bw" value="300" /><param name="pvalue" value="1e-5" /> @@ -204,7 +202,6 @@ <param name="wigextend" value="-1" /><param name="space" value="10" /><param name="nolambda"/> - <param name="lambdaset" value="1000,5000,10000"/><param name="nomodel_type_selector" value="create_model" /><param name="diag_type_selector" value="no_diag" /><param name="futurefdr"/> --- a/tools/plotting/histogram.py Mon Jul 04 11:06:04 2011 -0400 +++ b/tools/plotting/histogram.py Tue Jul 05 12:40:43 2011 +1000 @@ -73,7 +73,8 @@ if skipped_lines < i: try: - a = r.array( matrix ) + #a = array( matrix ) + a=matrix r.pdf( out_fname, 8, 8 ) histogram = r.hist( a, probability=not frequency, main=title, xlab=xlab, breaks=breaks ) if density: --- a/tools/plotting/scatterplot.py Mon Jul 04 11:06:04 2011 -0400 +++ b/tools/plotting/scatterplot.py Tue Jul 05 12:40:43 2011 +1000 @@ -19,8 +19,14 @@ title = sys.argv[5] xlab = sys.argv[6] ylab = sys.argv[7] + out_type = sys.argv[8] + out_width = int(sys.argv[9]) + out_height = int(sys.argv[10]) + point_size = float(sys.argv[11]) - matrix = [] + + xvec=[] + yvec=[] skipped_lines = 0 first_invalid_line = 0 invalid_value = '' @@ -28,17 +34,19 @@ i = 0 for i, line in enumerate( file( in_fname ) ): valid = True + vals = [] line = line.rstrip( '\r\n' ) if line and not line.startswith( '#' ): row = [] fields = line.split( "\t" ) - for column in columns: + for c,column in enumerate(columns): try: val = fields[column] if val.lower() == "na": - row.append( float( "nan" ) ) + v = float( "nan" ) else: - row.append( float( fields[column] ) ) + v = float( fields[column] ) + vals.append(val) except: valid = False skipped_lines += 1 @@ -57,12 +65,19 @@ first_invalid_line = i+1 if valid: - matrix.append( row ) - + xvec.append(vals[0]) + yvec.append(vals[1]) if skipped_lines < i: try: - r.pdf( out_fname, 8, 8 ) - r.plot( array( matrix ), type="p", main=title, xlab=xlab, ylab=ylab, col="blue", pch=19 ) + if out_type == "jpg": + r.jpeg(out_fname,width=out_width,height=out_height) + elif out_type == "png": + # type="cairo" needed to be set for headless servers + r.png(out_fname,type="cairo",width=out_width,height=out_height) + else: + r.pdf(out_fname, out_width, out_height) + + r.plot(xvec,yvec, type="p", main=title, xlab=xlab, ylab=ylab, col="blue", pch=19,cex=point_size ) r.dev_off() except Exception, exc: stop_err( "%s" %str( exc ) ) --- a/tools/plotting/scatterplot.xml Mon Jul 04 11:06:04 2011 -0400 +++ b/tools/plotting/scatterplot.xml Tue Jul 05 12:40:43 2011 +1000 @@ -1,6 +1,6 @@ <tool id="scatterplot_rpy" name="Scatterplot"><description>of two numeric columns</description> - <command interpreter="python">scatterplot.py $input $out_file1 $col1 $col2 "$title" "$xlab" "$ylab"</command> + <command interpreter="python">scatterplot.py $input $out_file1 $col1 $col2 "$title" "$xlab" "$ylab" $output_format $out_width $out_height $point_size</command><inputs><param name="input" type="data" format="tabular" label="Dataset" help="Dataset missing? See TIP below"/><param name="col1" type="data_column" data_ref="input" numerical="True" label="Numerical column for x axis" /> @@ -8,15 +8,26 @@ <param name="title" size="30" type="text" value="Scatterplot" label="Plot title"/><param name="xlab" size="30" type="text" value="V1" label="Label for x axis"/><param name="ylab" size="30" type="text" value="V2" label="Label for y axis"/> + <param name="output_format" type="select" label="Output format"> + <option value="pdf">pdf</option> + <option value="png">png</option> + <option value="jpg">jpg</option> + </param> + <param name="out_width" size="4" type="integer" value="8" label="Width (pdf=inches, image=pixels)"/> + <param name="out_height" size="4" type="integer" value="8" label="Height (pdf=inches, image=pixels)"/> + <param name="point_size" size="4" type="float" value="0.2" label="Point Size"/></inputs><outputs> - <data format="pdf" name="out_file1" /> + <data format="pdf" name="out_file1"> + <change_format> + <when input="output_format" value="png" format="png" /> + <when input="output_format" value="jpg" format="jpg" /> + </change_format> + </data></outputs><requirements><requirement type="python-module">rpy</requirement></requirements> - <!-- TODO: uncomment the following test when we have tools.update_state() working for - multiple dependents with the same dependency. <tests><test><param name="input" value="scatterplot_in1.tabular" ftype="tabular"/> @@ -25,8 +36,38 @@ <param name="title" value="Scatterplot"/><param name="xlab" value="V1"/><param name="ylab" value="V2"/> + <param name="out_width" value="8"/> + <param name="out_height" value="8"/> + <param name="point_size" value="0.5"/> + <param name="output_format" value="pdf" /><output name="out_file1" file="scatterplot_out1.pdf" /></test> + <test> + <param name="input" value="scatterplot_in1.tabular" ftype="tabular"/> + <param name="col1" value="2"/> + <param name="col2" value="3"/> + <param name="title" value="Scatterplot"/> + <param name="xlab" value="V1"/> + <param name="ylab" value="V2"/> + <param name="out_width" value="800"/> + <param name="out_height" value="600"/> + <param name="point_size" value="0.5"/> + <param name="output_format" value="png" /> + <output name="out_file1" file="scatterplot_out1.png" /> + </test> + <test> + <param name="input" value="scatterplot_in1.tabular" ftype="tabular"/> + <param name="col1" value="2"/> + <param name="col2" value="3"/> + <param name="title" value="Scatterplot"/> + <param name="xlab" value="V1"/> + <param name="ylab" value="V2"/> + <param name="out_width" value="800"/> + <param name="out_height" value="600"/> + <param name="point_size" value="0.5"/> + <param name="output_format" value="jpg" /> + <output name="out_file1" file="scatterplot_out1.jpg" /> + </test></tests> --><help> --- a/tools/samtools/bam_to_sam.py Mon Jul 04 11:06:04 2011 -0400 +++ b/tools/samtools/bam_to_sam.py Tue Jul 05 12:40:43 2011 +1000 @@ -21,7 +21,6 @@ parser = optparse.OptionParser() parser.add_option( '', '--input1', dest='input1', help='The input SAM dataset' ) parser.add_option( '', '--output1', dest='output1', help='The output BAM dataset' ) - parser.add_option( '', '--header', dest='header', action='store_true', default=False, help='Write SAM Header' ) ( options, args ) = parser.parse_args() # output version # of tool @@ -88,11 +87,7 @@ try: # Extract all alignments from the input BAM file to SAM format ( since no region is specified, all the alignments will be extracted ). - if options.header: - view_options = "-h" - else: - view_options = "" - command = 'samtools view %s -o %s %s' % ( view_options, options.output1, tmp_sorted_aligns_file_name ) + command = 'samtools view -o -h %s %s' % ( options.output1, tmp_sorted_aligns_file_name ) tmp = tempfile.NamedTemporaryFile( dir=tmp_dir ).name tmp_stderr = open( tmp, 'wb' ) proc = subprocess.Popen( args=command, shell=True, cwd=tmp_dir, stderr=tmp_stderr.fileno() ) --- a/tools/samtools/sam_bitwise_flag_filter.py Mon Jul 04 11:06:04 2011 -0400 +++ b/tools/samtools/sam_bitwise_flag_filter.py Tue Jul 05 12:40:43 2011 +1000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Refactored on 11/13/2010 by Kanwei Li - +# Added drop_header option - default is now keep headers for downstream sanity by ross lazarus import sys import optparse @@ -14,7 +14,11 @@ options (listed below) default to 'None' if omitted """ parser = optparse.OptionParser(usage=usage) - + parser.add_option('--drop_header', + action = 'store_true', + dest='drop_header', + help="Remove sam header - you probably NEVER want this for fussy downstream tools") + parser.add_option( '--0x0001','--is_paired', choices = ( '0','1' ), @@ -129,21 +133,24 @@ opt_map = { '0': False, '1': True } used_indices = [(index, opt_map[opt]) for index, opt in enumerate(opt_ary) if opt is not None] flag_col = int( options.flag_col ) - 1 - for line in infile: line = line.rstrip( '\r\n' ) - if line and not line.startswith( '#' ) and not line.startswith( '@' ) : - fields = line.split( '\t' ) - flags = int( fields[flag_col] ) + if line: + if line.startswith('@'): + if not options.drop_header: + print line # usually want these so add -h if you don't want headers + elif not line.startswith( '#' ) : + fields = line.split( '\t' ) + flags = int( fields[flag_col] ) - valid_line = True - for index, opt_bool in used_indices: - if bool(flags & 0x0001 << index) != opt_bool: - valid_line = False - break + valid_line = True + for index, opt_bool in used_indices: + if bool(flags & 0x0001 << index) != opt_bool: + valid_line = False + break - if valid_line: - print line + if valid_line: + print line if __name__ == "__main__": main() --- a/tools/samtools/sam_bitwise_flag_filter.xml Mon Jul 04 11:06:04 2011 -0400 +++ b/tools/samtools/sam_bitwise_flag_filter.xml Tue Jul 05 12:40:43 2011 +1000 @@ -1,8 +1,11 @@ -<tool id="sam_bw_filter" name="Filter SAM" version="1.0.0"> +<tool id="sam_bw_filter" name="Filter SAM" version="1.0.1"><description>on bitwise flag values</description><parallelism method="basic"></parallelism><command interpreter="python"> sam_bitwise_flag_filter.py + #if $drop_header == "1": + --drop_header + #end if --input_sam_file=$input1 --flag_column=2 #for $bit in $bits @@ -12,6 +15,11 @@ </command><inputs><param format="sam" name="input1" type="data" label="Select dataset to filter"/> + <param name="drop_header" type="select" display="radio" label="DROP sam headers" + help="Set this if you REALLY want to throw away existing sam header metadata - downstream (eg Picard) tools often demand it" > + <option value="0" selected="true">Keep headers (default)</option> + <option value="1">Drop headers</option> + </param><repeat name="bits" title="Flag"><param name="flags" type="select" label="Type"><option value="--0x0001">Read is paired</option> --- a/tools/samtools/sam_to_bam.py Mon Jul 04 11:06:04 2011 -0400 +++ b/tools/samtools/sam_to_bam.py Tue Jul 05 12:40:43 2011 +1000 @@ -68,7 +68,7 @@ # and the equCab2.fa file will contain fasta sequences. seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file ) tmp_dir = tempfile.mkdtemp() - if not options.ref_file or options.ref_file == 'None': + if options.ref_file == 'None': # We're using locally cached reference sequences( e.g., /galaxy/data/equCab2/sam_index/equCab2.fa ). # The indexes for /galaxy/data/equCab2/sam_index/equCab2.fa will be contained in # a file named /galaxy/data/equCab2/sam_index/equCab2.fa.fai @@ -125,7 +125,9 @@ tmp_aligns_file = tempfile.NamedTemporaryFile( dir=tmp_dir ) tmp_aligns_file_name = tmp_aligns_file.name tmp_aligns_file.close() - command = 'samtools view -bt %s -o %s %s' % ( fai_index_file_path, tmp_aligns_file_name, options.input1 ) + # IMPORTANT NOTE: for some reason the samtools view command gzips the resulting bam file without warning, + # and the docs do not currently state that this occurs ( very bad ). + command = 'samtools view -h -bt %s -o %s %s' % ( fai_index_file_path, tmp_aligns_file_name, options.input1 ) tmp = tempfile.NamedTemporaryFile( dir=tmp_dir ).name tmp_stderr = open( tmp, 'wb' ) proc = subprocess.Popen( args=command, shell=True, cwd=tmp_dir, stderr=tmp_stderr.fileno() ) @@ -145,6 +147,8 @@ tmp_stderr.close() if returncode != 0: raise Exception, stderr + if len( open( tmp_aligns_file_name ).read() ) == 0: + raise Exception, 'Initial BAM file empty' except Exception, e: #clean up temp files if os.path.exists( tmp_dir ): @@ -184,6 +188,11 @@ stop_err( 'Error sorting alignments from (%s), %s' % ( tmp_aligns_file_name, str( e ) ) ) # Move tmp_aligns_file_name to our output dataset location sorted_bam_file = '%s.bam' % tmp_sorted_aligns_file_name + if os.path.getsize( sorted_bam_file ) == 0: + #clean up temp files + if os.path.exists( tmp_dir ): + shutil.rmtree( tmp_dir ) + stop_err( 'Error creating sorted version of BAM file' ) shutil.move( sorted_bam_file, options.output1 ) #clean up temp files if os.path.exists( tmp_dir ): @@ -192,6 +201,6 @@ if os.path.getsize( options.output1 ) > 0: sys.stdout.write( 'SAM file converted to BAM' ) else: - stop_err( 'Error creating sorted version of BAM file.' ) + stop_err( 'The output file is empty, there may be an error with your input file or settings.' ) if __name__=="__main__": __main__() http://bitbucket.org/galaxy/galaxy-central/changeset/100080d818fa/ changeset: 100080d818fa user: galaxy galaxy date: 2011-07-05 08:46:21 summary: Added new test and optional x axis unit alternatives (bits/probability/kcal etc) to weblogo as suggested by Assaf Gordon affected #: 3 files (28.9 KB) Binary file test-data/rgWebLogo3_test2.png has changed --- a/tools/rgenetics/rgWebLogo3.py Tue Jul 05 12:40:43 2011 +1000 +++ b/tools/rgenetics/rgWebLogo3.py Tue Jul 05 16:46:21 2011 +1000 @@ -1,10 +1,13 @@ """ +# modified june 2 ross lazarus to add units option at Assaf Gordon's suggestion # rgWebLogo3.py # wrapper to check that all fasta files are same length """ import optparse, os, sys, subprocess, tempfile +WEBLOGO = 'weblogo' # executable name for weblogo3 - confusing isn't it? + class WL3: """ simple wrapper class to check fasta sequence lengths are all identical @@ -18,10 +21,21 @@ self.fastaf = file(self.opts.input,'r') self.clparams = {} + def whereis(self,program): + for path in os.environ.get('PATH', '').split(':'): + if os.path.exists(os.path.join(path, program)) and not os.path.isdir(os.path.join(path, program)): + return os.path.join(path, program) + return None + def runCL(self): """ construct and run a command line """ - cll = ['weblogo',] + wl = self.whereis(WEBLOGO) + if not wl: + print >> sys.stderr, '## rgWebLogo3.py error - cannot locate the weblogo binary %s on the current path' % WEBLOGO + print >> sys.stderr, '## Please ensure it is installed and working from http://code.google.com/p/weblogo' + sys.exit(1) + cll = [WEBLOGO,] cll += [' '.join(it) for it in list(self.clparams.items())] cl = ' '.join(cll) assert cl > '', 'runCL needs a command line as clparms' @@ -59,8 +73,13 @@ sys.exit(1) else: seqname = row[1:].strip() - else: - aseq.append(row.strip()) + else: # sequence row + if seqname == None: + print >> sys.stderr,'Invalid fasta file %s - does not start with %s - please read the tool documentation carefully' % (self.opts.input,self.FASTASTARTSYM) + sys.exit(1) + else: + aseq.append(row.strip()) + if seqname <> None: # last one l = len(''.join(aseq)) yield (seqname,l) @@ -74,7 +93,7 @@ lasti = None f = self.iter_fasta() for i,(seqname,seqlen) in enumerate(f): - lasti = i + lasti = i if i == 0: flen = seqlen else: @@ -98,6 +117,8 @@ self.clparams['-u'] = self.opts.upper if self.opts.colours <> None: self.clparams['-c'] = self.opts.colours + if self.opts.units <> None: + self.clparams['-U'] = self.opts.units s = self.runCL() return check,s @@ -122,6 +143,7 @@ op.add_option('-c', '--colours', default=None) op.add_option('-l', '--lower', default=None) op.add_option('-u', '--upper', default=None) + op.add_option('-U', '--units', default=None) opts, args = op.parse_args() assert opts.input <> None,'weblogo3 needs a -i parameter with a fasta input file - cannot open' assert os.path.isfile(opts.input),'weblogo3 needs a valid fasta input file - cannot open %s' % opts.input --- a/tools/rgenetics/rgWebLogo3.xml Tue Jul 05 12:40:43 2011 +1000 +++ b/tools/rgenetics/rgWebLogo3.xml Tue Jul 05 16:46:21 2011 +1000 @@ -1,7 +1,7 @@ -<tool id="rgweblogo3" name="Sequence Logo" version="0.2"> +<tool id="rgweblogo3" name="Sequence Logo" version="0.3"><description>generator for fasta (eg Clustal alignments)</description><command interpreter="python"> - rgWebLogo3.py -F $outformat -s $size -i $input -o $output -t "$logoname" -c "$colours" + rgWebLogo3.py -F $outformat -s $size -i $input -o $output -t "$logoname" -c "$colours" -U "$units" #if $range.mode == 'part' -l "$range.seqstart" -u "$range.seqend" #end if @@ -18,6 +18,15 @@ <option value="eps">EPS</option><option value="txt">Text (shows the detailed calculations for each position - no image)</option></param> + <param name="units" type="select" label="Display Units" + help="What the height of each logo element depicts - eg bits of entropy (default)"> + <option value="bits" selected="True">Entropy (bits)</option> + <option value="probability">Probability</option> + <option value="nats">Nats</option> + <option value="kT">kT</option> + <option value="kJ/mol">kJ/mol</option> + <option value="kcal/mol">kcal/mol</option> + </param><param name="colours" type="select" label="Colour scheme for output Sequence Logo" help="Note that some of these only make sense for protein sequences!"><option value="auto" selected="True">Default automatic colour selection</option> @@ -28,6 +37,7 @@ <option value="hydrophobicity">Hydrophobicity</option><option value="monochrome">monochrome</option></param> + <conditional name="range"><param name="mode" type="select" label="Include entire sequence (default) or specify a subsequence range to use"> @@ -63,17 +73,26 @@ </data></outputs><tests> - <test> - + <test><param name="input" value="rgClustal_testout.fasta" /><param name = "logoname" value="Galaxy/Rgenetics weblogo" /><param name = "outformat" value="jpeg" /><param name = "mode" value="complete" /><param name = "size" value="medium" /><param name = "colours" value="auto" /> + <param name = "units" value="bits" /><output name="output" file="rgWebLogo3_test.jpg" ftype="jpg" compare="sim_size" delta="10000" /></test> - + <test> + <param name="input" value="rgClustal_testout.fasta" /> + <param name = "logoname" value="Galaxy/Rgenetics weblogo" /> + <param name = "outformat" value="png" /> + <param name = "mode" value="complete" /> + <param name = "size" value="medium" /> + <param name = "colours" value="auto" /> + <param name = "units" value="probability" /> + <output name="output" file="rgWebLogo3_test2.png" ftype="png" compare="sim_size" delta="10000" /> + </test></tests><help> @@ -92,7 +111,8 @@ **Warning about input Fasta format files** -The Weblogo3 program used by this tool will fail if your fasta sequences are not all EXACTLY the same length. +The Weblogo3 program used by this tool will fail if your fasta sequences are not all EXACTLY the same length. The tool will provide a warning +and refuse to call the weblogo3 executable if irregular length sequences are detected. Fasta alignments from the companion ClustalW Galaxy tool will work but many other fasta files may cause this tool to fail - please do not file a Galaxy bug report - this is a feature of the tool and a problem with your source data - not a tool error - please make certain all your fasta Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket