Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-14-2008, 06:48 PM
Member
 
Join Date: Mar 2008
Posts: 32
BHCluster is on a distinguished road
I am Doing Something Wrong But Don't Know What?
What I am trying to do is to implement the Hierarchical Clustering algorithm with UPGMA (Average distance between clusters) and various distance metrics (Pearson, Manhattan).
The results required: plot of data in experiment space showing the clustering according to the various distance metrics and a text file with gene clustering using the notation: (A, ((B,C),D)) meaning B & C are closest and then D etc...
The code that I have compiles but I can't run it if you know what I am doing wrong please help. The code is below:

Code:
import java.io.*; class Numbers { public static void Manhattan(double[][] a,double[][] b,int n,int n2) { int q=n2; int c=n; for(int m=0;m<q;m++) { for(int h=0;h<q;h++) { double d=0; double d2=0; for(int j=0;j<c;j++) { d2=a[m][j]-a[h][j]; if(d2<0) d2=d2*-1; d=d+d2; } b[m][h]=d; } } } public static void main(String[] args) { double x1=0; double x2; double x3; double y; double y1=0; double y2=0; double y3=0; double z=0; double z1=0; double z2=0; double z3=0; double total=0; /*x=x1; y=x2;*/ z=3-2; z1=0; if(z1<0) { z1=z1*-1; } else { total=z1+z2+z3; } String[] s2=new String [9]; BufferedReader inFile; try{ inFile=new BufferedReader(new FileReader("Data_Set_1.txt")); String s=inFile.readLine(); for (int i=1;i<61;i++) { s2=s.split(" "); } } catch(Exception e){} System.out.println(); } }
Below is the Data_Set_1.txt
Code:
Gene Number Gene Name Experiment 1 Experiment 2 Experiment 3 1 Y1 -9.30 5.65 -5.02 2 Y2 -4.10 5.68 0.56 3 Y3 4.75 0.11 2.86 4 Y4 -1.54 -10.01 -1.99 5 Y5 -6.29 5.62 -2.78 6 Y6 -13.02 1.31 1.61 7 Y7 -5.85 3.79 -6.56 8 Y8 -12.71 -0.45 0.62 9 Y9 -3.05 -12.65 -5.07 10 Y10 2.18 -5.82 -9.73 11 Y11 1.74 -0.99 -3.66 12 Y12 -7.88 0.93 -8.33 13 Y13 -6.34 -1.85 -4.00 14 Y14 -0.71 -2.64 -5.64 15 Y15 2.77 -4.16 -3.83 16 Y16 -0.25 0.58 0.77 17 Y17 2.52 -5.80 -8.80 18 Y18 5.53 -9.11 -1.92 19 Y19 6.63 2.53 7.94 20 Y20 -7.11 8.09 -6.47 21 Y21 -0.30 -6.18 -6.25 22 Y22 -0.33 4.58 -8.32 23 Y23 -2.39 1.44 3.94 24 Y24 7.70 9.39 4.73 25 Y25 4.89 -6.17 6.98 26 Y26 6.05 -6.54 -1.94 27 Y27 6.78 7.83 -7.72 28 Y28 4.86 2.31 2.33 29 Y29 6.93 3.95 10.61 30 Y30 0.04 -7.31 -1.49 31 Y31 -4.78 3.41 10.69 32 Y32 5.55 -6.48 -0.56 33 Y33 -3.18 -4.32 -3.32 34 Y34 3.67 -9.79 -13.03 35 Y35 -11.01 -3.69 -5.13 36 Y36 -2.24 -2.19 -12.74 37 Y37 8.84 2.10 1.28 38 Y38 0.69 7.11 -5.35 39 Y39 -9.19 -6.10 -11.01 40 Y40 2.37 6.58 2.67 41 Y41 6.40 6.03 3.58 42 Y42 -0.54 -1.32 -0.69 43 Y43 -0.45 0.01 -0.25 44 Y44 0.52 0.96 0.28 45 Y45 0.86 1.07 0.96 46 Y46 -0.47 -1.36 -0.81 47 Y47 -0.64 -1.47 -0.32 48 Y48 0.34 -0.47 0.46 49 Y49 -0.27 -0.62 -0.43 50 Y50 -0.49 -0.22 -0.01 51 Y51 -9.80 2.34 -5.95 52 Y52 6.74 -8.43 4.21 53 Y53 -7.60 -6.57 -5.13 54 Y54 -6.53 -2.55 -13.86 55 Y55 -3.82 7.12 -11.45 56 Y56 5.49 -7.60 0.40 57 Y57 6.95 -2.61 -5.14 58 Y58 0.21 -6.98 0.84 59 Y59 1.65 3.77 3.33 60 Y60 6.16 3.25 -14.31
I would appreciate greatly any help I get.

Last edited by BHCluster : 04-14-2008 at 07:03 PM. Reason: Forgot the Text File
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-14-2008, 06:59 PM
Moderator
 
Join Date: Nov 2007
Posts: 1,637
Java Tip will become famous soon enoughJava Tip will become famous soon enough
Quote:
The code that I have compiles but I can't run it if you know what I am doing wrong please help.
What is the result? What do you mean with "i cant run it"?
__________________
Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
to our beloved Java Forums! (closes on July 27, 2008)
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-14-2008, 07:02 PM
Member
 
Join Date: Mar 2008
Posts: 32
BHCluster is on a distinguished road
When I go jav numbers it doesn't run!
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-16-2008, 02:16 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 524
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
take a look at your class that holds the main method, is it a public?

regards,
sukatoa
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is wrong with this code masaka New To Java 5 04-16-2008 09:27 AM
What's wrong with this code? Wizard wusa New To Java 14 01-23-2008 12:55 AM
Is there somethign wrong with this code? Soda New To Java 1 12-08-2007 05:46 PM
Whats wrong with my code??? Soda New To Java 2 12-06-2007 01:54 PM
Maths table.. what am I doing wrong (probably everything!! :p ) ad0m New To Java 15 11-30-2007 06:19 PM


All times are GMT +3. The time now is 05:20 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org