Biskit :: Mod :: Aligner :: Aligner :: Class Aligner
[hide private]
[frames] | no frames]

Class Aligner

source code

Take template CA traces and template sequences plus non-template sequences.

Returns a T-Coffee script or T-Coffee alignment

Instance Methods [hide private]
  __init__(self, outFolder='.', log=None, verbose=1, sap=1)
  logWrite(self, msg, force=1)
Write message to log.
str __add_type_code(self, inp)
Try guessing a t_coffee type code for file name and add type code (P for structurem S for sequence and L for library).
str coffee_align_inp(self, input, method=None, out_lib=None, output=None, outfile=None, **kw)
Create a single t_coffee command.
{str:[str]} __default_input_files(self, pdbFiles=None, fasta_templates=None, fasta_sequences=None, fasta_target=None)
Fetch missing fasta and pdb files from standard locations.
  align_for_modeller_inp(self, pdbFiles=None, fasta_templates=None, fasta_sequences=None, fasta_target=None, f_fast_tree=None, f_sequence_tree=None)
Prepare alignment commands for homology modeling.
  repair_lib_file(self, fname)
Msap_pair alignments mess up sequence ids of certain (single-chain?) structures.
  repair_target_fasta(self, fname)
Change target ID to 'target' and remove '|' etc.
  go(self, host=None)
Run the previously added commands, delete internal command list.

Class Variables [hide private]
  F_RESULT_FOLDER = '/t_coffee'
  F_FAST_LIB = F_RESULT_FOLDER+ '/fast_pair.lib'
  F_LALIGN_LIB = F_RESULT_FOLDER+ '/lalign_id_pair.lib'
  F_SAP_LIB = F_RESULT_FOLDER+ '/sap_pair.lib'
  F_STRUCT_ALN = F_RESULT_FOLDER+ '/struct.aln'
  F_FINAL = F_RESULT_FOLDER+ '/final'
  F_COFFEE_LOG = F_RESULT_FOLDER+ '/t_coffee.log'
  F_COFFEE_INP = F_RESULT_FOLDER+ '/t_coffee.inp'
  F_FAST_TREE = F_RESULT_FOLDER+ '/fast_tree.dnd'
  F_SEQ_TREE = F_RESULT_FOLDER+ '/sequence.dnd'
  F_FINAL_ALN = F_FINAL+ '.pir_aln'

Method Details [hide private]

__init__(self, outFolder='.', log=None, verbose=1, sap=1)
(Constructor)

source code 
Parameters:
  • outFolder (str) - base folder for t_coffee output (default: F_RESULT_FOLDER)
  • log (LogFile) - log file instance, if None, STDOUT is used (default: None)
  • verbose (1 | 0) - be verbose
  • sap (1 | 0) - perform structural alignment

logWrite(self, msg, force=1)

source code 

Write message to log.
Parameters:
  • msg (str) - message to print

__add_type_code(self, inp)

source code 

Try guessing a t_coffee type code for file name and add type code (P for structurem S for sequence and L for library).
Parameters:
  • inp (str) - file name
Returns: str
type_code + file name OR file name unchanged

coffee_align_inp(self, input, method=None, out_lib=None, output=None, outfile=None, **kw)

source code 

Create a single t_coffee command.
Parameters:
  • input ([str]) - list of input files
  • method (str) - t_coffee method ('M' is added automatically) (default:None)
  • output ([str]) - output format(s) (default:None)
  • out_lib (str) - output library file if needed (default:None)
  • outfile (str) - output file (base) if needed (default:None)
  • kw (param=value) - additional param=value pairs
Returns: str
t_coffee command

__default_input_files(self, pdbFiles=None, fasta_templates=None, fasta_sequences=None, fasta_target=None)

source code 

Fetch missing fasta and pdb files from standard locations.
Parameters:
  • pdbFiles ([str]) - fetch pdb file from TC.F_COFFEE (default:None)
  • fasta_templates ([str]) - fetch fasta template file from TC.F_FASTA (default:None)
  • fasta_sequences ([str]) - fetch fasta sequence file from SS.F_FASTA_NR (default:None)
  • fasta_target ([str]) - fetch fasta target file from SS.F_FASTA_TARGET (default:None)
Returns: {str:[str]}
dictionary mapping input file class to path(s)

align_for_modeller_inp(self, pdbFiles=None, fasta_templates=None, fasta_sequences=None, fasta_target=None, f_fast_tree=None, f_sequence_tree=None)

source code 

Prepare alignment commands for homology modeling.
Parameters:
  • pdbFiles ([str]) - template PDBs from TC.F_COFFEE (default:None)
  • fasta_templates ([str]) - template sequences from templates/templates.fasta (default:None)
  • fasta_sequences ([str]) - more sequences from SS.F_FASTA_NR (default:None)
  • fasta_target (str) - fasta target files SS.F_FASTA_TARGET (default:None)
  • f_fast_tree (str) - filename of clustalW style guide tree (.dnd)
  • f_sequence_tree (str) - filename of clustalW style guide tree (.dnd)

Note: If verbose==1, the commands are mirrored to t_coffee.inp.

repair_lib_file(self, fname)

source code 

Msap_pair alignments mess up sequence ids of certain (single-chain?) structures.
Parameters:
  • fname (str) - Msap_pair file to repair

Note: Dirty hack..

repair_target_fasta(self, fname)

source code 

Change target ID to 'target' and remove '|' etc. that mess up things in the alignments.
Parameters:
  • fname (str) - fasta file to repair
Raises:

go(self, host=None)

source code 

Run the previously added commands, delete internal command list.
Parameters:
  • host (str) - host name for remote execution (default: None=local execution)
Raises:

Class Variable Details [hide private]

F_RESULT_FOLDER

Value:
'/t_coffee'                                                            
      

F_FAST_LIB

Value:
F_RESULT_FOLDER+ '/fast_pair.lib'                                      
      

F_LALIGN_LIB

Value:
F_RESULT_FOLDER+ '/lalign_id_pair.lib'                                 
      

F_SAP_LIB

Value:
F_RESULT_FOLDER+ '/sap_pair.lib'                                       
      

F_STRUCT_ALN

Value:
F_RESULT_FOLDER+ '/struct.aln'                                         
      

F_FINAL

Value:
F_RESULT_FOLDER+ '/final'                                              
      

F_COFFEE_LOG

Value:
F_RESULT_FOLDER+ '/t_coffee.log'                                       
      

F_COFFEE_INP

Value:
F_RESULT_FOLDER+ '/t_coffee.inp'                                       
      

F_FAST_TREE

Value:
F_RESULT_FOLDER+ '/fast_tree.dnd'                                      
      

F_SEQ_TREE

Value:
F_RESULT_FOLDER+ '/sequence.dnd'                                       
      

F_FINAL_ALN

Value:
F_FINAL+ '.pir_aln'