Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Update BioinformaticFileWidget/BF.py #9

Merged
merged 1 commit into from about 2 years ago

2 participants

Tmana Jack Rogers
Tmana
Tmana commented

No description provided.

Jack Rogers jackRogers merged commit 57d8f34 into from
Jack Rogers jackRogers closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

May 10, 2012
Tmana Tmana Update BioinformaticFileWidget/BF.py 9d635e3
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 0 additions and 43 deletions. Show diff stats Hide diff stats

  1. +0 43 BioinformaticFileWidget/BF.py
43 BioinformaticFileWidget/BF.py
@@ -160,49 +160,6 @@ def makeTXTDataFile(newFileName,dataDict,label):
160 160 fh.close
161 161
162 162
163   -def concat(flist, column_overlap=0, transpose=False):
164   - """
165   - A concatonate function that returns a large data table of
166   - the files in flist.
167   -
168   - Assumes that all files are properly aligned. Will terminate
169   - in error if file lengths do not line up appropriately.
170   -
171   - column_overlap specifies the number of repeat columns
172   - in the files. Ignores these columns from concatonation.
173   -
174   - Transpose calls the transpose function before returning the
175   - data file matrix.
176   -
177   - returns a numpy array of all file constituents.
178   - """
179   -
180   - data = [] #Container for all file data desired
181   -
182   - for num, fil in enumerate(flist):
183   - f = open(fil, 'r')
184   - reader = csv.reader(f, delimiter='\t') #init csv reader on each file in list
185   -
186   - line_i = reader.next()
187   - i = 0 #counter to make sure which line we are on.
188   - if num < 1: #if it is the first file, add straight to data
189   - while line_i:
190   - data.append(line_i) #add to data as new list
191   - try:
192   - line_i = reader.next()
193   - except:
194   - break #exit loop gracefully.
195   - else: # all other files after first...
196   - while line_i:
197   - data[i].extend(line_i[column_overlap:]) # .. extend the i-th list in data
198   - try:
199   - line_i = reader.next()
200   - i += 1 #update the counter
201   - except:
202   - break #end gracefully
203   -
204   - return data #may addd as numpy array later, if desired.
205   -
206 163
207 164 def main(outputFilePath,dataPath,label):
208 165 dictionary = concatFiles(dataPath)

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.