Exemple #1
0
 def parseValues(self):
     '''
     Parses all data lines in file and yields them as a generator
     '''
     for i, dataLine in enumerate(self.mutationsFile):
         if i > 1:
             lineParts = dataLine.split(self.columnDelimiter)
             hugoSymbol, entrezID, chrom, start, stop, strand, variantRef, refAllele, firstTumorSeqAllele, secondTumorSeqAllele, barcode = Utility.unpack_fromPositions(
                 lineParts, (0, 1, 4, 5, 6, 7, 9, 10, 11, 12, 15))
             yield hugoSymbol, entrezID, chrom, start, stop, strand, variantRef, refAllele, firstTumorSeqAllele, secondTumorSeqAllele, barcode
Exemple #2
0
 def openFileAndParseHeaders(self):
     ''' 
     Opens the methylation array file in TCGA format and returns header values
     '''
     self.mutationsFile = open(self.fileName, 'r')
     assert self.mutationsFile
     print "Successfully accessed file: %s" % (self.mutationsFile)
     for i, line in enumerate(self.mutationsFile):
         if i == 0:
             idHeader = line
         elif i > 0:
             break
     idHeaderParts = idHeader.split(self.columnDelimiter)
     hugoSymbol, entrezID, chrom, start, stop, strand, variantRef, refAllele, firstTumorSeqAllele, secondTumorSeqAllele = Utility.unpack_fromPositions(
         idHeaderParts, (0, 1, 4, 5, 6, 7, 9, 10, 11, 12))
     return hugoSymbol, entrezID, chrom, start, stop, strand, variantRef, refAllele, firstTumorSeqAllele, secondTumorSeqAllele