Пример #1
0
 def get_consensi_tree_filename(self, region, format='newick'):
     '''Get the filename of the consensi tree of the patient'''
     from hivwholeseq.patients.filenames import get_consensi_tree_filename
     return get_consensi_tree_filename(self.name, region, format=format)
            a.calc_ancestral_sequences()
            a.cleanup_tree()

            if VERBOSE >= 2:
                print 'Annotate tree'
            annotate_tree_all(tree, seqs_all, VERBOSE=VERBOSE)

            if VERBOSE >= 2:
                print 'Ladderize tree'
            tree.ladderize()

            correct_minimal_branches(tree)

            if use_save:
                if VERBOSE >= 2:
                    print 'Save tree (JSON)'
                reg_tmp = '_'.join(pcodes)+'_'+region
                fn = get_consensi_tree_filename('all', reg_tmp, format='json')
                tree_json = tree_to_json(tree.root,
                                         fields=('DSI',
                                                 'patient',
                                                 'sequence',
                                                 'muts',
                                                 'VL',
                                                 'CD4',
                                                 'subtype',
                                                 'confidence'),
                                        )
                write_json(tree_json, fn, indent=1)

            a = ancestral_sequences(tree,
                                    ali_all,
                                    alphabet='ACGT-N',
                                    copy_tree=False,
                                    attrname='sequence',
                                    seqtype='str')
            a.calc_ancestral_sequences()
            a.cleanup_tree()

            if VERBOSE >= 2:
                print 'Annotate tree'
            annotate_tree_all(tree, seqs_all, VERBOSE=VERBOSE)

            if VERBOSE >= 2:
                print 'Ladderize tree'
            tree.ladderize()

            correct_minimal_branches(tree)

            if use_save:
                if VERBOSE >= 2:
                    print 'Save tree (JSON)'
                reg_tmp = '_'.join(pcodes) + '_' + region
                fn = get_consensi_tree_filename('all', reg_tmp, format='json')
                tree_json = tree_to_json(
                    tree.root,
                    fields=('DSI', 'patient', 'sequence', 'muts', 'VL', 'CD4',
                            'subtype', 'confidence'),
                )
                write_json(tree_json, fn, indent=1)
Пример #4
0
 def get_consensi_tree_filename(self, region, format='newick'):
     '''Get the filename of the consensi tree of the patient'''
     from hivwholeseq.patients.filenames import get_consensi_tree_filename
     return get_consensi_tree_filename(self.name, region, format=format)