def __init__(self, sequence="", sequenceFile=""): # provide the flexibility to submit either a sequence # file or an actual sequence as a string if sequence == "" and sequenceFile == "": raise SequenceException("Empty sequence/sequence file") # if the sequence isn't empty constuct a local # sequence object using the sequence if not sequence == "": # note we set the validate flag to check the sequence is valid and deal # with whitespace self.SeqObj = Sequence(sequence, validateSeq=True) else: parserMachine = SequenceFileParser() self.SeqObj = Sequence(parserMachine.parseSeqFile(sequenceFile))
def __init__(self, sequence="", sequenceFile=""): """ sequencePermutant objects, like sequenceParameter objects, can be initialized by either an amino acid sequence as a string, or a sequence file. Such sequence files can be FASTA files, or simply an amino acid sequence in a text file. """ warn_notReadyYet() # provide the flexibility to submit either a sequence # file or an actual sequence as a string if sequence == "" and sequenceFile == "": return None # if the sequence isn't empty constuct a local # sequence object using the sequence if not sequence == "": self.SeqObj = Sequence(sequence) else: parserMachine = SequenceFileParser() self.SeqObj = Sequence(parserMachine.parseSeqFile(sequenceFile)) self.WL_ready = False