J-Express forum
July 20, 2019, 04:05:29 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: J-Express 2011 released. Download from jexpress.bioinfo.no
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: merging 2 datasets only imports n-1 columns of data from second set  (Read 9787 times)
mrzpjt
Newbie
*
Posts: 8


View Profile Email
« on: March 16, 2009, 12:28:38 PM »

HI, just tried the merging 2 datasets script,  - have a weird result- 3 columns of data in each set, but only the first 2 from the second set  appear in the merged result. - But  the groups generated automatically say there are 3  columns in each group?  Any idea what I have to change to sort this?

Paddy
Logged
Bjarte Dysvik
Administrator
Full Member
*****
Posts: 117


View Profile Email
« Reply #1 on: March 18, 2009, 08:07:58 PM »

Hi Paddy,

You're right, there is one column missing in the result from the original script. To fix this, change the two for loops:

   keys = keys + [en]
   if rows1.containsKey(en):
      to= rows1.get(en)
      ind = dat1[to]
      
      for i in range(1, len (ind)):
         row = row + [ dat1[to] ]
   else:
      for i in range(1, dat1cols):
         row = row + [ Double.NaN ]

to

   keys = keys + [en]
   if rows1.containsKey(en):
      to= rows1.get(en)
      ind = dat1[to]
      
      for i in range(len (ind)):
         row = row + [ dat1[to] ]
   else:
      for i in range(dat1cols):
         row = row + [ Double.NaN ]

That should do the trick.
I hope you haven't spent too much time on this..

regards,
Bjarte
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.14 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!