def test_annotateCanonicalOnly(): fileName = ROOT_DIR + '/downloadedStructures/pdb1ehz.ent' models = inputParser.annotate_basepairs(fileName) assert 1 == len(models) assert 18 == len(models[0])
def test_annotateDownloadedfile(): structure_name = '2lbk' file_format = 'pdb' file = inputParser.online_input(structure_name=structure_name, file_format=file_format) models = inputParser.annotate_basepairs(file) assert len(models) == 8
def mcannotate_part(file_path): """ :rtype: void :param file_path: path to pdb file """ base_pairs = inputParser.annotate_basepairs(file_path) models = inputParser.read_complete_models(file_path) for i, (model, base_pair) in enumerate(zip(models, base_pairs)): fixed_base_pairs = inputParser.fix_base_pairs(model, base_pair) joined_chain_model = inputParser.build_txt_strand_from_chains(model) dot_notation = inputParser.make_dot_notation(joined_chain_model, fixed_base_pairs) pretty_print_model(i, joined_chain_model, dot_notation)
def test_build_dot_notation_canonical_only_one_layer(): structure_name = '2lbk' file_format = 'pdb' desired_output = ".(((((.....)))))." file = inputParser.online_input(structure_name=structure_name, file_format=file_format) models = inputParser.read_models_from_pdb_file(file) text_strand = inputParser.build_txt_strand_from_chains(models[0]) base_pairs = inputParser.annotate_basepairs(file) dot_notation = inputParser.make_dot_notation(text_strand, base_pairs[0]) assert desired_output == dot_notation
def test_fix_base_pairs_two_strand_model(): structure_name = '3g78' file_format = 'pdb' file = inputParser.online_input(structure_name=structure_name, file_format=file_format) models = inputParser.read_complete_models(file) base_pairs = inputParser.annotate_basepairs(file)[0] fixed_base_pairs = inputParser.fix_base_pairs(models[0], base_pairs) pair_with_z_strand = [ pair for pair in fixed_base_pairs if pair[1].strand == 'Z' ] assert pair_with_z_strand[0][1].position == 418
def test_build_dot_notation_canonical_huge_structure(): structure_name = '3g78' file_format = 'pdb' desired_count = '-.{[.(.(((<..(((((((((((...(((.......)))..(((((...{{{.{{{...\ )))))..(((...(((..((((.((((((....))))))))))...]>..)))...))).\ ..(((((((((((.(.....)...((((.......(......(...((((((..((((..\ [[[[[.))))...)))).}}}.}}}...))...)......)....)))))))))...)))\ )))...)))))))))))...}))).)(...((((....))))...).......(((.(..\ ..((..........))...))))....(.(((..(((......)))...))).).(((.(\ ((((((((....)))..)))))).)))...----------------------.]]]]]...'.count('.') file = inputParser.online_input(structure_name=structure_name, file_format=file_format) models = inputParser.read_complete_models(file) text_strand = inputParser.build_txt_strand_from_chains(models[0]) base_pairs = inputParser.annotate_basepairs(file) fixed_base_pairs = inputParser.fix_base_pairs(models[0], base_pairs[0]) dot_notation = inputParser.make_dot_notation(text_strand, fixed_base_pairs) assert desired_count < dot_notation.count('.')
def test_annotate(): fileName = ROOT_DIR + '/downloadedStructures/pdb2lbk.ent' models = inputParser.annotate_basepairs(fileName) assert len(models) == 8