Skip to content

Commit

Permalink
erm
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Oct 5, 2011
1 parent 5a96274 commit 647d147
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Taxonomy/src/org/simmi/client/GreetingService.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
*/
@RemoteServiceRelativePath("greet")
public interface GreetingService extends RemoteService {
String greetServer(String name, int searchnum) throws IllegalArgumentException;
String greetServer(String name, String searchnum) throws IllegalArgumentException;
String getRemoteAddress() throws IllegalArgumentException;
}
2 changes: 1 addition & 1 deletion Taxonomy/src/org/simmi/client/GreetingServiceAsync.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
* The async counterpart of <code>GreetingService</code>.
*/
public interface GreetingServiceAsync {
void greetServer(String input, int searchnum, AsyncCallback<String> callback) throws IllegalArgumentException;
void greetServer(String input, String searchnum, AsyncCallback<String> callback) throws IllegalArgumentException;
void getRemoteAddress(AsyncCallback<String> callback);
}
18 changes: 11 additions & 7 deletions Taxonomy/src/org/simmi/client/Taxonomy.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void onSelection(SelectionEvent<TreeItem> event) {
TreeItem selectedtree = event.getSelectedItem();

String nodename = selectedtree.getText();
if( nodename.contains("root") && selectedtree.getChildCount() == 0 ) {
if( ( nodename.contains("root") || nodename.equals("arciformis") || nodename.equals("kawarayensis") ) && selectedtree.getChildCount() == 0 ) {
if( nodename.equals("root3") ) runSpec( selectedtree, "http://"+server+"/3v1.txt" );
else if( nodename.equals("root4") ) runSpec( selectedtree, "http://"+server+"/4v1.txt" );
else if( nodename.equals("root5") ) runSpec( selectedtree, "http://"+server+"/5v1.txt" );
Expand All @@ -163,20 +163,23 @@ public void onSelection(SelectionEvent<TreeItem> event) {
//sb.append( selectedtree.getText() );
recursiveNames( selectedtree, sb );

int searchnum = 0;
String searchnum = "";
TreeItem parent = selectedtree.getParentItem();
while( parent != null ) {
selectedtree = parent;
parent = selectedtree.getParentItem();
}
String rootname = selectedtree.getText();
if( rootname.contains("root") ) {
String[] rsplit = rootname.split(" ");
String[] rsplit = rootname.split(" ");
String rootnodename = rsplit[0];
if( rootnodename.contains("root") ) {
try {
searchnum = Integer.parseInt( rsplit[0].substring(4) );
searchnum = rootnodename.substring(4);
} catch( Exception e ) {

}
} else {
searchnum = rootnodename;
}

String qstr = sb.toString();
Expand Down Expand Up @@ -220,8 +223,9 @@ public void onFailure(Throwable caught) {

@Override
public void onSuccess(String result) {
if( result != null && result.contains("130.208.252.") ) runStuff( server, tree );
}
//if( result != null && result.contains("130.208.252.") )
runStuff( server, tree );
}
});
FocusPanel focus = new FocusPanel( tree );
//focus.setSize("100%", "100%");
Expand Down
2 changes: 1 addition & 1 deletion Taxonomy/src/org/simmi/server/GreetingServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@SuppressWarnings("serial")
public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService {

public String greetServer(String input, int searchnum) throws IllegalArgumentException {
public String greetServer(String input, String searchnum) throws IllegalArgumentException {
StringBuilder ret = new StringBuilder();

String[] split = input.split( "," );
Expand Down
57 changes: 46 additions & 11 deletions distann/src/org/simmi/GeneSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,7 @@ private static void loci2gene( Reader rd, String outfile, String filtercont, Map
String name = null;
String nohitname = null;
String evalue = null;
String parseval = null;
String score = null;
int freq = 0;
String freqname = null;
Expand All @@ -2063,6 +2064,10 @@ private static void loci2gene( Reader rd, String outfile, String filtercont, Map
name = split[1];
nohitname = name;

/*if( nohitname.contains("GFLUK6W04CMDEV") ) {
System.err.println("erm");
}*/

String lstr = split[ split.length-1 ];
int l = Integer.parseInt( lstr.substring(7) );
if( l > 80 ) {
Expand Down Expand Up @@ -2119,14 +2124,20 @@ private static void loci2gene( Reader rd, String outfile, String filtercont, Map
if( nfreq > freq ) {
freq = nfreq;
freqname = split[0];
} else if( nfreq == freq ) {
if( !line.contains("cult") ) {
freq = nfreq;
freqname = split[0];
}
}
parseval = split[split.length-1];
} else {
String scstr = split[split.length-2];
double dsc = Double.parseDouble( scstr );
double osc = Double.parseDouble( score );

if( dsc != osc ) {
evalue = split[split.length-1];
evalue = parseval; //split[split.length-1];
} else {
score = split[split.length-2];
int nfreq = freqmap.get( split[0] );
Expand Down Expand Up @@ -2184,9 +2195,11 @@ private static void loci2gene( Reader rd, String outfile, String filtercont, Map
int idx = desc.lastIndexOf('[');
int idx2 = desc.indexOf(']', idx);
String newline = "";
boolean qbool = false;
if( idx > idx2 || idx == -1 ) {
newline = br.readLine();
if( !newline.startsWith("Length=") && !newline.startsWith("Query=") ) {
qbool = newline.startsWith("Query=");
if( !newline.startsWith("Length=") && !qbool ) {
line = line+newline;
String newtrim = line.trim();

Expand All @@ -2199,6 +2212,15 @@ private static void loci2gene( Reader rd, String outfile, String filtercont, Map
}
}

boolean ibool = false;
while( !qbool && !ibool ) {
newline = br.readLine();
qbool = newline.startsWith("Query=");
if( !qbool ) {
ibool = newline.contains("Identities");
}
}

if( idx > 0 ) {
teg = desc.substring(idx);
desc = desc.substring(0, idx-1).trim();
Expand All @@ -2208,7 +2230,15 @@ private static void loci2gene( Reader rd, String outfile, String filtercont, Map

id2desc.put(id, desc);

String stuff = id + "\t" + desc + "\t" + evalue;
String extend = "";
if( ibool ) {
String trim = newline.trim();
int end = trim.indexOf(',');
String nl = trim.substring(13,end);
extend += "\t" + nl;
}
String stuff = id + "\t" + desc + "\t" + evalue + extend;

lociMap.put( prename, stuff );
//lociMap.put( prename, split[1] + (split.length > 2 ? "\t" + split[2] : "") + "\t" + evalue );
name = null;
Expand All @@ -2221,13 +2251,13 @@ private static void loci2gene( Reader rd, String outfile, String filtercont, Map
list = new ArrayList<String>();
maplist.put( id, list );
}
String addstr = prename + "\t" + id + "\t" + evalue;
String addstr = prename + "\t" + id + "\t" + evalue + extend;
list.add( addstr );

//fw.write( stuff + "\n" );
}

if( newline.startsWith("Query=") ) {
if( qbool ) {
line = newline;
continue;
}
Expand Down Expand Up @@ -2372,20 +2402,25 @@ private static void loci2gene( Reader rd, String outfile, String filtercont, Map
List<String> res = maplist.get(id);
for( String rstr : res ) {
if( rstr != null ) {
String[] rspl = rstr.split("[\t ]+");
String[] rspl = rstr.split("\t");
if( rspl.length == 3 ) {
if( first ) {
first = false;
fw.write( rspl[0] + " " + rspl[2] );
} else fw.write( "," + rspl[0] + " " + rspl[2] );
} else if( rspl.length == 4 ) {
if( first ) {
first = false;
fw.write( rspl[0] + " " + rspl[2] );
} else fw.write( "," + rspl[0] + " " + rspl[2] + " " + rspl[3] );
}
}
}
fw.write(")\n");
}

fw.write("\n");
if( tot >= 0 && !spec.contains("No hits") ) {
if( tot >= 0 && (spec == null || !spec.contains("No hits")) ) {
tot += i;
if( tot*100/subtot > 90 ) {
fw.write( "\n90%\n\n" );
Expand Down Expand Up @@ -4379,15 +4414,15 @@ public static void main(String[] args) {
//loci2gene( new FileReader("/home/sigmar/flx/islandicus.blastoutcat"), "/home/sigmar/flx/islandicus.txt" );
//loci2gene( new FileReader("/home/sigmar/flx/scoto2127.blastoutcat"), "/home/sigmar/flx/scoto2127.txt" );

//Map<String,Integer> freqmap = loadFrequency( new FileReader("/home/sigmar/viggo/4.blastout") );
Map<String,Integer> freqmap = loadFrequency( new FileReader("/home/sigmar/viggo/4.blastout") );
/*for( String val : freqmap.keySet() ) {
int fv = freqmap.get(val);
System.err.println( val + " " + fv );
}*/
//loci2gene( new FileReader("/home/sigmar/viggo/4.blastout"), "/home/sigmar/viggo/4v1.txt", null, freqmap );
loci2gene( new FileReader("/home/sigmar/viggo/4.blastout"), "/home/sigmar/viggo/4v1.txt", null, freqmap );

Map<String,Integer> freqmap = loadFrequency( new FileReader("/home/sigmar/arciformis_repeat.blastout") );
loci2gene( new FileReader("/home/sigmar/arciformis_repeat.blastout"), "/home/sigmar/arciformis_v1.txt", null, freqmap );
//Map<String,Integer> freqmap = loadFrequency( new FileReader("/home/sigmar/arciformis_repeat.blastout") );
//loci2gene( new FileReader("/home/sigmar/arciformis_repeat.blastout"), "/home/sigmar/arciformis_v1.txt", null, freqmap );

/*loci2gene( new FileReader("/home/horfrae/viggo/1.blastout"), "/home/horfrae/viggo/1v.txt", null );
loci2gene( new FileReader("/home/horfrae/viggo/2.blastout"), "/home/horfrae/viggo/2v.txt", null );
Expand Down
2 changes: 1 addition & 1 deletion order/auth.jardesc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jardesc>
<jar path="/home/horfrae/workspace/pontun/war/sqljdbc_auth.jar"/>
<jar path="/home/sigmar/sandbox/pontun/war/sqljdbc_auth.jar"/>
<options buildIfNeeded="true" compress="true" descriptionLocation="/order/auth.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/>
Expand Down
6 changes: 2 additions & 4 deletions order/order.jardesc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jardesc>
<jar path="/home/horfrae/workspace/pontun/war/order.jar"/>
<jar path="/home/sigmar/sandbox/pontun/war/order.jar"/>
<options buildIfNeeded="true" compress="true" descriptionLocation="/order/order.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/>
Expand All @@ -11,8 +11,6 @@
</sealing>
</manifest>
<selectedElements exportClassFiles="true" exportJavaFiles="false" exportOutputFolder="false">
<file path="/order/src/emp.txt"/>
<file path="/order/src/persons.txt"/>
<javaElement handleIdentifier="=order/src&lt;org.simmi"/>
<javaElement handleIdentifier="=order/src"/>
</selectedElements>
</jardesc>
8 changes: 4 additions & 4 deletions order/src/org/simmi/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,8 @@ public void updateorder( Pontun order, int quant, double price ) throws SQLExcep
}

public void connect() throws SQLException {
String connectionUrl = "jdbc:sqlserver://navision.rf.is:1433;databaseName=order;user=simmi;password=mirodc30;";
//String connectionUrl = "jdbc:sqlserver://navision.rf.is:1433;databaseName=order;integratedSecurity=true;";
//String connectionUrl = "jdbc:sqlserver://navision.rf.is:1433;databaseName=order;user=simmi;password=mirodc30;";
String connectionUrl = "jdbc:sqlserver://navision.rf.is:1433;databaseName=order;integratedSecurity=true;";
con = DriverManager.getConnection(connectionUrl);
}

Expand Down Expand Up @@ -1565,7 +1565,7 @@ public Dimension getSize() {

try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl = "jdbc:sqlserver://navision.rf.is:1433;databaseName=MATIS;user=simmi;password=mirodc30;";
String connectionUrl = "jdbc:sqlserver://navision.rf.is:1433;databaseName=MATIS;user=simmi2;password=drsmorc.311;";
con = DriverManager.getConnection(connectionUrl);

updateVerk();
Expand Down Expand Up @@ -1608,7 +1608,7 @@ public void itemStateChanged(ItemEvent e) {

if( !valid ) {
try {
String connectionUrl = "jdbc:sqlserver://navision.rf.is:1433;databaseName=order;user=simmi;password=mirodc30;";
String connectionUrl = "jdbc:sqlserver://navision.rf.is:1433;databaseName=order;integratedSecurity=true;";
con = DriverManager.getConnection(connectionUrl);
} catch (SQLException e) {
e.printStackTrace();
Expand Down
33 changes: 29 additions & 4 deletions pontun/src/org/simmi/client/Pontun.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Window.Location;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;

/**
Expand Down Expand Up @@ -60,11 +59,11 @@ public native void console( String log ) /*-{
}-*/;

public void getAllVerk() {
console("trying");
//console("trying");
greetingService.getAllVerk( new AsyncCallback<String>() {
@Override
public void onSuccess(String result) {
console( result );
//console( result );

Element ae = Document.get().getElementById("order");
String[] split = result.split("\n");
Expand Down Expand Up @@ -137,14 +136,40 @@ public void onResize(ResizeEvent event) {
ae.setAttribute("width", "100%");
ae.setAttribute("height", "100%");
ae.setAttribute("codebase", "http://"+server+"/");
ae.setAttribute("archive", "order.jar,sqljdbc4.jar,sqljdbc_auth.jar,mail.jar");
ae.setAttribute("archive", "order.jar,sqljdbc4.jar,sqljdbc_auth.jar,mail.jar,smtp.jar");
ae.setAttribute("code", "org.simmi.Order");
ae.setAttribute("id", "order");
ae.setAttribute("name", "order");
Element pe = Document.get().createElement("param");
pe.setAttribute("name", "jnlp_href");
pe.setAttribute("value", "order.jnlp");

Element pe1 = Document.get().createElement("param");
pe1.setAttribute("name", "image");
pe1.setAttribute("value", "matis2.gif");

Element pe2 = Document.get().createElement("param");
pe2.setAttribute("name", "centerimage");
pe2.setAttribute("value", "true");

Element pe3 = Document.get().createElement("param");
pe3.setAttribute("name", "boxborder");
pe3.setAttribute("value", "false");

Element pe4 = Document.get().createElement("param");
pe4.setAttribute("name", "draggable");
pe4.setAttribute("value", "true");

/*<param name="image" value="matis2.gif"/>
<param name="centerimage" value="true"/>
<param name="boxborder" value="false"/>
<param name="draggable" value="true"/>*/

ae.appendChild( pe );
ae.appendChild( pe1 );
ae.appendChild( pe2 );
ae.appendChild( pe3 );
ae.appendChild( pe4 );
//HTML applet = new HTML( "<applet width='100%' height='100%' codebase='http://"+server+"/' archive='pontun.jar' code='org.simmi.Order'><param name='jnlp_href' value='order.jnlp' /></applet>" );
rp.getElement().appendChild( ae );

Expand Down
1 change: 1 addition & 0 deletions pontun/war/mail.jnlp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<resources>
<j2se version="1.6+" />
<jar href="mail.jar"/>
<jar href="smtp.jar"/>
</resources>
<component-desc />
</jnlp>
Binary file modified pontun/war/matis2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 647d147

Please sign in to comment.