appending values into array instead of a list

2008-12-08 Thread trias

Hi,
 I have this little script:
import csv
import numpy
signal=[]
ref=[]

for x in csv.reader(open('reffile.csv').readlines()):

ref.append(x)

for x in csv.reader(open('signalfile.csv').readlines()):

signal.append(x)

signalarray=numpy.array(signal, dtype=float)

signaldict={}

signaldict.update(dict(signalarray))

intarray=[0.0 for x in range(301)]

cntarray=[0 for x in range(301)]

for line in ref:

print line

locstr=line[1]

endstr=line[2]

loc=float(locstr)

end=float(endstr)

print loc

print end

i=0

while float(i) <= 300.0:

if signaldict.has_key(end+float(i)):

expr=signaldict[end+float(i)]

print expr

intarray[i]+=expr

cntarray[i]+=1

y=i

i+=1

print intarray

print cntarray

fo=file('outfile.txt','w')
s=str(intarray)
fo.write(s)
fo.close()

So on the above I am appending values from signaldict indexed by i for every
object in the ref list. This way I calculate the sum of all values with
similar indexing i value. Would I be able to store the signaldict[i] for
every line individually in a multidimensional array?  

cheers
-- 
View this message in context: 
http://www.nabble.com/appending-values-into-array-instead-of-a-list-tp20896957p20896957.html
Sent from the Python - python-list mailing list archive at Nabble.com.

--
http://mail.python.org/mailman/listinfo/python-list


anyone with genomewide microarray analysis experience ?

2009-08-14 Thread trias

Hi,

 I am trying to analyse some biological data from microarray experiments.
Different experiments have been stored in a SQL database.

 One of the things I would like to do is to fetch all data from a certain
distance from gene ATGs say 100+/- bp and calculate the bp average over all
genes over this region. 

 The microarray data has been normalised over each bp

Does anyone have some scripts I could use for this purpose. I work with
S.cerevisiae

Thank you
-- 
View this message in context: 
http://www.nabble.com/anyone-with-genomewide-microarray-analysis-experience---tp24971224p24971224.html
Sent from the Python - python-list mailing list archive at Nabble.com.

-- 
http://mail.python.org/mailman/listinfo/python-list