Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(26)  |  Call(18)  |  Derive(0)  |  Import(8)

src/c/o/cogent-1.5.3/tests/test_parse/test_flowgram_collection.py   cogent(Download)
from cogent.core.sequence import Sequence
 
from cogent.parse.flowgram_collection import FlowgramCollection, flows_from_array,\
     flows_from_generic,flows_from_kv_pairs,flows_from_empty,flows_from_dict,\
     flows_from_sff,assign_sequential_names,flows_from_flowCollection,\
    def test_flows_from_flowCollection(self):
        """flows_from_flowCollection should init from existing collection"""
        c = FlowgramCollection({'a':'0.0 1.1 3.0 1.0','b':'0.5 1.0 4.0 0.0'})
        obs_a, obs_labels, obs_info = flows_from_flowCollection(c)
        self.assertEqual(map(str,obs_a), ['0.0\t1.1\t3.0\t1.0',
             Flowgram('1.5 1.0 0.0 0.0 2.5 1.0 2.0 1.0', Name = 'b',
              header_info = {'Bases':'TTATTTACCG','Name Length':'14'})]
        f = FlowgramCollection(a, header_info = {'Flow Chars':'TACG'})
 
        self.assertEqual(str(f), """Common Header:\n  Flow Chars:\tTACG\n\n>a\n  Name Length:\t14\nBases:\tTACCCCTTGG\nFlowgram:\t0.5\t1.0\t4.0\t0.0\t1.5\t0.0\t0.0\t2.0\n\n>b\n  Name Length:\t14\nBases:\tTTATTTACCG\nFlowgram:\t1.5\t1.0\t0.0\t0.0\t2.5\t1.0\t2.0\t1.0\n""")        
             ('b','1.5 1.0 0.0 0.0 2.5 1.0 2.0 1.0'),
             ('c','2.5 0.0 4.0 0.0 0.5 1.0 0.0 1.0')]
        f = FlowgramCollection(a)
        self.assertEqual(len(f), 3)
 
             Flowgram('1.5 1.0 0.0 0.0 2.5 1.0 2.0 1.0', Name = 'b',
              header_info = {'Bases':'TTATTTACCG','Name Length':'14'})]
        f = FlowgramCollection(a, header_info = {'Flow Chars':'TACG'})
        fn = mktemp(suffix='.sff')
        f.writeToFile(fn)

src/p/y/pycogent-HEAD/tests/test_parse/test_flowgram_collection.py   pycogent(Download)
from cogent.core.sequence import Sequence
 
from cogent.parse.flowgram_collection import FlowgramCollection, flows_from_array,\
     flows_from_generic,flows_from_kv_pairs,flows_from_empty,flows_from_dict,\
     flows_from_sff,assign_sequential_names,flows_from_flowCollection,\
    def test_flows_from_flowCollection(self):
        """flows_from_flowCollection should init from existing collection"""
        c = FlowgramCollection({'a':'0.0 1.1 3.0 1.0','b':'0.5 1.0 4.0 0.0'})
        obs_a, obs_labels, obs_info = flows_from_flowCollection(c)
        self.assertEqual(map(str,obs_a), ['0.0\t1.1\t3.0\t1.0',
             Flowgram('1.5 1.0 0.0 0.0 2.5 1.0 2.0 1.0', Name = 'b',
              header_info = {'Bases':'TTATTTACCG','Name Length':'14'})]
        f = FlowgramCollection(a, header_info = {'Flow Chars':'TACG'})
 
        self.assertEqual(str(f), """Common Header:\n  Flow Chars:\tTACG\n\n>a\n  Name Length:\t14\nBases:\tTACCCCTTGG\nFlowgram:\t0.5\t1.0\t4.0\t0.0\t1.5\t0.0\t0.0\t2.0\n\n>b\n  Name Length:\t14\nBases:\tTTATTTACCG\nFlowgram:\t1.5\t1.0\t0.0\t0.0\t2.5\t1.0\t2.0\t1.0\n""")        
             ('b','1.5 1.0 0.0 0.0 2.5 1.0 2.0 1.0'),
             ('c','2.5 0.0 4.0 0.0 0.5 1.0 0.0 1.0')]
        f = FlowgramCollection(a)
        self.assertEqual(len(f), 3)
 
             Flowgram('1.5 1.0 0.0 0.0 2.5 1.0 2.0 1.0', Name = 'b',
              header_info = {'Bases':'TTATTTACCG','Name Length':'14'})]
        f = FlowgramCollection(a, header_info = {'Flow Chars':'TACG'})
        fn = mktemp(suffix='.sff')
        f.writeToFile(fn)

src/q/i/qiime-1.8.0/qiime/denoiser/flowgram_clustering.py   qiime(Download)
from cogent.parse.flowgram_parser import lazy_parse_sff_handle
from cogent.parse.flowgram import Flowgram, seq_to_flow
from cogent.parse.flowgram_collection import FlowgramCollection
from cogent.parse.fasta import MinimalFastaParser
 

src/q/i/qiime-1.8.0/tests/test_denoise_wrapper.py   qiime(Download)
from qiime.util import get_tmp_filename
from cogent.parse.flowgram import Flowgram
from cogent.parse.flowgram_collection import FlowgramCollection
from cogent.parse.flowgram_parser import get_header_info
from qiime.denoise_wrapper import fast_denoiser, extract_cluster_size
    def setUp(self):
        self.file_content = file_content
        self.header = get_header_info(header.split('\n'))
        self.small_flowgram_collection = FlowgramCollection(flowgrams, header_info=self.header)
        self.large_flowgram_collection = FlowgramCollection(large_example, header_info=self.header)

src/q/i/qiime-1.8.0/tests/test_denoiser/test_utils.py   qiime(Download)
from cogent.parse.fasta import MinimalFastaParser
from cogent.parse.flowgram import Flowgram
from cogent.parse.flowgram_collection import FlowgramCollection
from cogent.app.util import ApplicationNotFoundError
from qiime.util import get_tmp_filename
   def test_container(self):
      """FlowgramContainerFile works as expected"""
 
      fc = FlowgramCollection({'a':'1.0 0.0 0.0 1.0 1.0 1.2 1.2 0.8',
                                'b':'1.2 1.0 0.0 0.8 1.2 2.4 1.0 0.0'})
   def test_container(self):
      """FlowgramContainerArray works as expectected"""
 
      fc = FlowgramCollection({'a':'1.0 0.0 0.0 1.0 1.0 1.2 1.2 0.8',
                                'b':'1.2 1.0 0.0 0.8 1.2 2.4 1.0 0.0'})

src/q/i/qiime-1.8.0/tests/test_denoiser/test_preprocess.py   qiime(Download)
from cogent.util.unit_test import TestCase, main
from cogent.parse.fasta import MinimalFastaParser
from cogent.parse.flowgram_collection import FlowgramCollection
from cogent.parse.flowgram import Flowgram
 
   def test_average_flowgrams(self):
       """_average_flowgrams computes an averaged flowgram for each cluster."""
 
       fc = FlowgramCollection({'a':'1.0 0.0 0.0 1.0 1.0 1.2 1.2 0.8',
                                'b':'1.2 1.0 0.0 0.8 1.2 2.4 1.0 0.0'})
   def test_prefix_filter_flowgrams(self):
       """prefix_filter_flowgrams maps all flowgrams which are exact prefixe."""
 
       fc = FlowgramCollection({'a':'1.0 0.0 0.0 1.0 1.0 1.2 1.2 0.8',
                                'b':'1.2 1.0 0.0 0.8 1.2 2.4 1.0 0.0',

src/q/i/qiime-1.8.0/tests/test_denoiser/test_flowgram_filter.py   qiime(Download)
from cogent.util.unit_test import TestCase, main
from cogent.parse.fasta import MinimalFastaParser
from cogent.parse.flowgram_collection import FlowgramCollection
from cogent.parse.flowgram import Flowgram
from cogent.parse.flowgram_parser import lazy_parse_sff_handle

src/q/i/qiime-1.8.0/tests/test_denoiser/test_flowgram_clustering.py   qiime(Download)
from cogent.core.sequence import Sequence
from cogent.parse.flowgram import Flowgram
from cogent.parse.flowgram_collection import parse_sff, FlowgramCollection
from cogent.app.util import ApplicationNotFoundError
from qiime.util import get_tmp_filename