public
anonymous / gist:3967314
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
eFile = [None]*8
mFile = [None]*8
import csv
eFile[0] = open('CvR.txt')
mFile[0] = open('Selected_C1_D0.07_Comparisons_CG_per_pmt_delta_mean_median.txt')
eFile[1] = open('CvR.txt')
mFile[1] = open('Selected_C1_D0.11_Comparisons_CG_per_genebody_delta_mean_median.txt')
eFile[2] = open('MCvMR.txt')
mFile[2] = open('Selected_C2_D0.07_Comparisons_CG_per_pmt_delta_mean_median.txt')
eFile[3] = open('MCvMR.txt')
mFile[3] = open('Selected_C2_D0.17_Comparisons_CG_per_genebody_delta_mean_median.txt')
eFile[4] = open('FCvFR.txt')
mFile[4] = open('Selected_C3_D0.06_Comparisons_CG_per_pmt_delta_mean_median.txt')
eFile[5] = open('FCvFR.txt')
mFile[5] = open('Selected_C3_D0.04_Comparisons_CG_per_genebody_delta_mean_median.txt')
eFile[6] = open('FvM.txt')
mFile[6] = open('Selected_C4_D0.11_Comparisons_CG_per_pmt_delta_mean_median.txt')
eFile[7] = open('FvM.txt')
mFile[7] = open('Selected_C4_D0.09_Comparisons_CG_per_genebody_delta_mean_median.txt')
 
savedRows = []
geneSymbols = []
matchedRows = []
 
for y in range (0,1): #range edited for debugging
for line in eFile[y]:
line2 = line.split('\t')
if line2[2] == 'Olfr1411':
print (line) #this outputs the broken values seen in the list from my original post
print (str(line2))
savedRows.append(line)
geneSymbols.append(line[2])
 
#for line in eFile[y]: --> this is the actual code, the one above is what I am using to debug..
#line = line.split('\t')
#savedRows.append(line)
#geneSymbols.append(line[2])
 
 
for line in mFile[y]:
line = line.split()
for x in range(0,len(geneSymbols)):
if line[0] == geneSymbols[x]:
matchedRows.append(savedRows[x])
######### This would be what would run on your computer since you dont have the source files. I hope I used the \t's right..
line = 'ENSMUSG00000062497\tchr1\tOlfr1411\tolfactory receptor\t1411\tprotein_coding\t972\t0\t0\t0\t0\t0\t0\t0\t#DIV/0!\t0.293586586 1'
line2 = line.split('\t')
if line2[2] == 'Olfr1411':
print (line) #this outputs the broken values seen in the list from my original post
print (str(line2))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.