From: Jim Procter Date: Wed, 14 Dec 2016 15:08:14 +0000 (+0000) Subject: Merge branch 'patch/JAL-2197_jpredforjnets' into develop X-Git-Tag: Release_2_10_3b1~386 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cd4e2687751aab1c9c5974e6966e610a3332236b;hp=-c;p=jalview.git Merge branch 'patch/JAL-2197_jpredforjnets' into develop merge was missed for 2.10.1 release! --- cd4e2687751aab1c9c5974e6966e610a3332236b diff --combined examples/appletDeployment.html index 7b4daee,9438fa4..e9c22e5 --- a/examples/appletDeployment.html +++ b/examples/appletDeployment.html @@@ -33,7 -33,7 +33,7 @@@ Main Jalview Applet Jar - JmolApplet-14.2.14_2015.06.11.jar + JmolApplet-14.6.4_2016.10.26.jar Jmol Applet Jar @@@ -48,7 -48,7 +48,7 @@@

To run Jalview applet in your web page download the Jars listed above. The snippet below shows a minimal code for embedding Jalview applet into a web page.


 -<applet code="jalview.bin.JalviewLite" width="756" height="560" archive="jalviewApplet.jar,JmolApplet-14.2.14_2015.06.11.jar,java-json.jar,json_simple-1.1.jar">
 +<applet code="jalview.bin.JalviewLite" width="756" height="560" archive="jalviewApplet.jar,JmolApplet-14.6.4_2016.10.26.jar,java-json.jar,json_simple-1.1.jar">
  	<param name="permissions" value="sandbox" />
  	<param name="file" value="plantfdx.fa" />
  	<param name="features" value="plantfdx.features" />
@@@ -195,7 -195,7 +195,7 @@@
  	
  		2.1
  		
    -
  • Jalview Applet can read and display JNet secondary structure annotation +
  • Jalview Applet can read and display JPred secondary structure annotation directly via the jnetfile parameter.
  • Param "UserDefinedColour" - specify your own colours for each residue using a semi colon diff --combined examples/applets.html index d997f14,e0695b9..b789672 --- a/examples/applets.html +++ b/examples/applets.html @@@ -41,7 -41,7 +41,7 @@@ Try out JalviewLite by pressing one of + archive="jalviewApplet.jar,JmolApplet-14.6.4_2016.10.26.jar,java-json.jar,json_simple-1.1.jar"> @@@ -64,7 -64,7 +64,7 @@@ + archive="jalviewApplet.jar,JmolApplet-14.6.4_2016.10.26.jar,java-json.jar,json_simple-1.1.jar"> @@@ -89,7 -89,7 +89,7 @@@ + archive="jalviewApplet.jar,JmolApplet-14.6.4_2016.10.26.jar,java-json.jar,json_simple-1.1.jar"> @@@ -116,7 -116,7 +116,7 @@@ + archive="jalviewApplet.jar,JmolApplet-14.6.4_2016.10.26.jar,java-json.jar,json_simple-1.1.jar"> @@@ -136,7 -136,7 +136,7 @@@ Displays a Multiple Sequence Alignment - Based JNet Prediction for a Sequence + Based JPred Prediction for a Sequence

    @@@ -147,7 -147,7 +147,7 @@@ + archive="jalviewApplet.jar,JmolApplet-14.6.4_2016.10.26.jar,java-json.jar,json_simple-1.1.jar"> @@@ -171,7 -171,7 +171,7 @@@ + archive="jalviewApplet.jar,JmolApplet-14.6.4_2016.10.26.jar,java-json.jar,json_simple-1.1.jar"> diff --combined help/help.jhm index e034fc2,06c5817..f69ed00 --- a/help/help.jhm +++ b/help/help.jhm @@@ -22,7 -22,7 +22,7 @@@ - + @@@ -33,7 -33,7 +33,7 @@@ - + diff --combined help/helpTOC.xml index 3a6b0b3,1248d36..54abd53 --- a/help/helpTOC.xml +++ b/help/helpTOC.xml @@@ -23,6 -23,9 +23,6 @@@ - - - @@@ -70,7 -73,7 +70,7 @@@ - + diff --combined help/html/menus/alignmentMenu.html index 167cb25,b30fbab..51ad601 --- a/help/html/menus/alignmentMenu.html +++ b/help/html/menus/alignmentMenu.html @@@ -278,12 -278,6 +278,12 @@@ Columns by Annotation
    Select or Hide columns in the alignment according to secondary structure, labels and values shown in alignment annotation rows. +
  • Select Highlighted Columns
    Selects + the columns currently highlighted as a result of a find, mouse + over, or selection event from a linked structure viewer or other + application. Modifiers will work on some platforms: ALT will add + all but the highlighted set to the column selection, and CTRL + (or META) will toggle the selection.
  • View
      @@@ -638,22 -632,22 +638,22 @@@
      • JPred Secondary Structure Prediction
        Secondary structure prediction by network - consensus. See the Jpred3 + consensus. See the Jpred client entry for more information. The behaviour of this calculation depends on the current selection:
        • If nothing is selected, and the displayed - sequences appear to be aligned, then a JNet prediction + sequences appear to be aligned, then a JPred prediction will be run for the first sequence in the alignment, using the current alignment. Otherwise the first sequence will be submitted for prediction.
        • If just one sequence (or a region on one sequence) has been selected, it will be submitted to - the automatic JNet prediction server for homolog + the automatic JPred prediction server for homolog detection and prediction.
        • If a set of sequences are selected, and they appear to be aligned, then the alignment will be used - for a Jnet prediction on the first + for a JPred prediction on the first sequence in the set (that is, the one that appears first in the alignment window).
        • diff --combined resources/lang/Messages.properties index 6360dc7,fc35351..d418c76 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@@ -125,8 -125,6 +125,8 @@@ action.change_font_tree_panel = Change action.colour = Colour action.calculate = Calculate action.select_all = Select all +action.select_highlighted_columns = Select Highlighted Columns +tooltip.select_highlighted_columns = Press B to mark highlighted columns, Ctrl-(or Cmd)-B to toggle, and Alt-B to mark all but highlighted columns action.deselect_all = Deselect all action.invert_selection = Invert selection action.using_jmol = Using Jmol @@@ -384,8 -382,8 +384,8 @@@ label.select_at_least_three_bases_in_at label.translation_failed = Translation Failed label.error_when_translating_sequences_submit_bug_report = Unfortunately, something went wrong when translating your sequences.\nPlease take a look in the Jalview java console\nand submit a bug report including the stacktrace. label.implementation_error = Implementation error: -label.automatically_associate_pdb_files_with_sequences_same_name = Do you want to automatically associate the {0} PDB files with sequences in the alignment that have the same name? -label.automatically_associate_pdb_files_by_name = Automatically Associate PDB files by name +label.automatically_associate_structure_files_with_sequences_same_name = Do you want to automatically associate the {0} structure file(s) with sequences in the alignment that have the same name? +label.automatically_associate_structure_files_by_name = Automatically Associate Structure files by name label.ignore_unmatched_dropped_files_info = Do you want to ignore the {0} files whose names did not match any sequence IDs ? label.ignore_unmatched_dropped_files = Ignore unmatched dropped files? label.view_name_original = Original @@@ -789,10 -787,8 +789,10 @@@ label.hide_columns_containing = Hide co label.hide_columns_not_containing = Hide columns that do not contain option.trim_retrieved_seqs = Trim retrieved sequences label.trim_retrieved_sequences = When the reference sequence is longer than the sequence that you are working with, only keep the relevant subsequences. -label.use_sequence_id_1 = Use $SEQUENCE_ID$ or $SEQUENCE_ID=//=$ -label.use_sequence_id_2 = \nto embed sequence id in URL +label.use_sequence_id_1 = Use $DB_ACCESSION$ or $DB_ACCESSION=//=$ +label.use_sequence_id_2 = to embed accession id in URL +label.use_sequence_id_3 = Use $SEQUENCE_ID$ similarly to embed sequence id +label.use_sequence_id_4 = label.ws_parameters_for = Parameters for {0} label.switch_server = Switch server label.choose_jabaws_server = Choose a server for running this service @@@ -835,7 -831,7 +835,7 @@@ label.colour_by = Colour by.. label.muscle_multiple_protein_sequence_alignment = Muscle Multiple Protein Sequence Alignment label.mafft_multiple_sequence_alignment = MAFFT Multiple Sequence Alignment label.clustalw_multiple_sequence_alignment = ClustalW Multiple Sequence Alignment - label.jnet_secondary_structure_prediction = JNet Secondary Structure Prediction + label.jnet_secondary_structure_prediction = JPred Secondary Structure Prediction label.multiharmony = Multi-Harmony label.unable_start_web_service_analysis = Unable to start web service analysis label.job_couldnt_be_started_check_input = The Job couldn't be started. Please check your input, and the Jalview console for any warning messages. @@@ -969,7 -965,7 +969,7 @@@ error.cannot_have_zero_length_vector_re error.implementation_error_multiple_single_sequence_prediction_jobs_not_supported = Implementation Error! Multiple single sequence prediction jobs are not yet supported error.implementation_error_invalid_msa_index_for_job =Implementation Error! Invalid msaIndex for JPredJob on parent MSA input object! error.implementation_error_startjob_called = Implementation error - StartJob(JpredJob) called on {0} - error.multiple_jnet_subjob_merge_not_implemented = Multiple JNet subjob merging not yet implemented + error.multiple_jnet_subjob_merge_not_implemented = Multiple JPred subjob merging not yet implemented label.job_never_ran = Job never ran - input returned to user. error.implementation_error_minlen_must_be_greater_zero = Implementation error: minlen must be zero or more error.implementation_error_msawbjob_called = Implementation error - StartJob(MsaWSJob) called on a WSJobInstance {0} @@@ -1077,7 -1073,7 +1077,7 @@@ exception.unexpected_handling_rnaml_tra exception.couldnt_recover_sequence_properties_for_alignment = Couldn't recover sequence properties for alignment exception.unknown_format_for_file = Unknown format {0} for file \: \n{1} label.remove_gaps = Remove Gaps - exception.couldnt_recover_sequence_props_for_jnet_query = Couldn't recover sequence properties for JNet Query sequence! + exception.couldnt_recover_sequence_props_for_jnet_query = Couldn't recover sequence properties for JPred Query sequence! exception.server_timeout_try_later = Server timed out - try again later\n exception.web_service_returned_null_try_later= Server at {0} returned null object, it probably cannot be contacted. Try again later. exception.cannot_contact_service_endpoint_at = Cannot contact service endpoint at {0} @@@ -1099,7 -1095,7 +1099,7 @@@ info.job_couldnt_be_run_exceeded_hard_l info.job_couldnt_be_run_incorrect_param_setting = Job could not be run because some of the parameter settings are not supported by the server.\n{0}\nPlease check to make sure you have used the correct parameter set for this service\!\n info.no_jobs_ran = No jobs ran info.failed_to_submit_prediction = Failed to submit the prediction\:\n{0} {1} - info.invalid_jnet_job_result_data ={0}\n{1}\nInvalid JNet job result data\!\n{2} + info.invalid_jnet_job_result_data ={0}\n{1}\nInvalid JPred job result data\!\n{2} info.failed_to_submit_sequences_for_alignment = Failed to submit sequences for alignment.\nIt is most likely that there is a problem with the server.\nJust close the window\n info.alignment_object_method_notes = \nAlignment Object Method Notes\n info.server_exception = \n{0} Server exception\!\n{1} @@@ -1146,7 -1142,7 +1146,7 @@@ warn.user_defined_width_requirements = label.couldnt_create_sequence_fetcher = Couldn't create SequenceFetcher warn.couldnt_create_sequence_fetcher_client = Could not create the sequence fetcher client. Check error logs for details. warn.server_didnt_pass_validation = Service did not pass validation.\nCheck the Jalview Console for more details. -warn.url_must_contain = Sequence URL must contain $SEQUENCE_ID$ or a regex $SEQUENCE_ID=//=$ +warn.url_must_contain = Sequence URL must contain $SEQUENCE_ID$, $DB_ACCESSION$, or a regex warn.urls_not_contacted = URLs that could not be contacted warn.urls_no_jaba = URLs without any JABA Services info.validate_jabaws_server = Validate JabaWS Server ?\n(Look in console output for results) @@@ -1270,8 -1266,3 +1270,8 @@@ status.exporting_alignment_as_x_file = label.column = Column label.cant_map_cds = Unable to map CDS to protein\nCDS missing or incomplete label.operation_failed = Operation failed +label.SEQUENCE_ID_no_longer_used = $SEQUENCE_ID$ is no longer used for DB accessions +label.SEQUENCE_ID_for_DB_ACCESSION1 = Please review your URL links in the 'Connections' tab of the Preferences window: +label.SEQUENCE_ID_for_DB_ACCESSION2 = URL links using '$SEQUENCE_ID$' for DB accessions now use '$DB_ACCESSION$'. +label.do_not_display_again = Do not display this message again +label.output_seq_details = Output Sequence Details to list all database references diff --combined resources/lang/Messages_es.properties index e5b5e27,bf8e2fb..8cdcd52 --- a/resources/lang/Messages_es.properties +++ b/resources/lang/Messages_es.properties @@@ -122,8 -122,6 +122,8 @@@ action.change_font_tree_panel = Cambia action.colour = Color action.calculate = Calcular action.select_all = Seleccionar Todo +action.select_highlighted_columns = Seleccionar columnas resaltadas +tooltip.select_highlighted_columns = Presione B para marcar las columnas resaltadas, Ctrl (o Cmd)-B para cambiarlas, y Alt-B para marcar todas menos las columnas resaltadas action.deselect_all = Deseleccionar Todo action.invert_selection = Invertir selección action.using_jmol = Usar Jmol @@@ -353,8 -351,8 +353,8 @@@ label.select_at_least_three_bases_in_at label.translation_failed = Translation Failed label.error_when_translating_sequences_submit_bug_report = Desafortunadamente, algo fue mal a la hora de traducir tus secuencias.\nPor favor, revisa la consola Jalview java \ny presenta un informe de error que incluya el seguimiento. label.implementation_error = Error de implementación: -label.automatically_associate_pdb_files_with_sequences_same_name = Quieres asociar automáticamente los {0} ficheros PDB con las secuencias del alineamiento que tengan el mismo nombre? -label.automatically_associate_pdb_files_by_name = Asociar los ficheros PDB por nombre automáticamente +label.automatically_associate_structure_files_with_sequences_same_name = Quieres asociar automáticamente los {0} ficheros estructura con las secuencias del alineamiento que tengan el mismo nombre? +label.automatically_associate_structure_files_by_name = Asociar los ficheros estructura por nombre automáticamente label.ignore_unmatched_dropped_files_info = Quieres ignorar los {0} ficheros cuyos nombres no coincidan con ningún IDs de las secuencias ? label.ignore_unmatched_dropped_files = Ignorar los ficheros sin coincidencias? label.enter_view_name = Introduzca un nombre para la vista @@@ -722,10 -720,8 +722,10 @@@ label.select_columns_containing = Selec label.select_columns_not_containing = Seleccione las columnas que no contengan option.trim_retrieved_seqs = Ajustar las secuencias recuperadas label.trim_retrieved_sequences = Cuando la secuencia de referencia es más larga que la secuencia con la que está trabajando, sólo se mantienen las subsecuencias relevantes. -label.use_sequence_id_1 = Utilice $SEQUENCE_ID$ o $SEQUENCE_ID=//=$ -label.use_sequence_id_2 = \nto para embeber el id de la secuencia en una URL +label.use_sequence_id_1 = Utilice $DB_ACCESSION$ o $DB_ACCESSION=//=$ +label.use_sequence_id_2 = para embeber el ID de accesión en una URL +label.use_sequence_id_3 = Utilice $SEQUENCE_ID$ de manera similar para embeber +label.use_sequence_id_4 = el ID de la secuencia label.ws_parameters_for = Parámetros para {0} label.switch_server = Cambiar servidor label.open_jabaws_web_page = Abra el página principal del servidor JABAWS en un navegador web @@@ -768,7 -764,7 +768,7 @@@ label.colour_by = Colorear por.. label.muscle_multiple_protein_sequence_alignment = Alineamiento múltiple de secuencias de proteínas con Muscle label.mafft_multiple_sequence_alignment = Alineamiento múltiple de secuencias con MAFFT label.clustalw_multiple_sequence_alignment = Alineamiento múltiple de secuencias con ClustalW - label.jnet_secondary_structure_prediction = Predicción de la estructura secundaria con JNet + label.jnet_secondary_structure_prediction = Predicción de la estructura secundaria con JPred label.multiharmony = Multi-Harmony label.unable_start_web_service_analysis = No es posible iniciar el servicio web de análisis label.job_couldnt_be_started_check_input = El trabajo no puede arrancarse. Por favor, compruebe los parámetros de entrada y los mensajes de advertencia de la consola de Jalview. @@@ -902,7 -898,7 +902,7 @@@ error.cannot_have_zero_length_vector_re error.implementation_error_multiple_single_sequence_prediction_jobs_not_supported = ¡Error de implementación! Todavía no se soportan varios trabajos de predicción asociados a una única secuencia. error.implementation_error_invalid_msa_index_for_job = ¡Error de implementación! Valor msaIndex no válido para JPredJob en el objeto de entrada MSA padre! error.implementation_error_startjob_called = Error de implementación - StartJob(JpredJob) invocado en {0} - error.multiple_jnet_subjob_merge_not_implemented = Todavía no se han implementado varios subtrabajos JNet conjuntos. + error.multiple_jnet_subjob_merge_not_implemented = Todavía no se han implementado varios subtrabajos JPred conjuntos. label.job_never_ran = El trabajo nunca se ejecutó - entrada devuelta al usuario. error.implementation_error_minlen_must_be_greater_zero = Error de implementación: minlen debe ser cero o más error.implementation_error_msawbjob_called = Error de implementación - StartJob(MsaWSJob) invocado en un WSJobInstance {0} @@@ -1010,7 -1006,7 +1010,7 @@@ exception.unexpected_handling_rnaml_tra exception.couldnt_recover_sequence_properties_for_alignment = No es posible recuperar las propiedades de la secuencia para el alineamiento exception.unknown_format_for_file = Formato desconocido {0} para el fichero \: \n{1} label.remove_gaps = Eliminar huecos - exception.couldnt_recover_sequence_props_for_jnet_query = No ha sido posible recuperar las propiedades de la secuencia para la secuencia JNet Query! + exception.couldnt_recover_sequence_props_for_jnet_query = No ha sido posible recuperar las propiedades de la secuencia para la secuencia JPred Query! exception.server_timeout_try_later = Tiempo de conexi\u00F3n ha expirado - int\u00E9ntelo de nuevo m\u00E1s tarde\n exception.web_service_returned_null_try_later= El servidor {0} ha devuelto un objeto nulo, por lo que probablemente no se haya podido contactar con él. Inténtelo de nuevo más tarde. exception.cannot_contact_service_endpoint_at = No es posible contactar por el punto de acceso al servicio en {0} @@@ -1031,7 -1027,7 +1031,7 @@@ info.job_couldnt_be_run_exceeded_hard_l info.job_couldnt_be_run_incorrect_param_setting = No es posible ejecutar el trabjao porque el servidor no soporta algunos de los par\u00E1metros.\n{0}\nPor favor, aseg\u00FArese de que ha usado los par\u00E1metros adecuados para este servicio\n info.no_jobs_ran = No se ha ejecutado ningún trabajo info.failed_to_submit_prediction = Error al enviar la predicci\u00F3n\:\n{0} {1} - info.invalid_jnet_job_result_data ={0}\n{1}\nResultados del trabajo JNet no v\u00E1lidos\!\n{2} + info.invalid_jnet_job_result_data ={0}\n{1}\nResultados del trabajo JPred no v\u00E1lidos\!\n{2} info.failed_to_submit_sequences_for_alignment = Error al enviar la secuencias para el alineamiento.\nLo m\u00E1s probable es que haya un problema en el servidor.\nSimplemente, cierre la ventana\n info.alignment_object_method_notes = \nNotas sobre los m\u00E9todos del objeto alineamiento\n info.server_exception = \n{0} Excepci\u00F3n del servidor\!\n{1} @@@ -1072,7 -1068,7 +1072,7 @@@ warn.user_defined_width_requirements = label.couldnt_create_sequence_fetcher = No es posible crear SequenceFetcher warn.couldnt_create_sequence_fetcher_client = No es posible crear el cliente de recuperador de secuencias. Comprueba el fichero de log para más detalles. warn.server_didnt_pass_validation = El servicio no ha pasado la validaci\u00F3n.\nCompruebe la consola de Jalview para m\u00E1s detalles. -warn.url_must_contain = La URL de la secuencia debe contener $SEQUENCE_ID$ o un regex $SEQUENCE_ID=//=$ +warn.url_must_contain = La URL de la secuencia debe contener $SEQUENCE_ID$, $DB_ACCESSION$ o un regex info.validate_jabaws_server = \u00BFValidar el servidor JabaWS?\n(Consulte la consola de salida para obtener los resultados) label.test_server = ¿Probar servidor? info.you_want_jalview_to_find_uniprot_accessions = \u00BFDesea que Jalview encuentre\nUniprot Accession ids para los nombres de secuencias dados? @@@ -1271,8 -1267,3 +1271,8 @@@ status.exporting_alignment_as_x_file = label.column = Columna label.cant_map_cds = No se pudo mapear CDS a proteína\nDatos CDS faltantes o incompletos label.operation_failed = Operación fallada +label.SEQUENCE_ID_no_longer_used = $SEQUENCE_ID$ no se utiliza más para accesiones DB +label.SEQUENCE_ID_for_DB_ACCESSION1 = Por favor, revise sus URLs en la pestaña 'Conexiones' de la ventana de Preferencias: +label.SEQUENCE_ID_for_DB_ACCESSION2 = URL enlaza usando '$SEQUENCE_ID$' para accesiones DB ahora usar '$DB_ACCESSION$'. +label.do_not_display_again = No mostrar este mensaje de nuevo +label.output_seq_details = Seleccionar Detalles de la secuencia para ver todas diff --combined src/jalview/appletgui/AlignFrame.java index f830fe6,af91399..175b171 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@@ -49,9 -49,7 +49,9 @@@ import jalview.datamodel.SequenceGroup import jalview.datamodel.SequenceI; import jalview.io.AnnotationFile; import jalview.io.AppletFormatAdapter; +import jalview.io.DataSourceType; import jalview.io.FeaturesFile; +import jalview.io.FileFormat; import jalview.io.TCoffeeScoreFile; import jalview.schemes.Blosum62ColourScheme; import jalview.schemes.BuriedColourScheme; @@@ -347,7 -345,7 +347,7 @@@ public class AlignFrame extends Embmenu * is protocol for accessing data referred to by file */ - public boolean parseFeaturesFile(String file, String type) + public boolean parseFeaturesFile(String file, DataSourceType type) { return parseFeaturesFile(file, type, true); } @@@ -357,14 -355,14 +357,14 @@@ * * @param file * file URL, content, or other resolvable path - * @param type + * @param sourceType * is protocol for accessing data referred to by file * @param autoenabledisplay * when true, display features flag will be automatically enabled if * features are loaded * @return true if data parsed as a features file */ - public boolean parseFeaturesFile(String file, String type, + public boolean parseFeaturesFile(String file, DataSourceType sourceType, boolean autoenabledisplay) { boolean featuresFile = false; @@@ -374,7 -372,7 +374,7 @@@ .getFeatureRenderer().getFeatureColours(); boolean relaxedIdMatching = viewport.applet.getDefaultParameter( "relaxedidmatch", false); - featuresFile = new FeaturesFile(file, type).parse( + featuresFile = new FeaturesFile(file, sourceType).parse( viewport.getAlignment(), colours, true, relaxedIdMatching); } catch (Exception ex) { @@@ -1358,13 -1356,13 +1358,13 @@@ CutAndPasteTransfer cap = new CutAndPasteTransfer(true, this); Frame frame = new Frame(); frame.add(cap); - jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage( + JalviewLite.addFrame(frame, MessageManager.formatMessage( "label.alignment_output_command", new Object[] { e.getActionCommand() }), 600, 500); - FeatureRenderer fr = this.alignPanel.cloneFeatureRenderer(); + FileFormat fileFormat = FileFormat.valueOf(e.getActionCommand()); cap.setText(new AppletFormatAdapter(alignPanel).formatSequences( - e.getActionCommand(), viewport.getAlignment(), + fileFormat, viewport.getAlignment(), viewport.getShowJVSuffix())); } @@@ -1480,10 -1478,13 +1480,13 @@@ url.append(appendProtocol(viewport.applet.getParameter("annotations"))); } - if (viewport.applet.getParameter("jnetfile") != null) + if (viewport.applet.getParameter("jnetfile") != null + || viewport.applet.getParameter("jpredfile") != null) { url.append("&annotations="); - url.append(appendProtocol(viewport.applet.getParameter("jnetfile"))); + url.append(appendProtocol(viewport.applet.getParameter("jnetfile") != null ? viewport.applet + .getParameter("jnetfile") : viewport.applet + .getParameter("jpredfile"))); } if (viewport.applet.getParameter("defaultColour") != null) @@@ -3236,9 -3237,11 +3239,9 @@@ inputText.addActionListener(this); Menu outputTextboxMenu = new Menu( MessageManager.getString("label.out_to_textbox")); - for (int i = 0; i < jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS.length; i++) + for (String ff : FileFormat.getWritableFormats(true)) { - - MenuItem item = new MenuItem( - jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS[i]); + MenuItem item = new MenuItem(ff); item.addActionListener(new java.awt.event.ActionListener() { @@@ -4016,8 -4019,7 +4019,8 @@@ } // resolve data source // TODO: this code should be a refactored to an io package - String protocol = AppletFormatAdapter.resolveProtocol(pdbFile, "PDB"); + DataSourceType protocol = AppletFormatAdapter.resolveProtocol( + pdbFile, FileFormat.PDB); if (protocol == null) { return false; @@@ -4061,7 -4063,7 +4064,7 @@@ } public void newStructureView(JalviewLite applet, PDBEntry pdb, - SequenceI[] seqs, String[] chains, String protocol) + SequenceI[] seqs, String[] chains, DataSourceType protocol) { // Scrub any null sequences from the array Object[] sqch = cleanSeqChainArrays(seqs, chains); @@@ -4072,16 -4074,10 +4075,16 @@@ System.err .println("JalviewLite.AlignFrame:newStructureView: No sequence to bind structure to."); } - if (protocol == null || protocol.trim().length() == 0 - || protocol.equals("null")) + if (protocol == null) { - protocol = (String) pdb.getProperty("protocol"); + String sourceType = (String) pdb.getProperty("protocol"); + try + { + protocol = DataSourceType.valueOf(sourceType); + } catch (IllegalArgumentException e) + { + // ignore + } if (protocol == null) { System.err.println("Couldn't work out protocol to open structure: " @@@ -4104,11 -4100,12 +4107,11 @@@ { // can only do alignments with Jmol // find the last jmol window assigned to this alignment - jalview.appletgui.AppletJmol ajm = null, tajm; - Vector jmols = applet - .getAppletWindow(jalview.appletgui.AppletJmol.class); + AppletJmol ajm = null, tajm; + Vector jmols = applet.getAppletWindow(AppletJmol.class); for (int i = 0, iSize = jmols.size(); i < iSize; i++) { - tajm = (jalview.appletgui.AppletJmol) jmols.elementAt(i); + tajm = (AppletJmol) jmols.elementAt(i); if (tajm.ap.alignFrame == this) { ajm = tajm; @@@ -4127,7 -4124,7 +4130,7 @@@ // otherwise, create a new window if (applet.jmolAvailable) { - new jalview.appletgui.AppletJmol(pdb, seqs, chains, alignPanel, + new AppletJmol(pdb, seqs, chains, alignPanel, protocol); applet.lastFrameX += 40; applet.lastFrameY += 40; diff --combined src/jalview/bin/JalviewLite.java index 9fd8a90,a3b2b0b..de011ea --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@@ -37,9 -37,6 +37,9 @@@ import jalview.datamodel.SequenceGroup import jalview.datamodel.SequenceI; import jalview.io.AnnotationFile; import jalview.io.AppletFormatAdapter; +import jalview.io.DataSourceType; +import jalview.io.FileFormat; +import jalview.io.FileFormatI; import jalview.io.FileParse; import jalview.io.IdentifyFile; import jalview.io.JPredFile; @@@ -66,7 -63,6 +66,7 @@@ import java.awt.event.ActionEvent import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.BufferedReader; +import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.util.ArrayList; @@@ -517,23 -513,21 +517,23 @@@ public class JalviewLite extends Apple { try { + FileFormatI theFormat = FileFormat.valueOf(format); boolean seqlimits = suffix.equalsIgnoreCase(TRUE); if (alf.viewport.getSelectionGroup() != null) { // JBPNote: getSelectionAsNewSequence behaviour has changed - this // method now returns a full copy of sequence data // TODO consider using getSequenceSelection instead here - String reply = new AppletFormatAdapter().formatSequences(format, + String reply = new AppletFormatAdapter().formatSequences(theFormat, new Alignment(alf.viewport.getSelectionAsNewSequence()), seqlimits); return reply; } - } catch (Exception ex) + } catch (IllegalArgumentException ex) { ex.printStackTrace(); - return "Error retrieving alignment in " + format + " format. "; + return "Error retrieving alignment, possibly invalid format specifier: " + + format; } return ""; } @@@ -715,15 -709,13 +715,15 @@@ { boolean seqlimits = suffix.equalsIgnoreCase(TRUE); - String reply = new AppletFormatAdapter().formatSequences(format, + FileFormatI theFormat = FileFormat.valueOf(format); + String reply = new AppletFormatAdapter().formatSequences(theFormat, alf.viewport.getAlignment(), seqlimits); return reply; - } catch (Exception ex) + } catch (IllegalArgumentException ex) { ex.printStackTrace(); - return "Error retrieving alignment in " + format + " format. "; + return "Error retrieving alignment, possibly invalid format specifier: " + + format; } } @@@ -749,14 -741,14 +749,14 @@@ public void loadAnnotationFrom(AlignFrame alf, String annotation) { if (new AnnotationFile().annotateAlignmentView(alf.getAlignViewport(), - annotation, AppletFormatAdapter.PASTE)) + annotation, DataSourceType.PASTE)) { alf.alignPanel.fontChanged(); alf.alignPanel.setScrollValues(0, 0); } else { - alf.parseFeaturesFile(annotation, AppletFormatAdapter.PASTE); + alf.parseFeaturesFile(annotation, DataSourceType.PASTE); } } @@@ -782,7 -774,7 +782,7 @@@ public boolean loadFeaturesFrom(AlignFrame alf, String features, boolean autoenabledisplay) { - return alf.parseFeaturesFile(features, AppletFormatAdapter.PASTE, + return alf.parseFeaturesFile(features, DataSourceType.PASTE, autoenabledisplay); } @@@ -890,17 -882,17 +890,17 @@@ { AlignmentI al = null; - String format = new IdentifyFile().identify(text, - AppletFormatAdapter.PASTE); try { - al = new AppletFormatAdapter().readFile(text, - AppletFormatAdapter.PASTE, format); + FileFormatI format = new IdentifyFile().identify(text, + DataSourceType.PASTE); + al = new AppletFormatAdapter().readFile(text, DataSourceType.PASTE, + format); if (al.getHeight() > 0) { return new AlignFrame(al, this, title, false); } - } catch (java.io.IOException ex) + } catch (IOException ex) { ex.printStackTrace(); } @@@ -1826,7 -1818,7 +1826,7 @@@ /** * State variable: protocol for access to file source */ - String protocol; + DataSourceType protocol; String _file; // alignment file or URL spec @@@ -1856,7 -1848,7 +1856,7 @@@ */ if (path.startsWith("PASTE")) { - protocol = AppletFormatAdapter.PASTE; + protocol = DataSourceType.PASTE; return path.substring(5); } @@@ -1865,7 -1857,7 +1865,7 @@@ */ if (path.indexOf("://") != -1) { - protocol = AppletFormatAdapter.URL; + protocol = DataSourceType.URL; return path; } @@@ -1881,7 -1873,7 +1881,7 @@@ System.err.println("Prepended document base '" + documentBase + "' to make: '" + withDocBase + "'"); } - protocol = AppletFormatAdapter.URL; + protocol = DataSourceType.URL; return withDocBase; } @@@ -1894,7 -1886,7 +1894,7 @@@ if (!withCodeBase.equals(withDocBase) && HttpUtils.isValidUrl(withCodeBase)) { - protocol = AppletFormatAdapter.URL; + protocol = DataSourceType.URL; if (debug) { System.err.println("Prepended codebase '" + codeBase @@@ -1909,7 -1901,7 +1909,7 @@@ */ if (inArchive(path)) { - protocol = AppletFormatAdapter.CLASSLOADER; + protocol = DataSourceType.CLASSLOADER; } return path; } @@@ -2023,12 -2015,11 +2023,12 @@@ return null; } String resolvedFile = resolveFileProtocol(fileParam); AlignmentI al = null; try { + FileFormatI format = new IdentifyFile().identify(resolvedFile, + protocol); + dbgMsg("File identified as '" + format + "'"); al = new AppletFormatAdapter().readFile(resolvedFile, protocol, format); if ((al != null) && (al.getHeight() > 0)) @@@ -2045,7 -2036,7 +2045,7 @@@ // update the focus. currentAlignFrame = newAlignFrame; - if (protocol == AppletFormatAdapter.PASTE) + if (protocol == DataSourceType.PASTE) { newAlignFrame.setTitle(MessageManager.formatMessage( "label.sequences_from", new Object[] { applet @@@ -2216,7 -2207,8 +2216,7 @@@ } else { - pdbs.addElement(new Object[] { pdb, seqs, chains, - new String(protocol) }); + pdbs.addElement(new Object[] { pdb, seqs, chains, protocol }); } } } @@@ -2255,6 -2247,11 +2255,11 @@@ { boolean result = false; String param = applet.getParameter("jnetfile"); + if (param == null) + { + // jnet became jpred around 2016 + param = applet.getParameter("jpredfile"); + } if (param != null) { try diff --combined src/jalview/ws/jws1/Discoverer.java index 7258f51,b30f6cb..ba4054e --- a/src/jalview/ws/jws1/Discoverer.java +++ b/src/jalview/ws/jws1/Discoverer.java @@@ -20,13 -20,14 +20,13 @@@ */ package jalview.ws.jws1; +import jalview.gui.JvOptionPane; import jalview.util.MessageManager; import java.util.Hashtable; import java.util.StringTokenizer; import java.util.Vector; -import javax.swing.JOptionPane; - import ext.vamsas.IRegistry; import ext.vamsas.IRegistryServiceLocator; import ext.vamsas.RegistryServiceSoapBindingStub; @@@ -222,7 -223,7 +222,7 @@@ public class Discoverer implements Runn + "\nNucleic Acids Research, Web Server issue (first published 15th April 2015)" + "\ndoi://10.1093/nar/gkv332", "http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred", - "JNet Secondary Structure Prediction") }; + "JPred Secondary Structure Prediction") }; services = new Hashtable(); serviceList = new Vector(); buildServiceLists(defServices, serviceList, services); @@@ -254,11 -255,11 +254,11 @@@ { if (jalview.gui.Desktop.desktop != null) { - JOptionPane.showMessageDialog(jalview.gui.Desktop.desktop, + JvOptionPane.showMessageDialog(jalview.gui.Desktop.desktop, MessageManager.getString("label.set_proxy_settings"), MessageManager .getString("label.proxy_authorization_failed"), - JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); } } else diff --combined src/jalview/ws/jws1/JPredClient.java index 2c05386,b20a100..65847e6 --- a/src/jalview/ws/jws1/JPredClient.java +++ b/src/jalview/ws/jws1/JPredClient.java @@@ -27,7 -27,6 +27,7 @@@ import jalview.datamodel.SeqCigar import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; import jalview.gui.Desktop; +import jalview.gui.JvOptionPane; import jalview.gui.WebserviceInfo; import jalview.util.MessageManager; @@@ -37,6 -36,7 +37,6 @@@ import java.util.Hashtable import javax.swing.JMenu; import javax.swing.JMenuItem; -import javax.swing.JOptionPane; import ext.vamsas.Jpred; import ext.vamsas.JpredServiceLocator; @@@ -238,7 -238,7 +238,7 @@@ public class JPredClient extends WS1Cli SequenceI seq = msf[0]; - String altitle = "JNet prediction on " + seq.getName() + String altitle = "JPred prediction on " + seq.getName() + " using alignment from " + title; wsInfo.setProgressText("Job details for MSA based prediction (" + title @@@ -275,7 -275,7 +275,7 @@@ wsInfo.setProgressText("Job details for prediction on sequence :\n>" + seq.getName() + "\n" + AlignSeq.extractGaps("-. ", seq.getSequenceAsString()) + "\n"); - String altitle = "JNet prediction for sequence " + seq.getName() + String altitle = "JPred prediction for sequence " + seq.getName() + " from " + title; Hashtable SequenceInfo = jalview.analysis.SeqsetUtils @@@ -323,7 -323,7 +323,7 @@@ } catch (Exception ex) { - JOptionPane + JvOptionPane .showMessageDialog( Desktop.desktop, MessageManager @@@ -332,7 -332,7 +332,7 @@@ new String[] { WebServiceName, WsURL }), MessageManager .getString("label.internal_jalview_error"), - JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); wsInfo.setProgressText(MessageManager .formatMessage( "label.secondary_structure_prediction_service_couldnt_be_located",