|
Commands
How to start?Once ModeRNA is installed properly, all of the commands below are available. They can be used by:
In both cases, the first command has to be: from moderna import *
Example files
add_all_modificationsadd_all_modifications(template, alignment, model) Adds all modifications that occur in the target sequence, and are not present in the template.
add_all_modifications(t,a,m)
add_modificationadd_modification(residue, modification_name, model=None, residue_number=None) Adds a modification to a single residue. An RNAModel can be given optionally. If this is given, the modified residue is subsequently copied to it. Note that deoxynucleotides count as modified bases as well.
# add a 2-methyl-Guanosine in position 63.
m = load_model('1QF6_B_tRNA.pdb', 'B')
add_modification(m['63'], 'm2G')
add_pair_to_baseadd_pair_to_base(model, anchor_id, new_id=None, new_sequence=None) Adds Watson-Crick paired second strand to single nucleotide.
add_pair_to_base(m, '2', '20', 'C')
analyze_geometryanalyze_geometry(struc, file_name=None) Analyses geometry of a structure. Checks whether all angles and bonds length values are close to reference values determined from the PDB. Writes the result of the analysis to log file or to an output file when specified.
t = load_template('1QF6_B_tRNA.pdb', 'B')
analyze_geometry(t)
apply_alignmentapply_alignment(template, alignment, model) Applies all operations on single bases that are in an alignment: Copying identical residues, exchanging mismatches, adding modifications, and removing modifications. As a result, all these residues are copied into a model (which may be empty). For gaps in the alignment, nothing is done.
apply_alignment(t,a,m)
apply_all_indelsapply_all_indels(alignment, model) Finds and inserts the best fragment candidate for each gap region in the alignment. This command can be used to fill in gaps automatically. The procedure automatically retrieves the 20 best fitting candidates from the fragment database, checks whether they produce any clashes upon insertion, and inserts the best scoring candidate.
apply_all_indels(a,m)
apply_indelapply_indel(model, res5_number, res3_number, sequence) Finds the best fitting fragment between two residues, and inserts it into the model. The procedure automatically retrieves the 20 best fitting candidates from the fragment database, checks whether they produce any clashes upon insertion, and inserts the best scoring candidate.
# prepare a model
t = load_template('1QF6_B_tRNA.pdb', 'B')
m = create_model()
copy_some_residues(t['31':'35']+t['38':'42'],m)
# Find the best fitting fragment for the missing two
apply_indel(m, '35', '38', 'CA')
apply_missing_endsapply_missing_ends(alignment, model) Attaches an extended fragment of structure at both the 5' and 3' ends of the target, where there is no corresponding part in the template.
apply_missing_ends(a, m)
change_sequencechange_sequence(struc, sequence) Changes the entire sequence of the given structure object, exchanging all nucleotides that differ.
change_sequence(m, 'AGCUAGCU')
clean_structureclean_structure(structure, write_structure=False)
In case some feature cannot be fixed (e.g. chain discontinuity) this is written to the logfile. It is recommended to include such features in the alignment ('.' characters for strange residues, and '_' for backbone breaks).
# cleaning up a loaded template:
# removes water, ions, amino acids, and unknown residues
# replaces O1P and O2P in atom names by OP1 and OP2
# replaces * in atom names by '
clean_structure(t)
copy_identical_residuescopy_identical_residues(template, alignment, model, strict=True, modifications=True) Copies all bases identical identical in the alignment from the template structure to a model. The residue numbers do not change.
copy_identical_residues(t,a,m)
copy_identical_residues(t,a,m,strict=0)
copy_identical_residues(t,a,m,modifications=0)
copy_single_residuecopy_single_residue(residue, model, new_number=None, strict=True) Copies a single residue into the model. The residue can be taken from a Template, or another RnaModel. Residues are specified by their PDB residue number in quotes and square brackets, e.g. template['5']. eventually accompanied by the insertion letter (abbreviated as number). By default, the number of the residue is kept, but it can be given optionally.
copy_single_residue(t['3'],m)
copy_single_residue(t['5A'],m)
copy_single_residue(t['3'],m,'15')
copy_single_residue(m['5A'],m,'100')
copy_single_residue(t['3'],m,'3B',strict=0)
copy_some_residuescopy_some_residues(residue_list, model, new_numbers=None, strict=True) Copies a set of residues into the model. The residues can be taken from a Template, or another RnaModel. Residues are specified by enumerating their numbers in the PDB files, or specifying a range of numbers (by 'num1':'num2'). By default, the numbers of the residues are kept, but they can be given optionally. Note that all residue numbers in ModeRNA have to be quoted.
copy_some_residue(t['3':'5'],m)
copy_some_residue(t['3':'5A'],m)
copy_some_residue([t['3'],t['7'],t['8']],m)
copy_some_residue([t['3'],t['7']],m,new_numbers=['100','101'])
copy_some_residue(t['3':'12'],m,strict=0)
create_fragmentcreate_fragment(pdb_path, anchor5=None, anchor3=None, chain_name='A', sequence=None) To insert small pieces of custom PDB structures into models, fragments can be used. This command loads a fragment, and defines one or two connection points, to which the fragment will be inserted by superposition. It returns a ModernaFragment object. To add a ModernaFragment object to a model, the insert_fragment command should be used. The scenarios for adding either involve superposition of a single residue with the model on the 5' end of the fragment, or on the 3' end, or both.
f = create_fragment('single_strand.pdb',anchor5=m['20'])
f = create_fragment('single_strand.pdb', chain_name='A', anchor3=m['1'])
f = create_fragment('hairpin.pdb', anchor5=m['12'], anchor3=m['15'])
f = create_fragment('hairpin.pdb', anchor5=m['12'], anchor3=m['15'], sequence='AG')
create_modelcreate_model(template=None, alignment=None, model_chain_name=None) Creates a RNA structure model. Produces a RnaModel object that can be saved in a variable (see example). If no arguments are given, an empty RNAModel is created. If both a Template and an Alignment are given as arguments, the complete model is built automatically. The chain id that the model should have can be specified optionally.
m = create_model()
m = create_model(model_chain_name='K')
m = create_model(t,a)
m = create_model(t,a,model_chain_name='K')
delete_residuedelete_residue(residue_number, model) Removes a residue from a RNAModel object.
delete_residue('6',m)
examine_structureexamine_structure(structure) Checks whether the given structure has any features that may cause any problems during the modeling process. The user needs to give a structure object, and optionally a name of the file the report is written to.
# examine a loaded template for irregularities:
examine_structure(t)
examine_structure(t,'logfile.log')
exchange_mismatchesexchange_mismatches(template, alignment, model) Exchanges the bases for all standard base mismatches in an alignment. This applies all exchanges of one standard base by another. Modified bases are not changed (use the apply_alignment command for that).
exchange_mismatches(t,a,m)
exchange_single_baseexchange_single_base(residue, new_name, model=None, new_number=None) Exchanges standard RNA bases in a residue. This can be used to modify residues already in a model, or to exchange and copy them in one step, if an RnaModel is given. It is also possible to modify the template this way! The residue number does not change by default, but a new one can be given.
exchange_single_base(m['3'],'C')
exchange_single_base(t['3'],'G',m)
exchange_single_base(t['3'],'G',m,new_number='5A')
exchange_single_base(t['3'],'G') # modifies the template!
exchange_some_basesexchange_some_bases(residue_list, new_names, model=None, new_numbers=None) Exchanges standard RNA bases in a set of residues. This can be used to modify residues already in a model, or to exchange and copy them in one step, if a RNAModel is given. It is also possible to modify the template this way! The residue numbers are not changed by default, but a list of new one can be given.
exchange_some_bases(m['3':'5'],['C','U','G'])
exchange_some_bases(t['3':'5'],['C','U','G'],m)
exchange_some_bases([t['3'],t['10']],['A','G'],m,['103','106'])
exchange_some_bases(t['3':'5'],['C','U','G']) # modifies the template!
extend_helixextend_helix(model, anchor5_id, anchor3_id, new_sequence=None) Makes a helix longer by adding A-type RNA Watson-Crick base pairs. A helix of any size may be added to the model. A helix may be added at the end or inside an already existing helix.
extend_helix(m, '2', '37', 'CGAA_UUCG')
find_clashesfind_clashes(residues) Detects interatomic clashes (overlapping atom VdW radii) between atoms from two distinct residues. As input, a template, a model or a list of residues is taken. Returns a list of clashing residue pairs. If no clashes are detected, the list is empty.
find_clashes(m)
find_clashes([m['5'], m['6'], m['7']])
pairs = find_clashes(m)
find_fragmentfind_fragment(model, res5_number, res3_number, sequence, number_of_candidates=20, secstruc=None) Searches fragment candidate structures that fit between two given residues. Produces a list of fragments candidate objects. The fragment search sorts candidates according to the geometrical fit of their backbones. As an optional argument, a secondary structure can be specified in dot-bracket format. This restricts the found fragment candidates to those having exactly the same Watson-Crick pairs.
candidates = find_fragment(m, '7', '12', 'AGCU', 20)
insert_fragment(m, candidates[0])
find_modificationsfind_modifications(structure) Reports all modified nucleotides that occur in a structure loaded or created with ModeRNA (models, templates).
# find modifications in any structure file
t = load_template('1QF6_B_tRNA.pdb', 'B')
print find_modifications(t)
fix_backbonefix_backbone(structure) Fixes interrupted backbones between adjacent residues. This function either examines the backbone of all nt in a structure (and repairs them if broken), or only does this for the two residues specified. For repairing, first only the phosphate and adjacent oxygens are remodeled. In case this fails, the FCCD Loop Closing Algorithm (Boomsma/Hamelryck 2005) is used for the entire O3'..C4' segment. If the two residues are far from each other or oriented in a weird angle, the result will be awkward.
m = load_model('broken_bb.pdb','A')
print m.get_sequence()
# check and fix the entire model
fix_backbone(m)
print m.get_sequence()
# check and fix the connection between residues 4 and 5
fix_backbone(m, '4', '5')
get_base_pairsget_base_pairs(structure) Returns a dictionary where keys are residues numbers and values are tuples which each one contains: - residue number interacting with the key-residue - interaction type
bp = get_base_pairs(struc)
print bp
get_secstrucget_secstruc(structure) Retrieves the dot-bracket secondary structure from the coordinates of a structure (template or model). Base pairs (only Watson-Crick pairings AU and GC, and GU Wobble pairs) are indicated by round brackets, all other residues by dots.
get_secstruc(t)
ss = get_secstruc(m)
get_sequenceget_sequence(structure) Retrieves the one-letter-sequence from the coordinates of a structure (template or model). In the sequence, standard RNA bases are denoted by upper case letters, DNA bases by lowercase. For many modifications, one-letter ASCII abbreviations exist (according to McCloskey). All nucleotides that do not have a one-letter abbreviation are represented by the x letter. Nucleotides that cannot be recognized (e.g. base missing) are represented by the '.' character. For determining the sequence, the residues are processed according to their numbers. If an unusually long bond is found anywhere in the backbone between two bases, an additional "_" symbol is inserted in the sequence to mark this discontinuity. Also see http://www.genesilico.pl/modomics
get_sequence(t)
seq = get_sequence(m)
insert_fragmentinsert_fragment(model, fragment) Inserts a fragment object into the model. The model should be the same object, from which the two anchor residues were defined when the fragment was created. (See also documentation of the create_fragment/find_fragment functions.)
insert_fragment(m,f)
insert_two_strand_fragmentinsert_2D_fragment(model, anchor5_id, anchor3_id, anchor5_upper_id, anchor3_upper_id, frag_anchor5_id, frag_anchor3_id, frag_anchor5_upper_id, frag_anchor3_upper_id, fragment_file, chain_name='A') Inserts a given 2D fragment between two pairs of indicated residues. Requires to indicate connecting residues from both model (4) and fragment (4).
insert_two_strand_fragment(m, '2', '37', '5', '34', '101', '120', '107', '114', 'my_fragment.pdb', 'A')
# fragment candidates returned by find_fragment go as well
insert_fragment(m, candidates[2])
load_alignmentload_alignment(file_path) Loads a sequence alignment from a FASTA file. Produces an Alignment object that can be saved in a variable. ModeRNA expects, that the alignment file contains exactly two sequences. The first is for the target for which the model is to be built, the second for the structural template. Standard RNA bases should be written in upper case (ACGU). Standard DNA bases should be written in lower case (acgt). For modified bases, see the 'concepts' section of the manual.
a = load_alignment('alignment_1F1T.fasta')
load_modelload_model(file_path, chain_name='A', data_type='file', template=None, alignment=None) Loads a structure model that has been built previously, or any PDB struture that is then to be modified. Produces a RnaModel object that can be saved in a variable. Each model in ModeRNA contains only one chain. Multi-chain structures can be modeled by using more than one Template/Alignment/RNAModel at a time. By default, RNAModels are created by reading files. They can also be created from BioPython PDB objects (precisely Bio.PDB.Structure.Structure and Bio.PDB.Chain.Chain objects)
m = load_model('1F1T.pdb')
m = load_model('1F1T.pdb','A')
m = load_model(biopy_struc, data_type='structure')
m = load_model(biopy_struc[0].child_list[0], data_type='chain')
load_templateload_template(file_path, chain_name='A') Loads a template structure from a PDB file. Produces a Template object that can be saved in a variable. Each template in ModeRNA has only one chain. By default, the chain with id 'A' is loaded. Another chain id can be specified optionally
t = load_template('1F1T.pdb')
t = load_template('1F1T.pdb','A')
match_alignment_with_modelmatch_alignment_with_model(alignment, model) Checks, if the sequence of a model structure is equal to the first sequence in the alignment. Writes an according message and returns True or False. Both sequences also count as equal if one has modified nucleotides, and the other the corresponding unmodified nucleotides in the same position, or if one of the sequences contains the wildcard symbol '.'. Thus, the sequence "AGU" is equal to both "A7Y" and "A.U".
match_alignment_with_model(a,m)
boolean = match_alignment_with_model(a,m)
match_template_with_alignmentmatch_template_with_alignment(template, alignment) Checks, if the sequence of the template structure is equal to the second sequence in the alignment. Writes an according message and returns True or False. Small inconsistencies between both sequences, e.g. backbone breaks, or missing modification symbols are corrected automatically in the alignment, and changes are reported in the logfile. Both sequences also count as equal if one has modified nucleotides, and the other the corresponding unmodified nucleotides in the same position, or if one of the sequences contains the wildcard symbol '.'. Thus, the sequence "AGU" is equal to both "A7Y" and "A.U".
match_template_with_alignment(t,a)
boolean = match_template_with_alignment(t,a)
remove_all_modificationsremove_all_modifications(model) Removes all base modifications from a given model. The nucleotides are transformed into standard bases from which the modifications originated.
remove_all_modifications(m)
remove_mismatching_modificationsremove_mismatching_modifications(template, alignment, model) Removes all nucleotide modifications that occur in the template, and are not present in the target sequence. The nucleotides are transformed into standard bases from which the modifications originated.
remove_mismatching_modifications(t,a,m)
remove_modificationremove_modification(residue, model=None, new_number=None) Removes base modifications from a single residue. The nucleotide is transformed into the standard base from which the modification originated. A RnaModel can be given optionally. If this is given, the modified residue is subsequently copied to it. Note that desoxynucleotides count as modified bases as well.
remove_modification(m['5'])
remove_modification(t['5'], m)
remove_modification(t['5'], m, '5A')
renumber_chainrenumber_chain(struc, start_id) Changes numeration of residues in the chain. Starts with the given identifier. The new numeration is continuous.
renumber_chain(m,'1')
rotate_chirotate_chi(residue, angle=90) Rotates a base in a given nucleotide around the glycosidic bond (the chi torsion angle, between C1' and N1/N9 atoms).
rotate_chi(m['5'], 90)
shrink_helixshrink_helix(model, anchor5_id, anchor3_id, anchor5_upper_id, anchor3_upper_id) Makes helix shorter - cuts out a helix fragment between given residues from the model.
shrink_helix(m, '2', '37', '5', '34')
write_fragment_candidateswrite_fragment_candidates(fragment_candidates, output_directory='fragment_candidates') Writes a list of fragment candidates to a set of PDB files. The candidates are numbered according to the geometrical fit of their backbones.
candidates = find_fragment(m, '35', '38', 'CA', 20)
write_fragment_candidates(candidates, 'my_candidates')
write_logfilewrite_logfile(logfile_name='moderna.log') Writes a text file with all log messages that ModeRNA generated up to that moment. The log messages in the memory are cleared afterwards. When ModeRNA terminates, any remaining messages will be written to 'moderna.log'
write_logfile()
write_logfile('log.txt')
write_modelwrite_model(model, pdb_file_name='moderna_model.pdb') Writes a model to a PDB file. The residues in the file are sorted. All residues keep their numbers as last assigned.
write_model(m)
write_model(m, 'output.pdb')
write_model(m, 'output.pdb', 'log.txt')
write_secstrucwrite_secstruc(model, file_name='secstruc.vienna') Writes secondary struture to a vienna file.
m = load_model('1F1T.pdb','A')
write_secstruc(m, '1F1T_secondary_structure.vienna')
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|