Did I find the right examples for you? yes no

All Samples(13)  |  Call(0)  |  Derive(0)  |  Import(13)

src/c/o/cogent-1.5.3/cogent/evolve/pairwise_distance.py   cogent(Download)
from __future__ import division
from numpy import log, zeros, float64, int32, array, sqrt, dot, diag, where
from numpy.linalg import det, norm, inv
 
from cogent import DNA, RNA, LoadTable
def get_pyrimidine_indices(moltype):
    """returns pyrimidine indices for the moltype"""
    states = list(moltype)
    if _same_moltype(RNA, moltype):
        return map(states.index, 'CU')
def get_purine_indices(moltype):
    """returns purine indices for the moltype"""
    states = list(moltype)
    if not _same_moltype(RNA, moltype) and not _same_moltype(DNA, moltype):
        raise RuntimeError('Non-nucleic acid MolType')
    def __init__(self, *args, **kwargs):
        super(_NucleicSeqPair, self).__init__(*args, **kwargs)
        if not _same_moltype(DNA, self.moltype) and \
            not _same_moltype(RNA, self.moltype):
            raise RuntimeError('Invalid MolType for this metric')

src/p/y/pycogent-HEAD/cogent/evolve/pairwise_distance.py   pycogent(Download)
from __future__ import division
from numpy import log, zeros, float64, int32, array, sqrt, dot, diag, eye
from numpy.linalg import det, norm, inv, LinAlgError
 
from cogent import DNA, RNA, LoadTable
def get_pyrimidine_indices(moltype):
    """returns pyrimidine indices for the moltype"""
    states = list(moltype)
    if _same_moltype(RNA, moltype):
        return map(states.index, 'CU')
def get_purine_indices(moltype):
    """returns purine indices for the moltype"""
    states = list(moltype)
    if not _same_moltype(RNA, moltype) and not _same_moltype(DNA, moltype):
        raise RuntimeError('Non-nucleic acid MolType')
    def __init__(self, *args, **kwargs):
        super(_NucleicSeqPair, self).__init__(*args, **kwargs)
        if not _same_moltype(DNA, self.moltype) and \
            not _same_moltype(RNA, self.moltype):
            raise RuntimeError('Invalid MolType for this metric')

src/c/o/cogent-1.5.3/cogent/evolve/coevolution.py   cogent(Download)
from cogent.parse.record import FileFormatError
from cogent.evolve.substitution_model import SubstitutionModel
from cogent import LoadSeqs, LoadTree, PROTEIN, RNA
from cogent.core.tree import TreeError
from cogent.core.alignment import seqs_from_fasta, DenseAlignment
 
    if aln.MolType == PROTEIN: mol_type = 'protein'
    elif aln.MolType == RNA: mol_type = 'rna'
    else: raise ValueError, 'Unsupported mol type, must be PROTEIN or RNA.'
 
 
    if aln.MolType == PROTEIN: mol_type = 'protein'
    elif aln.MolType == RNA: mol_type = 'rna'
    else: raise ValueError, 'Unsupported mol type, must be PROTEIN or RNA.'
 

src/p/y/pycogent-HEAD/cogent/evolve/coevolution.py   pycogent(Download)
from cogent.parse.record import FileFormatError
from cogent.evolve.substitution_model import SubstitutionModel
from cogent import LoadSeqs, LoadTree, PROTEIN, RNA
from cogent.core.tree import TreeError
from cogent.core.alignment import seqs_from_fasta, DenseAlignment
 
    if aln.MolType == PROTEIN: mol_type = 'protein'
    elif aln.MolType == RNA: mol_type = 'rna'
    else: raise ValueError, 'Unsupported mol type, must be PROTEIN or RNA.'
 
 
    if aln.MolType == PROTEIN: mol_type = 'protein'
    elif aln.MolType == RNA: mol_type = 'rna'
    else: raise ValueError, 'Unsupported mol type, must be PROTEIN or RNA.'
 

src/e/e/eebprogramming-HEAD/lec10review/5profiles.py   eebprogramming(Download)
#!/usr/bin/env python
# taken from http://pycogent.sourceforge.net/
from cogent.core.profile import Profile
from cogent import LoadSeqs, RNA
aln = LoadSeqs("data/trna_profile.fasta", moltype=RNA)
print '\n'.join(['%s: %.3f'%(c,f) for (c,f) in zip(pf.CharOrder, pf.dataAt(4)) if f!=0])
print pf.toConsensus(fully_degenerate=False)
pf.Alphabet=RNA
print "to consensus"
print pf.toConsensus(fully_degenerate=True)
print pf.toConsensus(cutoff=0.8)
print pf.toConsensus(cutoff=0.6)
loop_profile = Profile(pf.Data[54:60,:], Alphabet=RNA, CharOrder=pf.CharOrder)

src/c/o/cogent-1.5.3/tests/test_evolve/test_coevolution.py   cogent(Download)
    greater_equal, less_equal
from cogent.util.unit_test import TestCase, main
from cogent import DNA, RNA, PROTEIN, LoadTree, LoadSeqs
from cogent.core.alphabet import CharAlphabet
from cogent.maths.stats.util import Freqs
         range(4),['ACGT','AGCT','ACCC','TAGG']),MolType=DNA)
        self.rna_aln = DenseAlignment(data=zip(\
         range(4),['ACGU','AGCU','ACCC','UAGG']),MolType=RNA)
        self.protein_aln = DenseAlignment(data=zip(\
         range(4),['ACGP','AGCT','ACCC','TAGG']),MolType=PROTEIN)
        self.rna_aln4 = DenseAlignment([('A1','AAUU'),('A12','ACGU'),\
            ('A123','UUAA'),('A111','AAA-')],\
            MolType=RNA)
        self.dna_aln4 = DenseAlignment([('A1','AATT'),('A12','ACGT'),\
            ('A123','TTAA'),('A111','AAA?')],\
    def test_coevolve_alignments_validation_moltypes(self):
         """coevolve_alignments_validation: valid for acceptable MolTypes
         """
         aln1 = DenseAlignment(data={'1':'AC','2':'AU'},MolType=RNA)
         aln2 = DenseAlignment(data={'1':'EFW','2':'EGY'},MolType=PROTEIN)
    def test_coevolve_alignments_different_MolType(self):
        """ coevolve_alignments: different MolTypes supported """
        aln1 = DenseAlignment(data={'1':'AC','2':'AU'},MolType=RNA)
        aln2 = DenseAlignment(data={'1':'EFW','2':'EGY'},MolType=PROTEIN)
        combined_aln = DenseAlignment(data={'1':'ACEFW','2':'AUEGY'})

src/p/y/pycogent-HEAD/tests/test_evolve/test_coevolution.py   pycogent(Download)
    greater_equal, less_equal
from cogent.util.unit_test import TestCase, main
from cogent import DNA, RNA, PROTEIN, LoadTree, LoadSeqs
from cogent.core.alphabet import CharAlphabet
from cogent.maths.stats.util import Freqs
         range(4),['ACGT','AGCT','ACCC','TAGG']),MolType=DNA)
        self.rna_aln = DenseAlignment(data=zip(\
         range(4),['ACGU','AGCU','ACCC','UAGG']),MolType=RNA)
        self.protein_aln = DenseAlignment(data=zip(\
         range(4),['ACGP','AGCT','ACCC','TAGG']),MolType=PROTEIN)
        self.rna_aln4 = DenseAlignment([('A1','AAUU'),('A12','ACGU'),\
            ('A123','UUAA'),('A111','AAA-')],\
            MolType=RNA)
        self.dna_aln4 = DenseAlignment([('A1','AATT'),('A12','ACGT'),\
            ('A123','TTAA'),('A111','AAA?')],\
    def test_coevolve_alignments_validation_moltypes(self):
         """coevolve_alignments_validation: valid for acceptable MolTypes
         """
         aln1 = DenseAlignment(data={'1':'AC','2':'AU'},MolType=RNA)
         aln2 = DenseAlignment(data={'1':'EFW','2':'EGY'},MolType=PROTEIN)
    def test_coevolve_alignments_different_MolType(self):
        """ coevolve_alignments: different MolTypes supported """
        aln1 = DenseAlignment(data={'1':'AC','2':'AU'},MolType=RNA)
        aln2 = DenseAlignment(data={'1':'EFW','2':'EGY'},MolType=PROTEIN)
        combined_aln = DenseAlignment(data={'1':'ACEFW','2':'AUEGY'})

src/p/y/pycogent-HEAD/tests/test_evolve/test_pairwise_distance.py   pycogent(Download)
 
from cogent.util.unit_test import TestCase, main
from cogent import LoadSeqs, DNA, RNA, PROTEIN
from cogent.evolve.pairwise_distance import get_moltype_index_array, \
    seq_to_indices, _fill_diversity_matrix, \
class TestPair(TestCase):
    dna_char_indices = get_moltype_index_array(DNA)
    rna_char_indices = get_moltype_index_array(RNA)
    alignment = LoadSeqs(data=[('s1', 'ACGTACGTAC'),
                             ('s2', 'GTGTACGTAC')], moltype=DNA)

src/p/y/pycogent-HEAD/tests/test_core/test_genetic_code.py   pycogent(Download)
#!/usr/bin/env python
""" Unit tests for Genetic Code classes.
"""
from cogent import RNA, DNA
from cogent.core.genetic_code import GeneticCode, GeneticCodeInitError,\

src/p/y/pycogent-HEAD/tests/test_core/test_core_standalone.py   pycogent(Download)
import unittest, os, tempfile
 
from cogent import DNA, RNA, STANDARD_CODON as CODON, PROTEIN, Sequence, \
                LoadSeqs
from cogent.parse.record import FileFormatError
                    'seq3': '--ACGUA-GU---'}
        aln_Dna = LoadSeqs(data=dna, moltype=DNA)
        aln_Rna = LoadSeqs(data=dna, moltype=RNA)
        collect_Dna = LoadSeqs(data=dna, aligned=False, moltype=DNA)
        collect_Rna = LoadSeqs(data=rna, aligned=False, moltype=RNA)

  1 | 2  Next