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.getRealPrefixSuffix(
                self.inputFname)[1][1:]
        else:
            self.inputFileFormat = self.fileFormatDict.get(
                self.inputFileFormat)
        if not self.outputFileFormat:  #0 or None or ''
            self.outputFileFormat = utils.getRealPrefixSuffix(
                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]')
예제 #3
0
    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, **keywords):
        """
        """
        ReduceMatrixByMergeColumnsWithSameKey.__init__(self, inputFnameLs,
                                                       **keywords)

        if self.valueColumnLs:
            self.valueColumnLs = utils.getListOutOfStr(self.valueColumnLs,
                                                       data_type=int)
        else:
            self.valueColumnLs = []
예제 #5
0
    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):
        """
        """
        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 __init__(self, inputFnameLs=None, **keywords):
     """
     self.missingDataNotation will be processed into a set.
     """
     #self.connectDB() called within its __init__()
     AbstractMapper.__init__(self, inputFnameLs=inputFnameLs, **keywords)
     #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()
예제 #8
0
 def addObjectListAttributeToSet(self,
                                 attributeName=None,
                                 setVariable=None,
                                 data_type=None):
     """
     """
     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
예제 #9
0
    def __init__(self, inputFnameLs=None, **keywords):
        """
		"""
        ParentClass.__init__(self, inputFnameLs=inputFnameLs, **keywords)
        self.alignmentIDList = utils.getListOutOfStr(
            list_in_str=self.alignmentIDList, data_type=int)