From: jprocter Date: Tue, 15 May 2012 15:55:08 +0000 (+0100) Subject: remove jabaws 3 development code X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a6f4c70ca7af2302c60217480a534a9ac2320acb;p=jabaws.git remove jabaws 3 development code --- diff --git a/conf/temp/blastdbcmd.txt b/conf/temp/blastdbcmd.txt deleted file mode 100644 index 368428d..0000000 --- a/conf/temp/blastdbcmd.txt +++ /dev/null @@ -1,98 +0,0 @@ -Analog of fastacmd for blast+ - --bash-3.2$ /local/opt/bin/blastdbcmd -help -USAGE - blastdbcmd [-h] [-help] [-db dbname] [-dbtype molecule_type] - [-entry sequence_identifier] [-entry_batch input_file] [-pig PIG] [-info] - [-range numbers] [-strand strand] [-mask_sequence_with numbers] - [-out output_file] [-outfmt format] [-target_only] [-get_dups] - [-line_length number] [-ctrl_a] [-version] - -DESCRIPTION - BLAST database client, version 2.2.23+ - -OPTIONAL ARGUMENTS - -h - Print USAGE and DESCRIPTION; ignore other arguments - -help - Print USAGE, DESCRIPTION and ARGUMENTS description; ignore other arguments - -version - Print version number; ignore other arguments - - *** BLAST database options - -db - BLAST database name - Default = `nr' - -dbtype - Molecule type stored in BLAST database - Default = `guess' - - *** Retrieval options - -entry - Comma-delimited search string(s) of sequence identifiers: - e.g.: 555, AC147927, 'gnl|dbname|tag', or 'all' to select all - sequences in the database - * Incompatible with: entry_batch, pig, info - -entry_batch - Input file for batch processing (Format: one entry per line) - * Incompatible with: entry, pig, info - -pig =0> - PIG to retrieve - * Incompatible with: entry, entry_batch, target_only, info - -info - Print BLAST database information - * Incompatible with: entry, entry_batch, outfmt, strand, target_only, - ctrl_a, get_dups, pig, range - - *** Sequence retrieval configuration options - -range - Range of sequence to extract (Format: start-stop) - * Incompatible with: info - -strand - Strand of nucleotide sequence to extract - Default = `plus' - * Incompatible with: info - -mask_sequence_with - Produce lower-case masked FASTA using the algorithm IDs specified (Format: - N,M,...) - - *** Output configuration options - -out - Output file name - Default = `-' - -outfmt - Output format, where the available format specifiers are: - %f means sequence in FASTA format - %s means sequence data (without defline) - %a means accession - %g means gi - %o means ordinal id (OID) - %t means sequence title - %l means sequence length - %T means taxid - %L means common taxonomic name - %S means scientific name - %P means PIG - %mX means sequence masking data, where X is an optional comma- - separted list of integers to specify the algorithm ID(s) to - diaplay (or all masks if absent or invalid specification). - Masking data will be displayed as a series of 'N-M' values - separated by ';' or the word 'none' if none are available. - For every format except '%f', each line of output will correspond to - a sequence. - Default = `%f' - * Incompatible with: info - -target_only - Definition line should contain target GI only - * Incompatible with: pig, info, get_dups - -get_dups - Retrieve duplicate accessions - * Incompatible with: info, target_only - - *** Output configuration options for FASTA format - -line_length =1> - Line length for output - Default = `80' - -ctrl_a - Use Ctrl-A as the non-redundant defline separator - * Incompatible with: info diff --git a/conf/temp/jackhmmer.txt b/conf/temp/jackhmmer.txt deleted file mode 100644 index d98a115..0000000 --- a/conf/temp/jackhmmer.txt +++ /dev/null @@ -1,87 +0,0 @@ --bash-3.2$ /sw/opt/hmmer3/bin/jackhmmer -h -# jackhmmer :: iteratively search a protein sequence against a protein database -# HMMER 3.0 (March 2010); http://hmmer.org/ -# Copyright (C) 2010 Howard Hughes Medical Institute. -# Freely distributed under the GNU General Public License (GPLv3). -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Usage: jackhmmer [-options] - -where basic options are: - -h : show brief help on version and usage - -N : set maximum number of iterations to [5] (n>0) - -options directing output: - -o : direct output to file , not stdout - -A : save multiple alignment of hits to file - --tblout : save parseable table of per-sequence hits to file - --domtblout : save parseable table of per-domain hits to file - --chkhmm : save HMM checkpoints to files -.hmm - --chkali : save alignment checkpoints to files -.sto - --acc : prefer accessions over names in output - --noali : don't output alignments, so output is smaller - --notextw : unlimit ASCII text output line width - --textw : set max width of ASCII text output lines [120] (n>=120) - -options controlling scoring system in first iteration: - --popen : gap open probability [0.02] (0<=x<0.5) - --pextend : gap extend probability [0.4] (0<=x<1) - --mxfile : substitution score matrix [default: BLOSUM62] - -options controlling reporting thresholds: - -E : report sequences <= this E-value threshold in output [10.0] (x>0) - -T : report sequences >= this score threshold in output - --domE : report domains <= this E-value threshold in output [10.0] (x>0) - --domT : report domains >= this score cutoff in output - -options controlling significance thresholds for inclusion in next round: - --incE : consider sequences <= this E-value threshold as significant - --incT : consider sequences >= this score threshold as significant - --incdomE : consider domains <= this E-value threshold as significant - --incdomT : consider domains >= this score threshold as significant - -options controlling acceleration heuristics: - --max : Turn all heuristic filters off (less speed, more power) - --F1 : Stage 1 (MSV) threshold: promote hits w/ P <= F1 [0.02] - --F2 : Stage 2 (Vit) threshold: promote hits w/ P <= F2 [1e-3] - --F3 : Stage 3 (Fwd) threshold: promote hits w/ P <= F3 [1e-5] - --nobias : turn off composition bias filter - -options controlling model construction after first iteration: - --fast : assign cols w/ >= symfrac residues as consensus - --hand : manual construction (requires reference annotation) - --symfrac : sets sym fraction controlling --fast construction - --fragthresh : if L < x, tag sequence as a fragment - -options controlling relative weights in models after first iteration: - --wpb : Henikoff position-based weights [default] - --wgsc : Gerstein/Sonnhammer/Chothia tree weights - --wblosum : Henikoff simple filter weights - --wnone : don't do any relative weighting; set all to 1 - --wid : for --wblosum: set identity cutoff [0.62] (0<=x<=1) - -options controlling effective seq number in models after first iteration: - --eent : adjust eff seq # to achieve relative entropy target [default] - --eclust : eff seq # is # of single linkage clusters - --enone : no effective seq # weighting: just use nseq - --eset : set eff seq # for all models to - --ere : for --eent: set minimum rel entropy/position to - --esigma : for --eent: set sigma param to [45.0] - --eid : for --eclust: set fractional identity cutoff to [0.62] - -Options controlling E value calibration: - --EmL : length of sequences for MSV Gumbel mu fit [200] (n>0) - --EmN : number of sequences for MSV Gumbel mu fit [200] (n>0) - --EvL : length of sequences for Viterbi Gumbel mu fit [200] (n>0) - --EvN : number of sequences for Viterbi Gumbel mu fit [200] (n>0) - --EfL : length of sequences for Forward exp tail tau fit [100] (n>0) - --EfN : number of sequences for Forward exp tail tau fit [200] (n>0) - --Eft : tail mass for Forward exponential tail tau fit [0.04] (0 : set # of comparisons done, for E-value calculation - --domZ : set # of significant seqs, for domain E-value calculation - --seed : set RNG seed to (if 0: one-time arbitrary seed) [42] - --qformat : assert query is in format : no autodetection - --tformat : assert target is in format >: no autodetection - --cpu : number of parallel CPU workers to use for multithreads diff --git a/conf/temp/psiblast.txt b/conf/temp/psiblast.txt deleted file mode 100644 index 7b62c3e..0000000 --- a/conf/temp/psiblast.txt +++ /dev/null @@ -1,249 +0,0 @@ - /local/gjb_lab/blast+/bin/psiblast -help -USAGE - psiblast [-h] [-help] [-import_search_strategy filename] - [-export_search_strategy filename] [-db database_name] - [-dbsize num_letters] [-gilist filename] [-negative_gilist filename] - [-entrez_query entrez_query] [-subject subject_input_file] - [-subject_loc range] [-query input_file] [-out output_file] - [-evalue evalue] [-word_size int_value] [-gapopen open_penalty] - [-gapextend extend_penalty] [-xdrop_ungap float_value] - [-xdrop_gap float_value] [-xdrop_gap_final float_value] - [-searchsp int_value] [-seg SEG_options] [-soft_masking soft_masking] - [-matrix matrix_name] [-threshold float_value] [-culling_limit int_value] - [-best_hit_overhang float_value] [-best_hit_score_edge float_value] - [-window_size int_value] [-lcase_masking] [-query_loc range] - [-parse_deflines] [-outfmt format] [-show_gis] - [-num_descriptions int_value] [-num_alignments int_value] [-html] - [-max_target_seqs num_sequences] [-num_threads int_value] [-remote] - [-comp_based_stats compo] [-use_sw_tback] [-gap_trigger float_value] - [-num_iterations int_value] [-out_pssm checkpoint_file] - [-out_ascii_pssm ascii_mtx_file] [-in_msa align_restart] - [-in_pssm psi_chkpt_file] [-pseudocount pseudocount] - [-inclusion_ethresh ethresh] [-phi_pattern file] [-version] - -DESCRIPTION - Position-Specific Initiated BLAST 2.2.22+ - -OPTIONAL ARGUMENTS - -h - Print USAGE and DESCRIPTION; ignore other arguments - -help - Print USAGE, DESCRIPTION and ARGUMENTS description; ignore other arguments - -version - Print version number; ignore other arguments - - *** Input query options - -query - Input file name - Default = `-' - * Incompatible with: in_msa, in_pssm - -query_loc - Location on the query sequence (Format: start-stop) - - *** General search options - -db - BLAST database name - * Incompatible with: subject, subject_loc - -out - Output file name - Default = `-' - -evalue - Expectation value (E) threshold for saving hits - Default = `10' - -word_size =2> - Word size for wordfinder algorithm - -gapopen - Cost to open a gap - -gapextend - Cost to extend a gap - -matrix - Scoring matrix name - Default = `BLOSUM62' - -threshold =0> - Minimum word score such that the word is added to the BLAST lookup table - -comp_based_stats - Use composition-based statistics for blastp / tblastn: - D or d: default (equivalent to 2) - 0 or F or f: no composition-based statistics - 1: Composition-based statistics as in NAR 29:2994-3005, 2001 - 2 or T or t : Composition-based score adjustment as in Bioinformatics - 21:902-911, - 2005, conditioned on sequence properties - 3: Composition-based score adjustment as in Bioinformatics 21:902-911, - 2005, unconditionally - For programs other than tblastn, must either be absent or be D, F or 0 - Default = `2' - - *** BLAST-2-Sequences options - -subject - Subject sequence(s) to search - * Incompatible with: db, gilist, negative_gilist - -subject_loc - Location on the subject sequence (Format: start-stop) - * Incompatible with: db, gilist, negative_gilist, remote - - *** Formatting options - -outfmt - alignment view options: - 0 = pairwise, - 1 = query-anchored showing identities, - 2 = query-anchored no identities, - 3 = flat query-anchored, show identities, - 4 = flat query-anchored, no identities, - 5 = XML Blast output, - 6 = tabular, - 7 = tabular with comment lines, - 8 = Text ASN.1, - 9 = Binary ASN.1 - 10 = Comma-separated values - - Options 6, 7, and 10 can be additionally configured to produce - a custom format specified by space delimited format specifiers. - The supported format specifiers are: - qseqid means Query Seq-id - qgi means Query GI - qacc means Query accesion - sseqid means Subject Seq-id - sallseqid means All subject Seq-id(s), separated by a ';' - sgi means Subject GI - sallgi means All subject GIs - sacc means Subject accession - sallacc means All subject accessions - qstart means Start of alignment in query - qend means End of alignment in query - sstart means Start of alignment in subject - send means End of alignment in subject - qseq means Aligned part of query sequence - sseq means Aligned part of subject sequence - evalue means Expect value - bitscore means Bit score - score means Raw score - length means Alignment length - pident means Percentage of identical matches - nident means Number of identical matches - mismatch means Number of mismatches - positive means Number of positive-scoring matches - gapopen means Number of gap openings - gaps means Total number of gaps - ppos means Percentage of positive-scoring matches - frames means Query and subject frames separated by a '/' - qframe means Query frame - sframe means Subject frame - When not provided, the default value is: - 'qseqid sseqid pident length mismatch gapopen qstart qend sstart send - evalue bitscore', which is equivalent to the keyword 'std' - Default = `0' - -show_gis - Show NCBI GIs in deflines? - -num_descriptions =0> - Number of database sequences to show one-line descriptions for - Default = `500' - -num_alignments =0> - Number of database sequences to show alignments for - Default = `250' - -html - Produce HTML output? - - *** Query filtering options - -seg - Filter query sequence with SEG (Format: 'yes', 'window locut hicut', or - 'no' to disable) - Default = `no' - -soft_masking - Apply filtering locations as soft masks - Default = `false' - -lcase_masking - Use lower case filtering in query and subject sequence(s)? - - *** Restrict search or results - -gilist - Restrict search of database to list of GI's - * Incompatible with: negative_gilist, remote, subject, subject_loc - -negative_gilist - Restrict search of database to everything except the listed GIs - * Incompatible with: gilist, remote, subject, subject_loc - -entrez_query - Restrict search with the given Entrez query - * Requires: remote - -culling_limit =0> - If the query range of a hit is enveloped by that of at least this many - higher-scoring hits, delete the hit - * Incompatible with: best_hit_overhang, best_hit_score_edge - -best_hit_overhang =0 and =<0.5)> - Best Hit algorithm overhang value (recommended value: 0.1) - * Incompatible with: culling_limit - -best_hit_score_edge =0 and =<0.5)> - Best Hit algorithm score edge value (recommended value: 0.1) - * Incompatible with: culling_limit - -max_target_seqs =1> - Maximum number of aligned sequences to keep - - *** Statistical options - -dbsize - Effective length of the database - -searchsp =0> - Effective length of the search space - - *** Search strategy options - -import_search_strategy - Search strategy to use - * Incompatible with: export_search_strategy - -export_search_strategy - File name to record the search strategy used - * Incompatible with: import_search_strategy - - *** Extension options - -xdrop_ungap - X-dropoff value (in bits) for ungapped extensions - -xdrop_gap - X-dropoff value (in bits) for preliminary gapped extensions - -xdrop_gap_final - X-dropoff value (in bits) for final gapped alignment - -window_size =0> - Multiple hits window size, use 0 to specify 1-hit algorithm - -gap_trigger - Number of bits to trigger gapping - Default = `22' - - *** Miscellaneous options - -parse_deflines - Should the query and subject defline(s) be parsed? - -num_threads =1> - Number of threads to use in the BLAST search - Default = `1' - * Incompatible with: remote - -remote - Execute search remotely? - * Incompatible with: gilist, negative_gilist, subject_loc, num_threads, - num_iterations - -use_sw_tback - Compute locally optimal Smith-Waterman alignments? - - *** PSI-BLAST options - -num_iterations =1> - Number of iterations to perform - Default = `1' - * Incompatible with: remote - -out_pssm - File name to store checkpoint file - -out_ascii_pssm - File name to store ASCII version of PSSM - -in_msa - File name of multiple sequence alignment to restart PSI-BLAST - * Incompatible with: in_pssm, query - -in_pssm - PSI-BLAST checkpoint file - * Incompatible with: in_msa, query, phi_pattern - - *** PSSM engine options - -pseudocount - Pseudo-count value used when constructing PSSM - Default = `0' - -inclusion_ethresh - E-value inclusion threshold for pairwise alignments - Default = `0.002' - - *** PHI-BLAST options - -phi_pattern - File name containing pattern to search - * Incompatible with: in_pssm diff --git a/engine/compbio/engine/cluster/drmaa/_DrmaaExample.java b/engine/compbio/engine/cluster/drmaa/_DrmaaExample.java deleted file mode 100644 index dbb312f..0000000 --- a/engine/compbio/engine/cluster/drmaa/_DrmaaExample.java +++ /dev/null @@ -1,152 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.engine.cluster.drmaa; - -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - -import org.ggf.drmaa.DrmCommunicationException; -import org.ggf.drmaa.DrmaaException; -import org.ggf.drmaa.JobInfo; -import org.ggf.drmaa.JobTemplate; -import org.ggf.drmaa.Session; -import org.ggf.drmaa.SessionFactory; - -class _DrmaaExample { - - private static int NBULKS = 3; - private static int JOB_CHUNK = 8; - private static Session session = null; - - public static void main(String[] args) throws Exception { - String jobPath = args[0]; - - SessionFactory factory = SessionFactory.getFactory(); - - session = factory.getSession(); - session.init(null); - - JobTemplate jt = createJobTemplate(jobPath, 5, true); - - List allJobIds = new LinkedList(); - List jobIds = null; - boolean retry = true; - - for (int count = 0; count < NBULKS; count++) { - do { - try { - jobIds = session.runBulkJobs(jt, 1, JOB_CHUNK, 1); - retry = false; - } catch (DrmCommunicationException e) { - System.err.println("runBulkJobs() failed - retry: " - + e.getMessage()); - - Thread.sleep(1000); - } - } while (retry); - - allJobIds.addAll(jobIds); - - System.out.println("submitted bulk job with jobids:"); - - Iterator i = jobIds.iterator(); - - while (i.hasNext()) { - System.out.println("\t \"" + i.next() + "\""); - } - } - - session.deleteJobTemplate(jt); - - /* submit some sequential jobs */ - jt = createJobTemplate(jobPath, 5, false); - - String jobId = null; - retry = true; - - for (int count = 0; count < JOB_CHUNK; count++) { - while (retry) { - try { - jobId = session.runJob(jt); - retry = false; - } catch (DrmCommunicationException e) { - System.err.println("runBulkJobs() failed - retry: " - + e.getMessage()); - - Thread.sleep(1000); - } - } - - System.out.println("\t \"" + jobId + "\""); - allJobIds.add(jobId); - } - - session.deleteJobTemplate(jt); - - /* synchronize with all jobs */ - session.synchronize(allJobIds, Session.TIMEOUT_WAIT_FOREVER, false); - System.out.println("synchronized with all jobs"); - - /* wait all those jobs */ - Iterator i = allJobIds.iterator(); - - while (i.hasNext()) { - JobInfo status = null; - jobId = (String) i.next(); - - status = session.wait(jobId, Session.TIMEOUT_WAIT_FOREVER); - - /* report how job finished */ - if (status.wasAborted()) { - System.out.println("job \"" + jobId + "\" never ran"); - } else if (status.hasExited()) { - System.out.println("job \"" + jobId - + "\" finished regularly with exit status " - + status.getExitStatus()); - } else if (status.hasSignaled()) { - System.out.println("job \"" + jobId - + "\" finished due to signal " - + status.getTerminatingSignal()); - } else { - System.out.println("job \"" + jobId - + "\" finished with unclear conditions"); - } - } - } - - private static JobTemplate createJobTemplate(String jobPath, int seconds, - boolean isBulkJob) throws DrmaaException { - JobTemplate jt = session.createJobTemplate(); - - jt.setWorkingDirectory("$drmaa_hd_ph$"); - jt.setRemoteCommand(jobPath); - jt.setArgs(Collections.singletonList(Integer.toString(seconds))); - jt.setJoinFiles(true); - - if (!isBulkJob) { - jt.setOutputPath(":$drmaa_hd_ph$/DRMAA_JOB"); - } else { - jt.setOutputPath(":$drmaa_hd_ph$/DRMAA_JOB$drmaa_incr_ph$"); - } - - return jt; - } - -} diff --git a/engine/compbio/engine/cluster/drmaa/_JobStatus.java b/engine/compbio/engine/cluster/drmaa/_JobStatus.java deleted file mode 100644 index 38b7410..0000000 --- a/engine/compbio/engine/cluster/drmaa/_JobStatus.java +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.engine.cluster.drmaa; - -import org.ggf.drmaa.DrmaaException; -import org.ggf.drmaa.Session; -import org.ggf.drmaa.SessionFactory; -import org.ggf.drmaa.Version; - -class _JobStatus { - - public static void main(String[] args) { - - SessionFactory factory = SessionFactory.getFactory(); - Session session = factory.getSession(); - - try { - System.out.println("Supported contact strings: \"" - + session.getContact() + "\""); - System.out.println("Supported DRM systems: \"" - + session.getDrmSystem() + "\""); - System.out.println("Supported DRMAA implementations: \"" - + session.getDrmaaImplementation() + "\""); - - session.init(""); - - System.out.println("Using contact strings: \"" - + session.getContact() + "\""); - System.out.println("Using DRM systems: \"" + session.getDrmSystem() - + "\""); - System.out.println("Using DRMAA implementations: \"" - + session.getDrmaaImplementation() + "\""); - - Version version = session.getVersion(); - - System.out.println("Using DRMAA version " + version.toString()); - - session.exit(); - } catch (DrmaaException e) { - System.out.println("Error: " + e.getMessage()); - } - - } -} diff --git a/engine/compbio/engine/cluster/dundee/_Queue.java b/engine/compbio/engine/cluster/dundee/_Queue.java deleted file mode 100644 index 3ee2e0a..0000000 --- a/engine/compbio/engine/cluster/dundee/_Queue.java +++ /dev/null @@ -1,152 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.engine.cluster.dundee; -import static compbio.engine.cluster.dundee._QueueConstraints.FIRST_MEMORY_LIMIT; -import static compbio.engine.cluster.dundee._QueueConstraints.LONG_TIME_LIMIT; -import static compbio.engine.cluster.dundee._QueueConstraints.MAX_MEMORY_LIMIT; -import static compbio.engine.cluster.dundee._QueueConstraints.SHORT_TIME_LIMIT; - -@Deprecated -public enum _Queue { - - /* - * devel.q 4Gb or 16Gb 8 hour I 64bit-pri.q 4Gb or 16Gb 24 hours B 64bit.q - * 4Gb or 16Gb None B bigint.q 32Gb 8 h I bigmem.q 32Gb None B - */ - - /** - * Order of the constraint reflect the priority of the queue - */ - DEVEL(FIRST_MEMORY_LIMIT, SHORT_TIME_LIMIT, "devel.q"), PRIBIT64( - FIRST_MEMORY_LIMIT, LONG_TIME_LIMIT, "64bit-pri.q"), BIT64( - FIRST_MEMORY_LIMIT, 0, "64bit.q"), BIGINT(MAX_MEMORY_LIMIT, - SHORT_TIME_LIMIT, "bigint.q"), BIGMEM(MAX_MEMORY_LIMIT, 0, - "bigmem.q"); - - int maxMemory; - int maxRuntime; - String qname; - private _Queue(int maxMemory, int maxRuntime, String qname) { - this.maxMemory = maxMemory; - this.maxRuntime = maxRuntime; - this.qname = qname; - } - - // -q 64bit.q -l qname=64bit.q -l h_vmem=8000M -l ram=8000M - @Override - public String toString() { - return qname; - } - - /** - * 0 - unlimited - * - * @return max runtime in hours - */ - public int getTimeLimit() { - return this.maxRuntime; - } - - /** - * - * @return true if the queue has time limit, false overwise - */ - public boolean hasTimeLimit() { - return this.maxRuntime != 0; - } - /** - * return max memory limit in Mb - * - * @return - */ - public int getMemoryLimit() { - return this.maxMemory; - } - - public static _Queue getQueueByMemoryRequirements(int maxMemory) { - if (maxMemory > FIRST_MEMORY_LIMIT) { - return BIGMEM; - } else if (maxMemory < MAX_MEMORY_LIMIT) - return BIT64; - else { - throw new UnsupportedOperationException( - "Cluster does not support tasks requiring more than 30000M of memory"); - } - } - - public static _Queue getQueue(int maxMemory, int timeLimitInHours) { - if (timeLimitInHours == 0) { - return getQueueByMemoryRequirements(maxMemory); - } else { - if (timeLimitInHours <= SHORT_TIME_LIMIT) { - if (maxMemory <= FIRST_MEMORY_LIMIT) { - return DEVEL; - } else if (maxMemory <= MAX_MEMORY_LIMIT) { - return BIGINT; - } else { - throw new UnsupportedOperationException( - "Cluster does not support tasks requiring more than 30000M of memory"); - } - } else { - // timeLimit > 8 - if (timeLimitInHours <= LONG_TIME_LIMIT - && maxMemory <= FIRST_MEMORY_LIMIT) { - return PRIBIT64; - } else if (maxMemory <= MAX_MEMORY_LIMIT) { - return BIGMEM; - } else { - throw new UnsupportedOperationException( - "Cluster does not support tasks requiring more than 30000M of memory"); - } - } - } - } - - public _Queue getQueue(String queueName) { - switch (this) { - case DEVEL : - if (queueName.equals(DEVEL.toString())) { - return DEVEL; - } - break; - case PRIBIT64 : - if (queueName.equals(PRIBIT64.toString())) { - return PRIBIT64; - } - break; - case BIT64 : - if (queueName.equals(BIT64.toString())) { - return BIT64; - } - break; - case BIGMEM : - if (queueName.equals(BIGMEM.toString())) { - return BIGMEM; - } - break; - case BIGINT : - if (queueName.equals(BIGINT.toString())) { - return BIGINT; - } - break; - } - // such queue appears to be not defined in the system! - return null; - } - -} diff --git a/engine/compbio/engine/cluster/dundee/_QueueConstraints.java b/engine/compbio/engine/cluster/dundee/_QueueConstraints.java deleted file mode 100644 index 637136f..0000000 --- a/engine/compbio/engine/cluster/dundee/_QueueConstraints.java +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.engine.cluster.dundee; - -@Deprecated -final class _QueueConstraints { - - private _QueueConstraints() { - } - - public static final int SHORT_TIME_LIMIT = 8; - public static final int LONG_TIME_LIMIT = 24; - public static final int FIRST_MEMORY_LIMIT = 14000; - public static final int MAX_MEMORY_LIMIT = 30000; - -} diff --git a/engine/compbio/engine/conf/_Key.java b/engine/compbio/engine/conf/_Key.java deleted file mode 100644 index a40abf3..0000000 --- a/engine/compbio/engine/conf/_Key.java +++ /dev/null @@ -1,121 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ - -package compbio.engine.conf; - -import javax.management.openmbean.InvalidKeyException; - -import compbio.util.Util; - -@Deprecated -public final class _Key { - - public final static String DELIM = "#"; - - private final String cname; - private final long id; - - public _Key(Class clazz) { - if (clazz == null) { - throw new IllegalArgumentException("Class or Id is NULL"); - } - this.cname = clazz.getSimpleName(); - this.id = getNonRepeatableNumber(); - } - - _Key(Class clazz, long id) { - if (clazz == null) { - throw new IllegalArgumentException("Class or Id is NULL"); - } - this.cname = clazz.getSimpleName(); - this.id = id; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - _Key ckey = null; - if (obj instanceof _Key) { - ckey = (_Key) obj; - } else { - return false; - } - if (ckey.cname.equals(this.cname) && id == ckey.id) { - return true; - } - return false; - } - - @Override - public String toString() { - return cname + DELIM + id; - } - - /* - * id = 533411011589881 - 15 or 16 chars depending on the OS - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return new Integer(cname.hashCode() - * new Integer(new Long(id).toString().substring(9))).intValue(); - } - - static long getNonRepeatableNumber() { - // Keep the random number 2 digits wide to simplify the task Id parsing - // if required - // The random value is concatenated with time value not added to it and - // then converted to long. - return Long.parseLong(Util.getRandomNumber(10, 99) + "" - + System.nanoTime()); - } - - public static _Key parse(String key) { - if (Util.isEmpty(key)) { - throw new NullPointerException("Key must be provided!"); - } - if (!key.contains(DELIM)) { - throw new InvalidKeyException("Key " + key - + " is not a valid task id"); - } - - int idx = key.indexOf(DELIM); - if (idx < 0) { - throw new InvalidKeyException("Key " + key - + " is not a valid task id"); - } - String runnerName = key.substring(0, idx); - long id = 0; - Class runner = null; - try { - runner = Class.forName(runnerName); - id = Long.parseLong(key.substring(idx + 1)); - } catch (NumberFormatException e) { - throw new InvalidKeyException("Key " + key - + " is not a valid task id"); - } catch (ClassNotFoundException e) { - throw new InvalidKeyException("Key " + key - + " is not a valid task id"); - } - return new _Key(runner, id); - } - -} diff --git a/engine/compbio/engine/local/_TrackingExecutor.java b/engine/compbio/engine/local/_TrackingExecutor.java deleted file mode 100644 index ac0f848..0000000 --- a/engine/compbio/engine/local/_TrackingExecutor.java +++ /dev/null @@ -1,123 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.engine.local; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.concurrent.AbstractExecutorService; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - -/** - * This executor extends standard Java ExecutorService by adding the method to - * obtain all Runnables which were running and did not complete upon executor - * termination. For this to work properly Runnables must propagate an - * Interruption exceptions, not swallow them, which a good Runnable should do - * anyway. - * - * TODO it may be better to persists task from different place - * - * @author pvtroshin - * @version 1.0 October 2009 - * @deprecated - */ -@Deprecated -class _TrackingExecutor extends AbstractExecutorService { - - private final ExecutorService executor; - - public _TrackingExecutor(ExecutorService executor) { - this.executor = executor; - } - - private final Set cancelledRunnableTasksAtShutdown = new HashSet(); - private final Set> cancelledCallableTasksAtShutdown = new HashSet>(); - - public List getCancelledTasks() { - if (!executor.isTerminated()) { - throw new IllegalStateException( - "Executor must be terminated before running this method!"); - } - ArrayList tasks = new ArrayList(cancelledCallableTasksAtShutdown); - tasks.addAll(cancelledRunnableTasksAtShutdown); - return tasks; - } - - @Override - public void execute(final Runnable runnable) { - executor.execute(new Runnable() { - @Override - public void run() { - try { - runnable.run(); - } finally { - if (isShutdown() && Thread.currentThread().isInterrupted()) { - cancelledRunnableTasksAtShutdown.add(runnable); - } - } - } - }); - } - - @Override - public Future submit(final Callable task) { - return executor.submit(new Callable() { - @Override - public T call() throws Exception { - try { - return task.call(); - } finally { - if (isShutdown() && Thread.currentThread().isInterrupted()) { - cancelledCallableTasksAtShutdown.add(task); - } - } - } - }); - } - - @Override - public boolean awaitTermination(long timeout, TimeUnit unit) - throws InterruptedException { - return executor.awaitTermination(timeout, unit); - } - - @Override - public boolean isShutdown() { - return executor.isShutdown(); - } - - @Override - public boolean isTerminated() { - return executor.isTerminated(); - } - - @Override - public void shutdown() { - executor.shutdown(); - } - - @Override - public List shutdownNow() { - return executor.shutdownNow(); - } - -} diff --git a/runner/compbio/data/_structure/JnetAnnotation.java b/runner/compbio/data/_structure/JnetAnnotation.java deleted file mode 100644 index 93f2861..0000000 --- a/runner/compbio/data/_structure/JnetAnnotation.java +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.data._structure; - -public enum JnetAnnotation { - - jnetpred("jnetpred", AType.ENUM), - - JNETCONF("", AType.ENUM), - - JNETSOL25("", AType.ENUM), - - JNETSOL5("", AType.ENUM), - - JNETSOL0("", AType.ENUM), - - JNETHMM("", AType.ENUM), - - JNETPROPH("", AType.ENUM), - - JNETPROPE("", AType.ENUM); - - String aName; - AType type; - - JnetAnnotation(String aName, AType type) { - - } - - static enum AType { - INTEGER, FLOAT, ENUM - } -} diff --git a/runner/compbio/data/_structure/JpredAnnotation.java b/runner/compbio/data/_structure/JpredAnnotation.java deleted file mode 100644 index e78ba27..0000000 --- a/runner/compbio/data/_structure/JpredAnnotation.java +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.data._structure; - - -public enum JpredAnnotation { - - jnetpred, - - JNETCONF, - - JNETSOL25, - - JNETSOL5, - - JNETSOL0, - - JNETHMM, - - JNETPROPH, - - JNETPROPE - -} diff --git a/runner/compbio/data/_structure/JpredResult.java b/runner/compbio/data/_structure/JpredResult.java deleted file mode 100644 index 07c2c49..0000000 --- a/runner/compbio/data/_structure/JpredResult.java +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.data._structure; - -import java.util.Map; - -/** - * Jnet result - * - * jnetpred:-,H,H,H,H,H,H,H,H,H,H,H,-,-,-,-,-,-,-,-,E,E,E,-,-,-,-,-,-,-,-,-,-,-, - * -,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,H,H,H,H,H,H,H,H,H,H - * ,H,H,-,-,H,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,H,H,H,H,H,-,-,-,-,H,H,H,H, - * -,-,-,-,-,-,-,-,-,-,-,-,H,H,H,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- - * , JNETCONF:7,3,7,9,9,9,9,9,9,9,7,5,2,6,6,3,6,7,5,1,0,5,3,3,6,4,6,6,7,7,7,7,7, - * 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,3,6,8,9,9,9,9,9,9,9 - * 7,3,7,7,6,2,4,4,1,5,7,8,7,7,7,7,7,7,7,6,5,3,5,6,6,6,4,0,0,2,1,3,5,7,7,7,7,7,7 - * , JNETSOL25:B,B,-,-,-,B,-,B,-,B,B,B,-,-,-,B,-,B,-,-,-,-,-,B,-,B,-,-,-,-,-,-, - * -,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,B,-,-,-,B,-,B,- - * , B,B,B,-,-,-,B,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,B,-,-,B,B,-,-,-,-,B,-,-,B,B,-,- - * ,B, - * JNETSOL5:-,-,-,-,-,-,B,-,-,-,-,-,-,-,-,-,B,B,B,B,-,-,-,B,-,-,-,-,-,-,-,-,- - * ,-,- - * JNETSOL0:-,-,-,-,-,-,B,-,-,B,-,B,-,-,-,-,-,-,-,-,B,-,-,-,-,-,-,-,-,-,-,-, - * -,-,- ,-,-,-,-,-,-,-,-,-,-,-,-,B,-,-,B,-,B,-,-, - * JNETHMM:-,H,H,H,H,H,H,H,H,H,H, - * H,-,-,-,-,-,-,-,-,E,E,E,-,-,-,-,-,-,-,-,-,-,-,-, - * -,-,-,-,-,-,-,-,-,-,-,-,-,-,- - * ,-,-,-,-,-,-,-,-,-,-,-,-,-,H,H,H,H,H,H,H,H,H,H,H, - * JNETPROPH:0.0110,0.1125,0.8552,0.0107 - * ,0.6245,0.3614,0.0120,0.8702,0.1238,0.0120 - * ,0.0193,0.9284,0.0708,0.0278,0.8703,0.1244 - * ,0.1591,0.7399,0.1456,0.2488,0.5824,0.1017, - * JNETPROPE:0.0107,0.6245,0.3614,0.0120 - * ,0.8702,0.1238,0.0120,0.9335,0.0656,0.0102 - * ,0.9586,0.0465,0.0094,0.9662,0.0433, - * ,0.1525,0.7103,0.1088,0.1181,0.7425,0.1784, - * - * - * @author pvtroshin - * - */ -public class JpredResult { - - Map annotations; - -} diff --git a/runner/compbio/pipeline/_jpred/BlastBlastComparator.java b/runner/compbio/pipeline/_jpred/BlastBlastComparator.java deleted file mode 100644 index bd28470..0000000 --- a/runner/compbio/pipeline/_jpred/BlastBlastComparator.java +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.pipeline._jpred; - -import java.io.FileNotFoundException; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.stream.XMLStreamException; - - -public class BlastBlastComparator { - - /** - * args[0] is assumed to be the name of a Blast output file - * - * @throws XMLStreamException - * @throws FileNotFoundException - */ - public static void main(String[] args) throws FileNotFoundException, - XMLStreamException { - BlastParser res1 = new BlastParser(args[0]); - BlastParser res2 = new BlastParser(args[1]); - assert res1.iters.size() == res2.iters.size(); - - for (Integer iterNum : res1.iters.keySet()) { - Set list = res1.iters.get(iterNum); - Set otherList = res2.iters.get(iterNum); - System.out.print("Iter " + iterNum + " arg0: " + list.size()); - System.out.println(" arg1: " + otherList.size()); - BlastParser.printNames(getDiff(list, otherList)); - // System.out.println("Diffs: " + getDiff(list, otherList)); - // System.out.println("Diffs: " + getDiff(otherList, list)); - - } - - } - - static Set getDiff(Set list, Set otherList) { - Set diff = new HashSet(); - for (Hit pseq : list) { - if (otherList.contains(pseq)) { - continue; - } - diff.add(pseq); - } - return diff; - } - -} diff --git a/runner/compbio/pipeline/_jpred/BlastHmmerComparator.java b/runner/compbio/pipeline/_jpred/BlastHmmerComparator.java deleted file mode 100644 index 28c64d4..0000000 --- a/runner/compbio/pipeline/_jpred/BlastHmmerComparator.java +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.pipeline._jpred; - -import java.io.IOException; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.stream.XMLStreamException; - -public class BlastHmmerComparator { - - /** - * args[0] is assumed to be the name of a Blast output file - * - * @throws XMLStreamException - * @throws IOException - */ - public static void main(String[] args) throws XMLStreamException, - IOException { - BlastParser res1 = new BlastParser(args[0]); - JackHmmerHitParser res2 = new JackHmmerHitParser(args[1]); - Set list = res1.iters.get(3); - Set otherList = res2.hits; - System.out.print("Iter " + 3 + " arg0: " + list.size()); - System.out.println(" arg1: " + otherList.size()); - BlastParser.printNames(getDiff(list, otherList)); - BlastParser.printNames(getDiff(otherList, list)); - // System.out.println("Diffs: " + getDiff(list, otherList)); - // System.out.println("Diffs: " + getDiff(otherList, list)); - - } - - static Set getDiff(Set list, Set otherList) { - Set diff = new HashSet(); - for (Hit pseq : list) { - if (otherList.contains(pseq)) { - continue; - } - diff.add(pseq); - } - return diff; - } - -} diff --git a/runner/compbio/pipeline/_jpred/BlastParser.java b/runner/compbio/pipeline/_jpred/BlastParser.java deleted file mode 100644 index 45f0244..0000000 --- a/runner/compbio/pipeline/_jpred/BlastParser.java +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.pipeline._jpred; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -public class BlastParser { - - Map> iters; - - public BlastParser(String file) throws FileNotFoundException, - XMLStreamException { - XMLInputFactory f = XMLInputFactory.newInstance(); - XMLStreamReader r = f.createXMLStreamReader(new BufferedInputStream( - new FileInputStream(new File(file)))); - Set pl = new HashSet(); - Hit psi = null; - this.iters = new HashMap>(); - Integer iternum = null; - while (r.hasNext()) { - int idx = r.next(); - if (r.isStartElement()) { - String name = r.getLocalName(); - if (name.equals("Iteration_iter-num")) { - iternum = Integer.parseInt(r.getElementText().trim()); - System.out.println("Iter " + iternum); - } - if (name.equals("Hit")) { - psi = new Hit(); - } - if (name.equals("Hit_num")) { - psi.number = r.getElementText(); - } - if (name.equals("Hit_accession")) { - psi.accession = r.getElementText(); - // System.out.println(psi.id); - } - if (name.equals("Hit_def")) { - // System.out.println(r.getElementText()); - psi.name = r.getElementText().split("\\s+")[0].trim(); - // System.out.println(psi.id); - } - if (name.equals("Hsp_hseq")) { - psi.seq = r.getElementText(); - // System.out.println(psi.seq); - } - if (name.equals("Hsp_evalue")) { - psi.evalue = r.getElementText(); - // System.out.println(psi.seq); - } - - } - - if (r.isEndElement()) { - String name = r.getLocalName(); - if (name.equals("Hit")) { - boolean replaced = pl.add(psi); - assert replaced : "Expect unique elements only!"; - psi = null; - } - if (name.equals("Iteration")) { - iters.put(iternum, pl); - pl = new HashSet(); - } - } - } - - } - - /** - * args[0] is assumed to be the name of a Blast output file - * - * @throws XMLStreamException - * @throws FileNotFoundException - */ - public static void main(String[] args) throws FileNotFoundException, - XMLStreamException { - BlastParser parser = new BlastParser(args[0]); - printHits(parser.iters); - } - - static final void printHits(Map> iterNumPsiSeqs) { - for (Integer iterNum : iterNumPsiSeqs.keySet()) { - System.out.println("Iteration " + iterNum); - printHits(iterNumPsiSeqs.get(iterNum)); - } - } - - static final void printHits(Collection psiseqs) { - assert psiseqs != null; - System.out.println("Total hits: " + psiseqs.size()); - for (Hit pseq : psiseqs) { - System.out.println("Hit: " + pseq.number + " Accession: " - + pseq.accession + " name " + pseq.name); - } - } - - static final void printNames(Collection psiseqs) { - assert psiseqs != null; - System.out.println("Total hits: " + psiseqs.size()); - for (Hit pseq : psiseqs) { - System.out.print(pseq.number + " "); - System.out.println(pseq.name); - } - } - -} diff --git a/runner/compbio/pipeline/_jpred/Hit.java b/runner/compbio/pipeline/_jpred/Hit.java deleted file mode 100644 index 5de8e2c..0000000 --- a/runner/compbio/pipeline/_jpred/Hit.java +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.pipeline._jpred; - -import java.util.Comparator; - -public class Hit { - String name; - String number; - String accession; - String seq; - String evalue; - - @Override - public String toString() { - return "accession=" + accession + ", name=" + name + ", num=" + number - + ", evalue=" + evalue + "\n"; // + ", seq=" + seq + - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((name == null) ? 0 : name.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - Hit other = (Hit) obj; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - return true; - } - - public static final class NumberComporator implements Comparator { - @Override - public int compare(Hit o1, Hit o2) { - return Integer.valueOf(o1.number).compareTo( - Integer.valueOf(o2.number)); - } - } - - public static final class EvalueComporator implements Comparator { - @Override - public int compare(Hit o1, Hit o2) { - return Double.valueOf(o1.evalue).compareTo( - Double.valueOf(o2.evalue)); - } - } -} \ No newline at end of file diff --git a/runner/compbio/pipeline/_jpred/JackHmmerHitParser.java b/runner/compbio/pipeline/_jpred/JackHmmerHitParser.java deleted file mode 100644 index 771f3f4..0000000 --- a/runner/compbio/pipeline/_jpred/JackHmmerHitParser.java +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.pipeline._jpred; - -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Scanner; -import java.util.Set; - -/** - * Parser for the following files: - * - * @author pvtroshin - * - */ -public class JackHmmerHitParser { - //# --- full sequence ---- --- best 1 domain ---- --- domain number estimation ---- - //# target name accession query name accession E-value score bias E-value score bias exp reg clu ov env dom rep inc description of target - //# ------------------- ---------- -------------------- ---------- --------- ------ ----- --------- ------ ----- --- --- --- --- --- --- --- --- --------------------- - //tr|Q6TVU2|Q6TVU2_ORFV - gi_74230740_gb_ABA00545.1 - 4.5e-271 910.4 0.0 5.1e-271 910.2 0.0 1.0 1 0 0 1 1 1 1 Putative uncharacterized protein OS=Orf virus PE=4 SV=1 - - Set hits; - - public JackHmmerHitParser(String file) throws IOException { - - BufferedReader bfr = new BufferedReader(new InputStreamReader( - new FileInputStream(file), "ISO-8859-1"), 64000); - // throw away first three lines; - this.hits = new HashSet(); - String line = bfr.readLine(); - bfr.readLine(); - bfr.readLine(); - int hitc = 0; - while ((line = bfr.readLine()) != null) { - hitc++; - Scanner scan = new Scanner(line); - scan.useDelimiter("\\s+"); - extractData(scan, hitc); - } - List lhits = new ArrayList(hits); - Collections.sort(lhits, new Hit.NumberComporator()); - } - - void extractData(Scanner scan, int hitcounter) { - Hit pseq = new Hit(); - - String tname = scan.next(); - pseq.name = tname; - //System.out.println(tname); - - String tacc = scan.next(); - pseq.accession = tacc; - //System.out.println(tacc); - String qname = scan.next(); - //System.out.println(qname); - String qacc = scan.next(); - //System.out.println(qacc); - - Double evalue = scan.nextDouble(); - //System.out.println(evalue); - pseq.evalue = evalue.toString(); - - Double score = scan.nextDouble(); - //System.out.println(score); - pseq.evalue = evalue.toString(); - pseq.number = new Integer(hitcounter).toString(); - boolean unique = hits.add(pseq); - assert unique : "Unique hits are expected!"; - } - - public static void main(String[] args) throws IOException { - assert args[0] != null; - JackHmmerHitParser parser = new JackHmmerHitParser(args[0]); - BlastParser.printHits(parser.hits); - } -} diff --git a/runner/compbio/pipeline/_jpred/Jpred4.java b/runner/compbio/pipeline/_jpred/Jpred4.java deleted file mode 100644 index ebb5f09..0000000 --- a/runner/compbio/pipeline/_jpred/Jpred4.java +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.pipeline._jpred; - -import java.util.List; - -import compbio.data.sequence.FastaSequence; - -/** - * - * jpred --sequence OR --alignment [--db - * ] [--pred-nohits] [--logLevel=(ERROR|INFO|DEBUG)] [--help] - * - * jpred4 --sequence The path to the sequence (in FASTA format) you - * want to predict OR - * - * [--alignment ] The alignment which to use for prediction - * - * [--profile=] - * - * [--db ] Database to use for PSI-BLAST querying. Default: uniref90 ( - * /homes/www-jpred/databases/uniref90.filt) Please note that database must be - * psi-blast indexed - * - * [--pred-nohits] Toggle allowing Jpred to make predictions even when there are - * no PSI-BLAST hits. - * - * [--logLevel=(ERROR|INFO|DEBUG)] one of ERROR, INFO, DEBUG [--help] - * - * - * @author pvtroshin - * - */ -public class Jpred4 { - - List readFastaSequence() { - return null; - } - - public void runPsiBlast() { - }; - -} diff --git a/runner/compbio/pipeline/_jpred/PScore.java b/runner/compbio/pipeline/_jpred/PScore.java deleted file mode 100644 index b752a17..0000000 --- a/runner/compbio/pipeline/_jpred/PScore.java +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.pipeline._jpred; - -public class PScore { - - String name; - String otherName; - double score; - - - @Override - public boolean equals(Object obj) { - if(obj==null) { - return false; - } - if(!(obj instanceof PScore)) { - return false; - } - PScore pscore = (PScore)obj; - if(Double.compare(score, pscore.score)!=0) { - return false; - } - if(!this.name.equalsIgnoreCase(pscore.name)) { - return false; - } - if(!this.otherName.equalsIgnoreCase(pscore.otherName)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return new Double((name.hashCode() * otherName.hashCode()*45)/score).intValue(); - } - - @Override - public String toString() { - String value = "Name: " + name + "\n"; - value += "OtherName: " + otherName+ "\n"; - value += "Score: " + score+ "\n"; - return value; - } -} diff --git a/runner/compbio/pipeline/_jpred/Pairwise.java b/runner/compbio/pipeline/_jpred/Pairwise.java deleted file mode 100644 index 517f361..0000000 --- a/runner/compbio/pipeline/_jpred/Pairwise.java +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.pipeline._jpred; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import compbio.data.sequence.FastaSequence; -import compbio.data.sequence.SequenceUtil; - -public class Pairwise { - - private final List sequences; - final Set pscores; - - public Pairwise(List sequences) { - this.sequences = sequences; - pscores = new HashSet(); - } - - void compare() { - for (int i = 0; i < sequences.size(); i++) { - FastaSequence seq1 = sequences.get(i); - System.out.println(seq1.getId()); - for (int j = i+1; j < sequences.size(); j++) { - FastaSequence seq2 = sequences.get(j); - PScore pscore = new PScore(); - pscore.name = seq1.getId(); - pscore.otherName = seq2.getId(); - pscores.add(pscore); - compare(pscore, seq1.getSequence(), seq2.getSequence()); - } - } - } - - void compare(PScore pscore, String seq1, String seq2) { - char[] chars1 = seq1.trim().toUpperCase().toCharArray(); - char[] chars2 = seq2.trim().toUpperCase().toCharArray(); - if(chars1.length != chars2.length) { - throw new IllegalArgumentException("Different lenght sequence are provided but same expected! \n Sequence 1: \n" + pscore.name+ - "\n Length:"+chars1.length +"\n "+ - "Sequence 2: \n " + pscore.otherName + - " \n Lenght: " + chars2.length ); - } - compare(pscore, chars1, chars2); - } - - void compare(PScore pscore, char[] seq1, char[] seq2) { - int sameResedue = 0; - for (int i = 0; i < seq1.length; i++) { - if(seq1[i]==seq2[i]) { - sameResedue++; - } - } - pscore.score = (double)sameResedue /seq1.length; - System.out.println(pscore.score*100); - } - - public static final void main(String[] args) throws FileNotFoundException, IOException { - File in = new File(args[0]); - List fslist = SequenceUtil.readFasta(new BufferedInputStream(new FileInputStream(in))); - Pairwise pair = new Pairwise(fslist); - pair.compare(); - System.out.println(pair.pscores); - } -} diff --git a/runner/compbio/pipeline/_jpred/Requirements b/runner/compbio/pipeline/_jpred/Requirements deleted file mode 100644 index e41c82f..0000000 --- a/runner/compbio/pipeline/_jpred/Requirements +++ /dev/null @@ -1,13 +0,0 @@ -Requirements: -1) Various inputs - sequence, alignment, use alignment on first step only and feed it to psi blast -or build a profile immediately. -2) Run standalone - - on the cluster - - in parallel - - as a part of web services -3) Provide low-memory option -4) Various log levels -5) Configuration is externalised - - - \ No newline at end of file diff --git a/runner/compbio/pipeline/_jpred/jpred.prop b/runner/compbio/pipeline/_jpred/jpred.prop deleted file mode 100644 index 23ed76d..0000000 --- a/runner/compbio/pipeline/_jpred/jpred.prop +++ /dev/null @@ -1,9 +0,0 @@ -## potentially a better set of parameters (esp. -b & -v) -## which avoid PSI-BLAST dying with large number of hits - -# 'soft' filtering of the query sequence -psiblast.prms.set1=-e0.05 -h0.01 -m6 -b10000 -v10000 -j3 -F "m S" - -# stricter searching criteria -psiblast.prms.set2=-e0.001 -h0.0001 -m6 -b10000 -v10000 -j3 -psiblast.prms.set3=-e0.05 -h0.01 -m6 -b10000 -v10000 -j3 \ No newline at end of file diff --git a/runner/compbio/runner/_NativeSpecHelper.java b/runner/compbio/runner/_NativeSpecHelper.java deleted file mode 100644 index 57ec660..0000000 --- a/runner/compbio/runner/_NativeSpecHelper.java +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner; - -import java.net.UnknownServiceException; - -import compbio.engine.cluster.dundee._Queue; - -@Deprecated -public class _NativeSpecHelper { - - int maxCalculationTime; - int requiredMemory; - String queue; - - public _NativeSpecHelper(int requiredMemory) { - this(requiredMemory, 0); - } - - public _NativeSpecHelper(int requiredMemory, int maxCalculationTime) { - this.requiredMemory = requiredMemory; - this.maxCalculationTime = maxCalculationTime; - } - - public void setRequiredMemory(int memory) { - this.requiredMemory = memory; - } - - int getRequiredMemory() { - return requiredMemory; - } - - public void setQueue(String queue) { - this.queue = queue; - } - - public String getQueue() { - return queue; - } - - // -q 64bit.q -l qname=64bit.q -l h_vmem=8000M -l ram=8000M - public String getNativeSpec() throws UnknownServiceException { - if (queue == null) { - queue = getApproprieteQueue().toString(); - } else { - // check whether chosen queue suits for memory and runtime settings - _Queue knownQueue = _Queue.BIGINT.getQueue(queue); - if (knownQueue == null) { - throw new UnknownServiceException("Queue " + queue - + " is not regestered in the system! "); - } - if (this.requiredMemory <= knownQueue.getMemoryLimit()) { - throw new UnknownServiceException("Queue " + queue - + " has a memory limit of " - + knownQueue.getMemoryLimit() - + "M - which is smaller than requested!"); - } - if (knownQueue.hasTimeLimit() - && this.maxCalculationTime <= knownQueue.getTimeLimit()) { - throw new UnknownServiceException("Queue " + queue - + " has a time limit of " + knownQueue.getTimeLimit() - + "hours - which is smaller than requested!"); - } - } - return "-q " + queue.toString() + "-l qname=" + queue.toString() - + ", h_vmem=" + requiredMemory + "M,ram=" + requiredMemory - + "M"; - } - - public _Queue getApproprieteQueue() { - return _Queue.getQueue(requiredMemory, maxCalculationTime); - } - -} diff --git a/runner/compbio/runner/_SkeletalCommandBuilder.java b/runner/compbio/runner/_SkeletalCommandBuilder.java deleted file mode 100644 index 3767ffb..0000000 --- a/runner/compbio/runner/_SkeletalCommandBuilder.java +++ /dev/null @@ -1,121 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import compbio.engine.client.CommandBuilder; -import compbio.engine.client.Executable; -import compbio.engine.client.RunConfiguration; -import compbio.metadata.Limit; -import compbio.metadata.LimitsManager; - -@Deprecated -public abstract class _SkeletalCommandBuilder - implements - Executable<_SkeletalCommandBuilder> { - - String tmpDirectory; - String name; - String email; - List params = new ArrayList(); - - public _SkeletalCommandBuilder setEmail(String email) { - this.email = email; - return this; - } - - public _SkeletalCommandBuilder setName(String name) { - this.name = name; - return this; - } - - public String getName() { - return name; - } - - public String getEmail() { - return email; - } - - public _SkeletalCommandBuilder addParameters(String[] parameters) { - this.params.addAll(Arrays.asList(parameters)); - return this; - } - - public _SkeletalCommandBuilder addParameters(List parameters) { - this.params.addAll(parameters); - return this; - } - - @Override - public CommandBuilder<_SkeletalCommandBuilder> getParameters( - ExecProvider provider) { - return null; - } - - public _SkeletalCommandBuilder addParameter(String parameter) { - params.add(parameter); - return this; - } - - @Override - public V getResults(String directory) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Executable loadRunConfiguration(RunConfiguration rconfig) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getOutput() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getError() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Limit<_SkeletalCommandBuilder> getLimit(String presetName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public LimitsManager<_SkeletalCommandBuilder> getLimits() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getClusterJobSettings() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/runner/compbio/runner/_impl/BlastAll.java b/runner/compbio/runner/_impl/BlastAll.java deleted file mode 100644 index 36a306f..0000000 --- a/runner/compbio/runner/_impl/BlastAll.java +++ /dev/null @@ -1,118 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import static compbio.runner._impl.BlastParameters.parAlView; -import static compbio.runner._impl.BlastParameters.parDatabase; -import static compbio.runner._impl.BlastParameters.parDel; -import static compbio.runner._impl.BlastParameters.parEvalue; -import static compbio.runner._impl.BlastParameters.parInput; -import static compbio.runner._impl.BlastParameters.parOutput; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import compbio.runner._SkeletalCommandBuilder; - -public class BlastAll extends _SkeletalCommandBuilder { - - static final String command = "blastall"; - - enum blastType { - blastp, tbastn, blastn - } - - enum dataBase { - pdb - } - - static double default_evalue = 0.001d; - static final String parBlastType = "-p"; - - private final String workDirectory; - - public BlastAll(String workDirectory) { - this.workDirectory = workDirectory; - } - - // Resulting command: - // /fc_gpfs/gjb_lab/www-refine/bin/blast_32bit/blast-2.2.17/bin/blastall -p - // blastp -i $input -d $dbnam -e $evalue -m 9 -o $outfile - - String getCommand(blastType btype, dataBase database, String input, - String output) { - return Environment.getBlastBinDir() + command + parDel + parBlastType - + blastType.blastp + parDel + parInput + input + parDel - + parDatabase + Environment.getBlastDatabasesDir() + database - + parDel + parEvalue + default_evalue + parAlView + parOutput - + output; - } - - String getFullTestCommand(String test_input, String test_outfile) { - return Environment.getBlastBinDir() + command + parDel + parBlastType - + blastType.blastp + parDel + parInput + test_input + parDel - + parDatabase + Environment.getBlastDatabasesDir() - + dataBase.pdb + parDel + parEvalue + default_evalue - + parAlView + parOutput + test_outfile; - } - - static String getTestCommand() { - return Environment.getBlastBinDir() + command; - } - - static List getTestArgs() { - return Arrays - .asList(new String[]{ - parBlastType + blastType.blastp, - parDatabase + Environment.getBlastDatabasesDir() - + dataBase.pdb, parEvalue + default_evalue, - parAlView}); - } - - public boolean removeOutput(String outfile) { - File out = new File(outfile); - if (out.exists()) { - if (out.canWrite()) { - return out.delete(); - } - } - return false; - } - - public String getCommand(ExecProvider provider) { - return Environment.getBlastBinDir() + command; - } - - public String getCommandName() { - return command; - } - - @Override - public List getCreatedFiles() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getInput() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/runner/compbio/runner/_impl/BlastParameters.java b/runner/compbio/runner/_impl/BlastParameters.java deleted file mode 100644 index 7c1179f..0000000 --- a/runner/compbio/runner/_impl/BlastParameters.java +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -/** - * Utility class for common Blast parameters - * - * @author pvtroshin TODO - */ -public class BlastParameters { - - private BlastParameters() { - } // prevent instantiation - - static String outputName = "output.blast"; - static String outputProfileName = "output.profile"; - static final String parInput = "-i"; - static final String parDatabase = "-d "; - static final String parOutput = "-o"; - static final String parEvalue = "-e"; - final static String parDel = " "; - static final String parAlView = "-m 9"; - -} diff --git a/runner/compbio/runner/_impl/Environment.java b/runner/compbio/runner/_impl/Environment.java deleted file mode 100644 index c27b518..0000000 --- a/runner/compbio/runner/_impl/Environment.java +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -/** - * This is utility class to encapsulate environmental variables like directory paths - * @author pvtroshin - */ -public final class Environment { - - private Environment() { } // prevent instantiation - - public static String getBlastBinDir() { - return "/fc_gpfs/gjb_lab/www-refine/bin/blast_32bit/blast-2.2.17/bin/"; - } - - public static final String getBlastDatabasesDir() { - return "/db/blastdb/"; - } - public static final String getRPSBlastDatabasesDir() { - return "/db/CDD/"; - } -} diff --git a/runner/compbio/runner/_impl/Mcl.java b/runner/compbio/runner/_impl/Mcl.java deleted file mode 100644 index bb00190..0000000 --- a/runner/compbio/runner/_impl/Mcl.java +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import java.util.Arrays; -import java.util.List; - -import compbio.runner._SkeletalCommandBuilder; - -/* - @see - RONN does not accept stdin the file name must be defined as parameter - It accepts only clear sequence, no FASTA header! - It can only analyse ONE sequence per run! (or may be not, but the results gets overriden!) - - */ -public class Mcl extends _SkeletalCommandBuilder { - - private static final String command = "/homes/pvtroshin/soft/MclRunner.sh"; - // -q bigmem.q -l qname=bigmem.q,ram=8000M,h_vmem=8000M - private static final String nativeSpec = " -q 64bit.q -l qname=64bit.q -l h_vmem=8000M -l ram=8000M"; - // Read from stdin and write to stdout - private static final List params = Arrays - .asList(new String[] { "" }); // "-","--abc", "-o -" - - private final String workDirectory; - - public Mcl(String workDirectory) { - this.workDirectory = workDirectory; - } - - public static List getTestParams() { - return params; - } - - public String getCommand(ExecProvider provider) { - return command; - } - - public static String getTestCommand() { - return command; - } - - public String getCommandName() { - return "MCL"; - } - - @Override - public List getCreatedFiles() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getInput() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/runner/compbio/runner/_impl/NetNglyc.java b/runner/compbio/runner/_impl/NetNglyc.java deleted file mode 100644 index cb3729d..0000000 --- a/runner/compbio/runner/_impl/NetNglyc.java +++ /dev/null @@ -1,117 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import java.util.Arrays; -import java.util.List; - -import compbio.engine.client.CommandBuilder; -import compbio.engine.client.Executable; -import compbio.engine.client.RunConfiguration; -import compbio.metadata.Limit; -import compbio.metadata.LimitsManager; - -/* - @see http://www.cbs.dtu.dk/cgi-bin/nph-runsafe?man=netNglyc - */ -public class NetNglyc implements Executable { - - private static final String command = "/homes/www-refine/bin/Brunak/NOBACK/netNglyc-1.0a/netNglyc"; - - List params; - - public NetNglyc() { - } - - @Override - public CommandBuilder getParameters(ExecProvider provider) { - return null; // Arrays.asList(new String[] { "-a", "-f" }); // "-g" - // potentially - } - - public static List getTestArgs() { - return Arrays.asList(new String[] { "-a", "-f" }); - } - - @Override - public NetNglyc addParameters(List parameters) { - this.params = parameters; - return this; - } - - public static String getTestCommand() { - return command; - } - - public String getCommandName() { - return "netNglyc"; - } - - @Override - public List getCreatedFiles() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getInput() { - // TODO Auto-generated method stub - return null; - } - - @Override - public V getResults(String directory) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Executable loadRunConfiguration(RunConfiguration rconfig) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getOutput() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getError() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Limit getLimit(String presetName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public LimitsManager getLimits() { - // TODO Auto-generated method stub - return null; - } - @Override - public String getClusterJobSettings() { - // TODO Auto-generated method stub - return null; - } -} diff --git a/runner/compbio/runner/_impl/OB.java b/runner/compbio/runner/_impl/OB.java deleted file mode 100644 index 8d89fea..0000000 --- a/runner/compbio/runner/_impl/OB.java +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import java.util.Arrays; -import java.util.List; - -import compbio.runner._SkeletalCommandBuilder; - -/** - * TODO this needs fixing! Executable does not work - * - * @author pvtroshin - * - */ -public class OB extends _SkeletalCommandBuilder { - - // $obdir/OB.pl -i $fa -p $obdir/databases/GES_hydrophobicity.dat -m - // $obdir/databases/GES_zmat2.dat -n -o $outdir/OB.dat" - // where $obdir= /homes/www-refine/SSPF_TO1/TarO_newclus/ - private static final String commandName = "OB"; - private static final String command = "/homes/www-refine/SSPF_TO1/TarO_newclus/OB_runner.sh"; - - String workDirectory; - - public OB() { - // TODO Auto-generated constructor stub - } - - public OB(String workDirectory) { - this.workDirectory = workDirectory; - } - - public static String getTestCommand() { - return command; - } - - // input -i $fa - // output -o - public List getTestArgs() { - return Arrays.asList(new String[] { "" }); - } - - public static void main(String[] args) { - new OB(); - } - - @Override - public List getCreatedFiles() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getInput() { - // TODO Auto-generated method stub - return null; - } -} diff --git a/runner/compbio/runner/_impl/PSIBlast.java b/runner/compbio/runner/_impl/PSIBlast.java deleted file mode 100644 index 9ef3bf7..0000000 --- a/runner/compbio/runner/_impl/PSIBlast.java +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import static compbio.runner._impl.BlastParameters.parAlView; -import static compbio.runner._impl.BlastParameters.parDatabase; -import static compbio.runner._impl.BlastParameters.parDel; -import static compbio.runner._impl.BlastParameters.parEvalue; -import static compbio.runner._impl.BlastParameters.parInput; -import static compbio.runner._impl.BlastParameters.parOutput; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import compbio.runner._SkeletalCommandBuilder; - -/* - * TODO look at how a command can be build with an argument list - */ -public class PSIBlast extends _SkeletalCommandBuilder { - - private static final String command = "blastpgp"; - - enum blastType { - blastp, tbastn, blastn - } - - enum dataBase { - pdb - } - - static double default_evalue = 0.001d; - static final String parBlastType = "-p"; - - private final String workDirectory; - - public PSIBlast(String workDirectory) { - this.workDirectory = workDirectory; - } - - // Resulting command: - // TODO lease note that the location seem to be different for 64 bit nodes - // fc_gpfs/gjb_lab/www-refine/bin/blast_32bit/blast-2.2.17/bin/blastpgp -i - // $input -d $dbnam -o $output_dir/$outfile.psiblastout.$clus -j $iterations - // -Q $output_dir/$outfile.PSImatrix.$clus -m $mo - - // BlastAll - // //fc_gpfs/gjb_lab/www-refine/bin/blast_32bit/blast-2.2.17/bin/blastall -p - // blastp -i $input -d $dbnam -e $evalue -m 9 -o $outfile - - String getCommand(blastType btype, dataBase database, String input, - String output) { - return Environment.getBlastBinDir() + command + parDel + parBlastType - + blastType.blastp + parDel + parInput + input + parDel - + parDatabase + Environment.getBlastDatabasesDir() + database - + parDel + parEvalue + default_evalue + parAlView + parOutput - + output; - } - - String getFullTestCommand(String test_input, String test_outfile) { - return Environment.getBlastBinDir() + command + parDel + parBlastType - + blastType.blastp + parDel + parInput + test_input + parDel - + parDatabase + Environment.getBlastDatabasesDir() - + dataBase.pdb + parDel + parEvalue + default_evalue - + parAlView + parOutput + test_outfile; - } - - static String getTestCommand() { - return Environment.getBlastBinDir() + command; - } - - static List getTestArgs() { - return Arrays - .asList(new String[] { - parBlastType + blastType.blastp, - parDatabase + Environment.getBlastDatabasesDir() - + dataBase.pdb, parEvalue + default_evalue, - parAlView }); - } - - public boolean removeOutput(String outfile) { - File out = new File(outfile); - if (out.exists()) { - if (out.canWrite()) { - return out.delete(); - } - } - return false; - } - - public String getCommand(ExecProvider provider) { - return Environment.getBlastBinDir() + command; - } - - public String getCommandName() { - return command; - } - - @Override - public List getCreatedFiles() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getInput() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/runner/compbio/runner/_impl/RPSBlast.java b/runner/compbio/runner/_impl/RPSBlast.java deleted file mode 100644 index 837e4b3..0000000 --- a/runner/compbio/runner/_impl/RPSBlast.java +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import static compbio.runner._impl.BlastParameters.parAlView; -import static compbio.runner._impl.BlastParameters.parDatabase; - -import java.util.Arrays; -import java.util.List; - -import compbio.runner._SkeletalCommandBuilder; - -public class RPSBlast extends _SkeletalCommandBuilder { - - enum DB { - Pfam, Cdd, Cog, Smart, Kog, Tirg - } - - private static final String command = Environment.getBlastBinDir() - + getCommandName(); - - private final String workDirectory; - - public RPSBlast(String workDirectory) { - this.workDirectory = workDirectory; - } - - // my $blast = - // "$blast_dir/rpsblast -i $input -d $dblocat/$dbnam -m 9 -a 1 -o $output_dir/$outfile.rpsblastout"; - // Could be static, but interface declaration requires to be overriden - public String getCommand(ExecProvider provider) { - return command; - } - - public static String getTestCommand() { - return command; - } - - public static String getCommandName() { - return "rpsblast"; - } - - static List getTestArgs() { - return Arrays.asList(new String[] { - parDatabase + Environment.getRPSBlastDatabasesDir() + DB.Smart, - parAlView }); - } - - String getDefaultEvalue() { - return "1e-6"; - } - - @Override - public List getCreatedFiles() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getInput() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/runner/compbio/runner/_impl/Ronn.java b/runner/compbio/runner/_impl/Ronn.java deleted file mode 100644 index 8d8720d..0000000 --- a/runner/compbio/runner/_impl/Ronn.java +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import java.util.List; - -import compbio.runner._SkeletalCommandBuilder; - -/* - @see - RONN does not accept stdin the file name must be defined as parameter - It accepts only clear sequence, no FASTA header! - It can only analyse ONE sequence per run! (or may be not, but the results gets overriden!) - - */ -public class Ronn extends _SkeletalCommandBuilder { - - private static final String command = "/homes/pvtroshin/soft/RONNv3_fasta/Ronn_runner.sh"; - - public String getCommand(ExecProvider provider) { - return command; - } - - public static String getTestCommand() { - return command; - } - - public String getCommandName() { - return "Ronn"; - } - - private final String workDirectory; - - public Ronn(String workDirectory) { - this.workDirectory = workDirectory; - } - - @Override - public List getCreatedFiles() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getInput() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/runner/compbio/runner/_impl/Runners.java b/runner/compbio/runner/_impl/Runners.java deleted file mode 100644 index de61e02..0000000 --- a/runner/compbio/runner/_impl/Runners.java +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -public final class Runners { - - private Runners() { - } - - public static Mcl getMclRunnable(String workDirectory) { - return new Mcl(workDirectory); - } - - public static OB getOBRunnable(String workDirectory) { - return new OB(workDirectory); - } - - public static NetNglyc getNetNglycRunnable(String workDirectory) { - return new NetNglyc(); - } - - public static Ronn getRonnRunnable(String workDirectory) { - return new Ronn(workDirectory); - } - - public static Tmhmm2 getTmhmm2Runnable(String workDirectory) { - return new Tmhmm2(workDirectory); - } - - public static RPSBlast getRPSBlastRunnable(String workDirectory) { - return new RPSBlast(workDirectory); - } - - public static BlastAll getBlastAllRunnable(String workDirectory) { - return new BlastAll(workDirectory); - } - - public static PSIBlast getPSIBlastRunnable(String workDirectory) { - return new PSIBlast(workDirectory); - } - -} diff --git a/runner/compbio/runner/_impl/Tmhmm2.java b/runner/compbio/runner/_impl/Tmhmm2.java deleted file mode 100644 index 2fce62f..0000000 --- a/runner/compbio/runner/_impl/Tmhmm2.java +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import java.util.List; - -import compbio.runner._SkeletalCommandBuilder; - -/* - @see file:///(/homes/www-refine/SSPF_01/) Z:/bin/Brunak/TMHMM2/TMHMM2.0c/TMHMM2.0.html - could have used decodeanhmm directly - for more options @see ./decodeanhmm -h - e.g. decodeanhmm -f /TMHMM2.0.options -modelfile /TMHMM2.0.model - */ -class Tmhmm2 extends _SkeletalCommandBuilder { - - /* - * This is a standard tmhmm binary, but slightly modified the only - * difference is that it will always write results in $workDirectory/TMHMM - */ - private static final String command = "/homes/www-refine/bin/Brunak/TMHMM2/TMHMM2.0c/bin/tmhmm_samedir"; - String input; - String output; - List params; - - private final String workDirectory; - - public Tmhmm2(String workDirectory) { - this.workDirectory = workDirectory; - } - - public static String getTestCommand() { - return command; - } - - public String getCommandName() { - return "tmhmm"; - } - - @Override - public List getCreatedFiles() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getInput() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/runner/compbio/runner/_jpred/JpredParameters.xml b/runner/compbio/runner/_jpred/JpredParameters.xml deleted file mode 100644 index d4e9992..0000000 --- a/runner/compbio/runner/_jpred/JpredParameters.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - compbio.runner.tcoffee.Tcoffee - - Group sequences by similarity (this is the default) - http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html - Group - -group - OPTIONAL - auto - protein - nucleo - - diff --git a/runner/compbio/runner/_jpred/_Jpred.java b/runner/compbio/runner/_jpred/_Jpred.java deleted file mode 100644 index 6143e56..0000000 --- a/runner/compbio/runner/_jpred/_Jpred.java +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._jpred; - -public class _Jpred { - - /** - * Limitation for jpred processing - AA sequence only, less than 500 AA - */ - -} diff --git a/testsrc/compbio/engine/cluster/dundee/_QueueTester.java b/testsrc/compbio/engine/cluster/dundee/_QueueTester.java deleted file mode 100644 index b1ab6be..0000000 --- a/testsrc/compbio/engine/cluster/dundee/_QueueTester.java +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.engine.cluster.dundee; - -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertNotSame; -import static org.testng.AssertJUnit.assertTrue; - -import java.net.UnknownServiceException; - -import org.testng.annotations.Test; - -import compbio.runner._NativeSpecHelper; - -public class _QueueTester { - @Test - public void testQueue() { - _NativeSpecHelper queueHelper = new _NativeSpecHelper(2000, 9); - - assertEquals(_Queue.PRIBIT64, queueHelper.getApproprieteQueue()); - queueHelper.setQueue("bigmem.q"); - assertEquals(_Queue.BIGMEM.toString(), queueHelper.getQueue()); - queueHelper.setQueue("devel.q"); - assertNotSame(_Queue.DEVEL, queueHelper.getApproprieteQueue()); - boolean hasfailed = false; - try { - queueHelper.getNativeSpec(); - } catch (UnknownServiceException e) { - hasfailed = true; - } - assertTrue(hasfailed); - - queueHelper = new _NativeSpecHelper(14000, 9); - assertEquals(_Queue.PRIBIT64, queueHelper.getApproprieteQueue()); - queueHelper.setRequiredMemory(14001); - assertEquals(_Queue.BIGMEM, queueHelper.getApproprieteQueue()); - queueHelper.setRequiredMemory(32000); - hasfailed = false; - try { - assertEquals(_Queue.BIGMEM, queueHelper.getApproprieteQueue()); - } catch (UnsupportedOperationException e) { - hasfailed = true; - } - assertTrue(hasfailed); - queueHelper = new _NativeSpecHelper(8000); - assertEquals(_Queue.BIT64, queueHelper.getApproprieteQueue()); - } -} diff --git a/testsrc/compbio/runner/_impl/MclTester.java b/testsrc/compbio/runner/_impl/MclTester.java deleted file mode 100644 index 7d58e08..0000000 --- a/testsrc/compbio/runner/_impl/MclTester.java +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertFalse; -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; -import static org.testng.AssertJUnit.fail; - -import java.text.ParseException; - -import org.ggf.drmaa.DrmaaException; -import org.ggf.drmaa.JobInfo; -import org.testng.annotations.Test; - -import compbio.engine.cluster.drmaa.ClusterUtil; -import compbio.engine.cluster.drmaa.JobRunner; -import compbio.engine.cluster.drmaa.StatisticManager; -import compbio.metadata.AllTestSuit; -import compbio.metadata.JobExecutionException; -import compbio.metadata.JobStatus; -import compbio.metadata.JobSubmissionException; - -public class MclTester { - - public static String test_input = "/homes/pvtroshin/mclReady_E-TABM-145_CorDesc-10_Spearman.txt"; - public static String test_outfile = "/homes/pvtroshin/MCL-E-TABM-145_25-06-2009.txt"; - - @Test() - public void testGetTestCommand() { - System.out.println(Mcl.getTestCommand()); - } - - @Test(enabled = false, groups = { AllTestSuit.test_group_cluster, - AllTestSuit.test_group_runner }) - public void testBuildCommand() { - Mcl mcl = new Mcl(AllTestSuit.OUTPUT_DIR_ABSOLUTE); - // TODO mcl.setInput(test_input).setOutput(test_outfile); - // mcl.setParameters(Mcl.getTestParams()); - - try { - JobRunner runner = JobRunner.getInstance(null); - assertNotNull("Runner is NULL", runner); - runner.executeJob(); - // assertNotNull("JobId is NULL", jobId1); - JobStatus status = runner.getJobStatus(); - assertTrue("Session state is wrong", status == JobStatus.PENDING - || status == JobStatus.RUNNING); - JobInfo info = runner.getJobInfo(); - assertNotNull("JobInfo is null", info); - StatisticManager sm = new StatisticManager(info); - assertNotNull("StatisticManager is null", sm); - try { - String time_s = sm.getCalculationTime(); - assertNotNull("Calculation time is null", time_s); - String exits = sm.getExitStatus(); - assertNotNull("Exit status is null", exits); - int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits) - .intValue(); - assertEquals("Exist status is not 0", 0, exitsInt); - System.out.println(sm.getAllStats()); - - } catch (ParseException e) { - e.printStackTrace(); - fail("Parse Exception: " + e.getLocalizedMessage()); - } - - assertTrue("Process exited:", sm.hasExited()); - assertFalse("Process aborted:", sm.wasAborted()); - assertFalse("Process hasdump:", sm.hasDump()); - assertFalse("Process signaled:", sm.hasSignaled()); - - } catch (DrmaaException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (JobSubmissionException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (JobExecutionException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } - } - -} diff --git a/testsrc/compbio/runner/_impl/NetNglycTester.java b/testsrc/compbio/runner/_impl/NetNglycTester.java deleted file mode 100644 index d394df0..0000000 --- a/testsrc/compbio/runner/_impl/NetNglycTester.java +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import static org.testng.AssertJUnit.assertFalse; -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; -import static org.testng.AssertJUnit.fail; - -import java.text.ParseException; - -import org.ggf.drmaa.DrmaaException; -import org.ggf.drmaa.JobInfo; -import org.testng.annotations.Test; - -import compbio.engine.cluster.drmaa.ClusterUtil; -import compbio.engine.cluster.drmaa.JobRunner; -import compbio.engine.cluster.drmaa.StatisticManager; -import compbio.metadata.AllTestSuit; -import compbio.metadata.JobExecutionException; -import compbio.metadata.JobStatus; -import compbio.metadata.JobSubmissionException; - -public class NetNglycTester { - - public static String test_input = "/homes/pvtroshin/TO1381.fasta"; - public static String test_outfile = "/homes/pvtroshin/TO1381.netNGlycout"; - - @Test() - public void testGetTestCommand() { - assertNotNull(Tmhmm2.getTestCommand()); - } - - @Test(enabled = false, groups = { AllTestSuit.test_group_cluster, - AllTestSuit.test_group_runner }) - public void testBuildCommand() { - NetNglyc netnGlyc = new NetNglyc(); - // TODO netnGlyc.setInput(test_input).setOutput(test_outfile); - - try { - JobRunner runner = JobRunner.getInstance(null); - assertNotNull("Runner is NULL", runner); - runner.executeJob(); - assertNotNull("JobId is NULL"); - JobStatus status = runner.getJobStatus(); - assertTrue("Status of the job is wrong!", - status == JobStatus.PENDING || status == JobStatus.RUNNING); - JobInfo info = runner.getJobInfo(); - assertNotNull("Cannot Obtain Job Info", info); - StatisticManager sm = new StatisticManager(info); - assertNotNull("StatisticManager is NULL", sm); - - String exits = sm.getExitStatus(); - assertNotNull("Status is NULL", exits); - int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits) - .intValue(); - assertTrue("Time elapsed is greater than 0", exitsInt >= 0); - System.out.println(sm.getAllStats()); - - assertTrue("Process exited:", sm.hasExited()); - assertFalse("Process aborted:", sm.wasAborted()); - assertFalse("Process hasdump:", sm.hasDump()); - assertFalse("Process signaled:", sm.hasSignaled()); - - } catch (DrmaaException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (ParseException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (JobSubmissionException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (JobExecutionException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } - } -} diff --git a/testsrc/compbio/runner/_impl/OBTester.java b/testsrc/compbio/runner/_impl/OBTester.java deleted file mode 100644 index eb9f75e..0000000 --- a/testsrc/compbio/runner/_impl/OBTester.java +++ /dev/null @@ -1,113 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertFalse; -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; -import static org.testng.AssertJUnit.fail; - -import java.text.ParseException; - -import org.ggf.drmaa.DrmaaException; -import org.ggf.drmaa.JobInfo; -import org.testng.annotations.Test; - -import compbio.engine.cluster.drmaa.ClusterUtil; -import compbio.engine.cluster.drmaa.JobRunner; -import compbio.engine.cluster.drmaa.StatisticManager; -import compbio.metadata.AllTestSuit; -import compbio.metadata.JobExecutionException; -import compbio.metadata.JobStatus; -import compbio.metadata.JobSubmissionException; - -/** - * TODO this needs fixing! Executable does not work - * - * @author pvtroshin - * - */ -public class OBTester { - - public static String test_input = "/homes/pvtroshin/TO1381.fasta"; - public static String test_outfile = "/homes/pvtroshin/TO1381.OB.out"; - - @Test - public void testGetTestCommand() { - System.out.println(OB.getTestCommand()); - } - - @Test - public void testGetTestArgsCommand() { - System.out.println(new OB().getTestArgs()); - } - - @Test(enabled = false, groups = { AllTestSuit.test_group_cluster, - AllTestSuit.test_group_runner }) - public void testBuildCommand() { - OB ob = new OB(AllTestSuit.OUTPUT_DIR_ABSOLUTE); - // TODO ob.setInput(test_input).setOutput(test_outfile); - // ob.setParameters(ob.getTestArgs()); - - try { - JobRunner runner = JobRunner.getInstance(null); - assertNotNull("Runner is NULL", runner); - runner.executeJob(); - // assertNotNull("Job id is null", jobId1); - JobStatus status = runner.getJobStatus(); - assertTrue("Status is not queing but " + status, - status == JobStatus.PENDING || status == JobStatus.RUNNING); - JobInfo info = runner.getJobInfo(); - assertNotNull("JobInfo is null", info); - StatisticManager sm = new StatisticManager(info); - assertNotNull("Stat manager is null", sm); - try { - String time_s = sm.getCalculationTime(); - assertNotNull("Time is null", time_s); - float time = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(time_s) - .floatValue(); - String exits = sm.getExitStatus(); - assertNotNull("Exit status is null", exits); - int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits) - .intValue(); - assertEquals("Exit status is not 0", 0, exitsInt); - System.out.println(sm.getAllStats()); - - } catch (ParseException e) { - e.printStackTrace(); - fail("Parse Exception: " + e.getLocalizedMessage()); - } - - assertTrue("Process exited:", sm.hasExited()); - assertFalse("Process aborted:", sm.wasAborted()); - assertFalse("Process hasdump:", sm.hasDump()); - assertFalse("Process signaled:", sm.hasSignaled()); - - } catch (DrmaaException e) { - e.printStackTrace(); - fail("Drmaa exception: " + e.getLocalizedMessage()); - } catch (JobSubmissionException e) { - e.printStackTrace(); - fail("JobSubmission failure: " + e.getLocalizedMessage()); - } catch (JobExecutionException e) { - e.printStackTrace(); - fail("JobSubmission failure: " + e.getLocalizedMessage()); - } - } -} diff --git a/testsrc/compbio/runner/_impl/RonnTester.java b/testsrc/compbio/runner/_impl/RonnTester.java deleted file mode 100644 index 3ff9098..0000000 --- a/testsrc/compbio/runner/_impl/RonnTester.java +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import static org.testng.AssertJUnit.assertFalse; -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; -import static org.testng.AssertJUnit.fail; - -import java.text.ParseException; - -import org.ggf.drmaa.DrmaaException; -import org.ggf.drmaa.JobInfo; -import org.testng.annotations.Test; - -import compbio.engine.cluster.drmaa.ClusterUtil; -import compbio.engine.cluster.drmaa.JobRunner; -import compbio.engine.cluster.drmaa.StatisticManager; -import compbio.metadata.AllTestSuit; -import compbio.metadata.JobExecutionException; -import compbio.metadata.JobStatus; -import compbio.metadata.JobSubmissionException; - -public class RonnTester { - - public static String test_input = "/homes/pvtroshin/one_prot"; - public static String test_outfile = "/homes/pvtroshin/TO1381.ronn.out"; - public static String test_outDir = "/homes/pvtroshin/RONN"; - - @Test() - public void testGetTestCommand() { - System.out.println(Ronn.getTestCommand()); - } - - @Test(enabled = false, groups = { AllTestSuit.test_group_cluster, - AllTestSuit.test_group_runner }) - public void testBuildCommand() { - Ronn ronn = new Ronn(AllTestSuit.OUTPUT_DIR_ABSOLUTE); - // TODO ronn.setInput(test_input).setOutput(test_outfile); - // ronn.setParameters(new ArrayList()); - - try { - JobRunner runner = JobRunner.getInstance(null); - assertNotNull("Runner is NULL", runner); - // runner.setWorkDirectory(test_outDir); - runner.executeJob(); - // assertNotNull(jobId1); - JobStatus status = runner.getJobStatus(); - assertTrue(status == JobStatus.PENDING - || status == JobStatus.RUNNING); - JobInfo info = runner.getJobInfo(); - assertNotNull(info); - StatisticManager sm = new StatisticManager(info); - assertNotNull(sm); - try { - String time_s = sm.getCalculationTime(); - assertNotNull(time_s); - float time = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(time_s) - .floatValue(); - assertTrue(time > 0); - String exits = sm.getExitStatus(); - assertNotNull(exits); - int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits) - .intValue(); - // assertEquals(0, exitsInt); - System.out.println(sm.getAllStats()); - - } catch (ParseException e) { - e.printStackTrace(); - fail("Parse Exception: " + e.getLocalizedMessage()); - } - - assertTrue(sm.hasExited()); - assertFalse(sm.wasAborted()); - assertFalse(sm.hasDump()); - assertFalse(sm.hasSignaled()); - - } catch (DrmaaException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (JobSubmissionException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (JobExecutionException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } - } - -} diff --git a/testsrc/compbio/runner/_impl/Tmhmm2Tester.java b/testsrc/compbio/runner/_impl/Tmhmm2Tester.java deleted file mode 100644 index fe92048..0000000 --- a/testsrc/compbio/runner/_impl/Tmhmm2Tester.java +++ /dev/null @@ -1,100 +0,0 @@ -/* Copyright (c) 2009 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.runner._impl; - -import static org.testng.AssertJUnit.assertFalse; -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; -import static org.testng.AssertJUnit.fail; - -import java.text.ParseException; - -import org.ggf.drmaa.DrmaaException; -import org.ggf.drmaa.JobInfo; -import org.testng.annotations.Test; - -import compbio.engine.cluster.drmaa.ClusterUtil; -import compbio.engine.cluster.drmaa.JobRunner; -import compbio.engine.cluster.drmaa.StatisticManager; -import compbio.metadata.AllTestSuit; -import compbio.metadata.JobExecutionException; -import compbio.metadata.JobStatus; -import compbio.metadata.JobSubmissionException; - -public class Tmhmm2Tester { - - public static String test_input = "/homes/pvtroshin/TO1381.fasta"; - public static String test_outfile = "/homes/pvtroshin/TO1381.tmhmm2.out"; - public static String test_outDir = "/homes/pvtroshin/HMM2"; - - @Test - public void testGetTestCommand() { - System.out.println(Tmhmm2.getTestCommand()); - } - - @Test(enabled = false, groups = { AllTestSuit.test_group_cluster, - AllTestSuit.test_group_runner }) - public void testBuildCommand() { - Tmhmm2 hmm = new Tmhmm2(AllTestSuit.OUTPUT_DIR_ABSOLUTE); - // TODO hmm.setInput(test_input).setOutput(test_outfile); - // hmm.setParameters(new Tmhmm2().getParameters()); - - try { - JobRunner runner = JobRunner.getInstance(null); - assertNotNull("Runner is NULL", runner); - // runner.setWorkDirectory(test_outDir); - runner.executeJob(); - // assertNotNull(jobId1); - JobStatus status = runner.getJobStatus(); - assertTrue(status == JobStatus.PENDING - || status == JobStatus.RUNNING); - JobInfo info = runner.getJobInfo(); - assertNotNull(info); - StatisticManager sm = new StatisticManager(info); - assertNotNull(sm); - try { - String exits = sm.getExitStatus(); - assertNotNull(exits); - int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits) - .intValue(); - // assertEquals(0, exitsInt); - System.out.println(sm.getAllStats()); - - } catch (ParseException e) { - e.printStackTrace(); - fail("Parse Exception: " + e.getLocalizedMessage()); - } - - assertTrue(sm.hasExited()); - assertFalse(sm.wasAborted()); - assertFalse(sm.hasDump()); - assertFalse(sm.hasSignaled()); - - } catch (DrmaaException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (JobSubmissionException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (JobExecutionException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } - } - -} diff --git a/webservices/compbio/ws/server/_MsaService.java b/webservices/compbio/ws/server/_MsaService.java deleted file mode 100644 index f967f61..0000000 --- a/webservices/compbio/ws/server/_MsaService.java +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.ws.server; - -import java.io.File; -import java.util.List; - -import org.apache.log4j.Logger; - -import compbio.data.sequence.Alignment; -import compbio.data.sequence.FastaSequence; -import compbio.engine.AsyncExecutor; -import compbio.engine.Configurator; -import compbio.engine.client.ConfiguredExecutable; -import compbio.engine.client.SkeletalExecutable; -import compbio.metadata.ChunkHolder; -import compbio.metadata.JobSubmissionException; -import compbio.metadata.Limit; -import compbio.metadata.Option; -import compbio.metadata.Preset; -import compbio.metadata.ResultNotAvailableException; -import compbio.metadata.WrongParameterException; -import compbio.runner.msa.ClustalW; - -/** - * - * TODO to complete after the approach is tested with SequenceAnnotation! - * - * Common methods for all SequenceAnnotation web services - * - * @author pvtroshin - * - * @param - * - * @version 1.0 June 2011 - * @since 2.0 - */ -public abstract class _MsaService extends GenericMetadataService { - - /* - * FIXME - instances of the Runner (?) and their types should be defined in - * Executable IF - */ - _MsaService(SkeletalExecutable exec, Logger log) { - super(exec, log); - } - - public String align(List sequences) - throws JobSubmissionException { - - WSUtil.validateFastaInput(sequences); - ConfiguredExecutable confClust = init(sequences); - return WSUtil.align(sequences, confClust, log, "align", getLimit("")); - } - - public String presetAlign(List sequences, Preset preset) - throws JobSubmissionException, WrongParameterException { - WSUtil.validateFastaInput(sequences); - if (preset == null) { - throw new WrongParameterException("Preset must be provided!"); - } - Limit limit = getLimit(preset.getName()); - ConfiguredExecutable confClust = init(sequences); - confClust.addParameters(preset.getOptions()); - return WSUtil.align(sequences, confClust, log, "presetAlign", limit); - } - - public String customAlign(List sequences, - List> options) throws JobSubmissionException, - WrongParameterException { - WSUtil.validateFastaInput(sequences); - ConfiguredExecutable confClust = init(sequences); - List params = WSUtil.getCommands(options, - ClustalW.KEY_VALUE_SEPARATOR); - confClust.addParameters(params); - log.info("Setting parameters: " + params); - return WSUtil.align(sequences, confClust, log, "customAlign", - getLimit("")); - } - - @SuppressWarnings("unchecked") - public Alignment getResult(String jobId) throws ResultNotAvailableException { - - WSUtil.validateJobId(jobId); - AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId); - ConfiguredExecutable clustal = (ConfiguredExecutable) asyncEngine - .getResults(jobId); - Alignment al = clustal.getResults(); - return al; - } - - @Override - public ChunkHolder pullExecStatistics(String jobId, long position) { - WSUtil.validateJobId(jobId); - String file = Configurator.getWorkDirectory(jobId) + File.separator - + ClustalW.getStatFile(); - ChunkHolder cholder = WSUtil.pullFile(file, position); - return cholder; - } - -} diff --git a/webservices/compbio/ws/server/_WSLogger.java b/webservices/compbio/ws/server/_WSLogger.java deleted file mode 100644 index f6da6a6..0000000 --- a/webservices/compbio/ws/server/_WSLogger.java +++ /dev/null @@ -1,118 +0,0 @@ -/* Copyright (c) 2011 Peter Troshin - * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * Apache License version 2 as published by the Apache Software Foundation - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache - * License for more details. - * - * A copy of the license is in apache_license.txt. It is also available here: - * @see: http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Any republication or derived work distributed in source code form - * must include this copyright and license notice. - */ -package compbio.ws.server; - -import javax.servlet.http.HttpServletRequest; -import javax.xml.ws.WebServiceContext; -import javax.xml.ws.handler.MessageContext; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import compbio.util.Timer; -import compbio.util.Util; -import compbio.ws.client.Services; - -@Deprecated -public class _WSLogger { - - private static final String SPACER = " "; - - private final String wsname; - private final WebServiceContext wsContext; - private final Logger wsAccessLog; - - private _WSLogger(Services wsname, WebServiceContext context) { - this.wsname = wsname.toString(); - this.wsContext = context; - this.wsAccessLog = Logger.getLogger(wsname.toString() + "-stats"); - assert context != null : "WSContext was not injected"; - assert wsAccessLog != null : "wsAccessLog is not obtained"; - } - - public static final _WSLogger getStatLogger(Services service, - WebServiceContext wsContext) { - assert service != null; - return new _WSLogger(service, wsContext); - } - - /** - * [Request_thread timeofRequest] configured via log4j configuration - * RequestSource web_service timeToProcessRequest methodname {taskid} - * - * @param statLog - * @param wsContext - * @param jobId - * @param activity - */ - private void log(Timer timer, String activity, Level level, String jobId) { - assert !Util.isEmpty(jobId) || !Util.isEmpty(activity); // At least one - // of the two must be defined - if (Util.isEmpty(jobId)) { - jobId = ""; // prevent is to be printed as null - } else { - assert !Util.isEmpty(activity) : "if jobId is defined, then activity must be defined too"; - } - - wsAccessLog.log(level, getRemoteAddress() + SPACER + wsname + SPACER - + timer.getTotalTime() + SPACER + activity + SPACER + jobId); - } - - public void logAll(Timer timer, String activity) { - assert !Util.isEmpty(activity); - log(timer, activity, Level.TRACE, ""); - } - - public void logFine(Timer timer, String activity) { - assert !Util.isEmpty(activity); - log(timer, activity, Level.DEBUG, ""); - } - - public void log(Timer timer, String activity) { - assert !Util.isEmpty(activity); - log(timer, activity, Level.INFO, ""); - } - - public void log(Timer timer, String activity, String jobId) { - assert !Util.isEmpty(activity); - log(timer, activity, Level.INFO, jobId); - } - - /* - * - * private static String getDataTimeForLog() { return - * DateFormat.getDateTimeInstance(DateFormat.MEDIUM, - * DateFormat.SHORT).format(System.currentTimeMillis()); } - * - * - * public static String getRemoteAddress(WebServiceContext wsContext) { - * assert wsContext != null : "WS context injection failed!"; MessageContext - * msContext = wsContext.getMessageContext(); HttpServletRequest request = - * (HttpServletRequest) msContext .get(MessageContext.SERVLET_REQUEST); - * return request == null ? "127.0.0.1" : request.getRemoteAddr(); } - */ - - public String getRemoteAddress() { - assert wsContext != null : "WS context injection failed!"; - MessageContext msContext = wsContext.getMessageContext(); - HttpServletRequest request = (HttpServletRequest) msContext - .get(MessageContext.SERVLET_REQUEST); - return request == null ? "127.0.0.1" : request.getRemoteAddr(); - } - -}