Пример #1
0
    def dnaseq_read(self,newprotein=None,fileinput=None,variable='DNAseq',var2='dnaseqfile'):
        """Read in DNA Sequences and display them above the main sequence"""
        self.data['newprotein']=newprotein
        # If a file is provided use that, otherwise open the dialog
        if fileinput == None:
            dnaseqfile = self.open_file()
        else:
            dnaseqfile = fileinput
        self.data[var2]=dnaseqfile

        # Load the DNA sequence data
        #  - only simple file format supported at the moment

        if self.data[var2]:
            S=DNA_sequence.sequence()
            seqfile=self.data[var2]
            DNAseq=S.read_DNA_sequence(seqfile)

            # Check the DNA sequence
            ok,DNAseq=mutation.check_DNA(DNAseq)
            if not ok:
                # Give a warning
                import tkMessageBox
                tkMessageBox.showwarning("DNA sequence",
                                         'DNA sequence contains invalid characters: %s' %DNAseq
                                         ,parent=self.master)
                return
            self.data[variable]=DNAseq
            self.update_sequence_window()
            
            # Activate/Deactivate buttons
            self.projectChanged()
        return dnaseqfile
Пример #2
0
def main():
    #
    # Parse the arguments
    #
    import sys, string
    defaults = get_defaults()
    #
    args = string.join(sys.argv[1:])
    args = string.split(args, '-')
    for arg in args:
        split = string.split(string.strip(arg))
        if split == []:
            continue
        parm_name = split[0]
        if not defaults.has_key(parm_name):
            raise 'Unknown parameter: ', parm_name
        #
        # Deal with T/F
        #
        if len(split) == 1:
            if defaults[parm_name][1] == 'T/F':
                if defaults[parm_name][0]:
                    defaults[parm_name][0] = None
                else:
                    defaults[parm_name][0] = 1
        #
        # Deal with all the other cases
        #
        elif len(split) == 2:
            if defaults[parm_name][1] == 'number':
                defaults[parm_name][0] = string.atof(split[1])
            else:
                defaults[parm_name][0] = split[1]
        else:
            raise 'Incorrect usage'
    #
    # Reformat
    #
    params = {}
    for key in defaults.keys():
        params[key] = defaults[key][0]
    #
    # Load the file and design the primer
    #
    if not params['seq']:
        usage()
    seq_file = params['seq']
    new_AA = params['mutation'][-1]
    AA_number = int(params['mutation'][1:-1])

    S = DNA_sequence.sequence()
    DNA_seq = S.readpir(seq_file)
    Tm_desired = params['Tm']
    find_restriction_site = 1
    if params['no_restriction_site']:
        find_restriction_site = None
    #
    # Do it!
    #
    import Protool
    X = Protool.structureIO()
    new_AA = X.threetoone[new_AA]
    #
    # Call the function for designing primers
    #
    new_enzymes, primers_results_dict, enzymes_that_already_cut, primer_starting_position, comb_on_Tm = exhaustive_research(
        DNA_seq,
        AA_number,
        new_AA,
        Tm_desired,
        find_restriction_site,
        enzyme_list=None)
    megaprimer_dict = megaprimer(DNA_seq, Tm_desired=65)
    return
Пример #3
0
def main():
    #
    # Parse the arguments
    #
    import sys,string
    defaults=get_defaults()
    #
    args=string.join(sys.argv[1:])
    args=string.split(args,'-')
    for arg in args:
        split=string.split(string.strip(arg))
        if split==[]:
            continue
        parm_name=split[0]
        if not defaults.has_key(parm_name):
            raise 'Unknown parameter: ',parm_name
        #
        # Deal with T/F
        #
        if len(split)==1:
            if defaults[parm_name][1]=='T/F':
                if defaults[parm_name][0]:
                    defaults[parm_name][0]=None
                else:
                    defaults[parm_name][0]=1
        #
        # Deal with all the other cases
        #
        elif len(split)==2:
            if defaults[parm_name][1]=='number':
                defaults[parm_name][0]=string.atof(split[1])
            else:
                defaults[parm_name][0]=split[1]
        else:
            raise 'Incorrect usage'
    #
    # Reformat
    #
    params={}
    for key in defaults.keys():
        params[key]=defaults[key][0]
    #
    # Load the file and design the primer
    #
    if not params['seq']:
        usage()
    seq_file=params['seq']
    new_AA=params['mutation'][-1]
    AA_number=int(params['mutation'][1:-1])
    
    
    S=DNA_sequence.sequence()
    DNA_seq=S.readpir(seq_file)
    Tm_desired=params['Tm']
    find_restriction_site=1
    if params['no_restriction_site']:
        find_restriction_site=None
    #
    # Do it!
    #
    import Protool
    X=Protool.structureIO()
    new_AA=X.threetoone[new_AA]
    #
    # Call the function for designing primers
    #
    new_enzymes, primers_results_dict, enzymes_that_already_cut, primer_starting_position,comb_on_Tm = exhaustive_research(DNA_seq,AA_number,new_AA,Tm_desired,find_restriction_site,enzyme_list=None)
    megaprimer_dict =  megaprimer (DNA_seq,Tm_desired=65)
    return