def __init__(self, inputFnameLs=None, **keywords): """ 2012.5.23 """ AbstractMapper.__init__(self, inputFnameLs=inputFnameLs, **keywords) self.chromosomeList = utils.getListOutOfStr(self.chromosomeList, data_type=str, separator2=None) self.chromosomeSet = set(self.chromosomeList) self.fileFormatDict = {1: 'fasta', 2: 'fastq'} if not self.inputFileFormat: #0 or None or '' #use 1: to exclude the '.' in suffix self.inputFileFormat = utils.getRealPrefixSuffixOfFilenameWithVariableSuffix( self.inputFname)[1][1:] else: self.inputFileFormat = self.fileFormatDict.get( self.inputFileFormat) if not self.outputFileFormat: #0 or None or '' self.outputFileFormat = utils.getRealPrefixSuffixOfFilenameWithVariableSuffix( self.outputFname)[1][1:] else: self.outputFileFormat = self.fileFormatDict.get( self.outputFileFormat)
def __init__(self, inputFnameLs=None, **keywords): """ """ parentClass.__init__(self, inputFnameLs=inputFnameLs, **keywords) self.alignmentIDList = utils.getListOutOfStr(list_in_str=self.alignmentIDList, data_type=int) self.characterPattern = re.compile(r'[a-zA-Z]')
def __init__(self, inputFnameLs=None, **keywords): """ """ AbstractMatrixFileWalker.__init__(self, inputFnameLs=inputFnameLs, **keywords) if hasattr(self, 'phenotypeIDList'): self.phenotypeIDList = utils.getListOutOfStr(self.phenotypeIDList) else: self.phenotypeIDList = None
def __init__(self, inputFnameLs=None, **keywords): """ 2012.10.25 self.missingDataNotation will be processed into a set. """ AbstractMapper.__init__(self, inputFnameLs=inputFnameLs, **keywords) #self.connectDB() called within its __init__() #if user wants to preserve data in a data structure that is visible throughout reading different files. # then use this self.invariantPData. self.invariantPData = PassingData(writer=None, headerOutputted=False, x_ls = [], y_ls = [], z_ls=[]) if getattr(self, 'missingDataNotation', None): self.missingDataNotation = set(utils.getListOutOfStr(self.missingDataNotation, data_type=str, separator2=None)) else: self.missingDataNotation = set()
def __init__(self, inputFnameLs, **keywords): """ 2011-7-12 """ ReduceMatrixByMergeColumnsWithSameKey.__init__(self, inputFnameLs, **keywords) if self.valueColumnLs: self.valueColumnLs = utils.getListOutOfStr(self.valueColumnLs, data_type=int) else: self.valueColumnLs = []
def __init__(self, **keywords): """ 2012.9.17 call parentClass.__init__() directly 2011-7-11 """ self.pathToInsertHomePathList.extend(['sfs_code_path']) parentClass.__init__(self, **keywords) if hasattr(self, 'simulateLocusLengthList', None): self.simulateLocusLengthList = utils.getListOutOfStr(self.simulateLocusLengthList, data_type=int) else: self.simulateLocusLengthList = []
def __init__(self, **keywords): """ 2012.9.17 call parentClass.__init__() directly 2011-7-11 """ self.pathToInsertHomePathList.extend(['sfs_code_path']) parentClass.__init__(self, **keywords) if hasattr(self, 'simulateLocusLengthList', None): self.simulateLocusLengthList = utils.getListOutOfStr( self.simulateLocusLengthList, data_type=int) else: self.simulateLocusLengthList = []
def __init__(self, inputFnameLs=None, **keywords): """ 2011-7-12 """ AbstractReducer.__init__(self, inputFnameLs=inputFnameLs, **keywords) if self.keyColumnLs: self.keyColumnLs = utils.getListOutOfStr(self.keyColumnLs, data_type=int) else: self.keyColumnLs = [] if self.keyHeaderLs: self.keyHeaderLs = self.keyHeaderLs.split(',') else: self.keyHeaderLs = [] self.keyColumnSet = set(self.keyColumnLs)
def addObjectListAttributeToSet(self, attributeName=None, setVariable=None, data_type=None): """ 2013.09.10 bugfix, added argument data_type 2012.12.3 2012.12.2 bugfix 2012.11.23 """ attributeValue = self.getAttribute(attributeName, None) flag = False if type(attributeValue)==numpy.ndarray: #"if attributeValue" fails for numpy array if hasattr(attributeValue, '__len__') and attributeValue.size>0: flag = True elif attributeValue or attributeValue == 0: flag = True if flag and setVariable is not None: if type(attributeValue)==str: attributeValueList = getListOutOfStr(attributeValue, data_type=data_type, separator1=',', separator2='-') else: attributeValueList = attributeValue setVariable |= set(list(attributeValueList)) return setVariable
def __init__(self, inputFnameLs=None, **keywords): """ """ AbstractVervetMapper.__init__(self, inputFnameLs=inputFnameLs, **keywords) self.sequencedMonkeyCountryIDList = utils.getListOutOfStr(self.sequencedMonkeyCountryIDList) self.newSampleMonkeyCountryIDList = utils.getListOutOfStr(self.newSampleMonkeyCountryIDList)
def __init__(self, inputFnameLs=None, **keywords): """ """ parentClass.__init__(self, inputFnameLs=inputFnameLs, **keywords) self.perturbedMonkeyList = utils.getListOutOfStr(list_in_str=self.perturbedMonkeyList, data_type=str, separator1=',', separator2=None)
def __init__(self, inputFnameLs=None, **keywords): """ """ parentClass.__init__(self, inputFnameLs=inputFnameLs, **keywords) #self.connectDB() called within its __init__() self.annotation_type_id_list = utils.getListOutOfStr(list_in_str=self.annotation_type_id_list, data_type=int) self.annotation_type_id_set = set(self.annotation_type_id_list)
def __init__(self, inputFnameLs=None, **keywords): """ """ parentClass.__init__(self, inputFnameLs=inputFnameLs, **keywords) self.alignmentIDList = utils.getListOutOfStr(list_in_str=self.alignmentIDList, data_type=int)