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

All Samples(151)  |  Call(134)  |  Derive(0)  |  Import(17)

src/c/o/cogent-1.5.3/cogent/parse/flowgram_parser.py   cogent(Download)
from itertools import izip
 
from cogent.parse.flowgram import Flowgram
from cogent.parse.record_finder import LabeledRecordFinder, is_fasta_label,\
     DelimitedRecordFinder, is_empty
        flowgram = t["Flowgram"]
        del t["Flowgram"]
        flows.append(Flowgram(flowgram, Name = t["Name"],
                              floworder =head["Flow Chars"], header_info = t))
    return flows, head
        flowgram = t["Flowgram"]
        del t["Flowgram"]
        flowgram = Flowgram(flowgram, Name = t["Name"],
                            KeySeq=header["Key Sequence"],
                            floworder = header["Flow Chars"],

src/p/y/pycogent-HEAD/cogent/parse/flowgram_parser.py   pycogent(Download)
from itertools import izip
 
from cogent.parse.flowgram import Flowgram
from cogent.parse.record_finder import LabeledRecordFinder, is_fasta_label,\
     DelimitedRecordFinder, is_empty
        flowgram = t["Flowgram"]
        del t["Flowgram"]
        flows.append(Flowgram(flowgram, Name = t["Name"],
                              floworder =head["Flow Chars"], header_info = t))
    return flows, head
        flowgram = t["Flowgram"]
        del t["Flowgram"]
        flowgram = Flowgram(flowgram, Name = t["Name"],
                            KeySeq=header["Key Sequence"],
                            floworder = header["Flow Chars"],

src/q/i/qiime-1.8.0/qiime/denoiser/preprocess.py   qiime(Download)
from cogent.parse.fasta import MinimalFastaParser
from qiime.util import get_tmp_filename
from cogent.parse.flowgram import Flowgram, build_averaged_flowgram
from cogent.parse.flowgram_parser import lazy_parse_sff_handle
 
                #now average
                ave_flowgram = build_averaged_flowgram(flows[key])
                ave_f = Flowgram(ave_flowgram, Name=key)
 
                del(flows[key])

src/c/o/cogent-1.5.3/cogent/parse/flowgram_collection.py   cogent(Download)
from cogent.core.sequence import Sequence
from cogent.parse.flowgram_parser import parse_sff
from cogent.parse.flowgram import Flowgram
from cogent.core.alignment import SequenceCollection
 
 
        self.flow_str= flows  
        self.flows = [Flowgram(f,n,keyseq,floworder, i)\
                      for f,n, i in zip(flows,self.Names,info)]
 
                    flow.append(pick_from_prob_density(probs[0],bin_size))
 
        flows.append((name, Flowgram(flow, id, keyseq, floworder)))
    if keyseq is not None:
        keylen = len(keyseq)

src/p/y/pycogent-HEAD/cogent/parse/flowgram_collection.py   pycogent(Download)
from cogent.core.sequence import Sequence
from cogent.parse.flowgram_parser import parse_sff
from cogent.parse.flowgram import Flowgram
from cogent.core.alignment import SequenceCollection
 
 
        self.flow_str= flows  
        self.flows = [Flowgram(f,n,keyseq,floworder, i)\
                      for f,n, i in zip(flows,self.Names,info)]
 
                    flow.append(pick_from_prob_density(probs[0],bin_size))
 
        flows.append((name, Flowgram(flow, id, keyseq, floworder)))
    if keyseq is not None:
        keylen = len(keyseq)

src/c/o/cogent-1.5.3/tests/test_parse/test_flowgram.py   cogent(Download)
 
from cogent.core.sequence import Sequence
from cogent.parse.flowgram import Flowgram, build_averaged_flowgram
 
from cogent.parse.flowgram_parser import parse_sff
 
class FlowgramTests(TestCase):
    def test_init_empty(self):
        """Flowgram should init correctly."""
        f = Flowgram()
    def test_init_data(self):
        """Flowgram init with data should set data in correct location"""
        f = Flowgram('0.5 1.0 4.0 0.0', Name = 'a',KeySeq = "ATCG",
                     floworder = "TACG", header_info = {'Bases':'TACCCC'})
        self.assertEqual(f._flowgram, '0.5 1.0 4.0 0.0')
        self.assertEqual(f.header_info, {'Bases':'TACCCC'})
 
        f = Flowgram([0.5, 1.0, 4.0, 0.0], Name = 'a',KeySeq = "ATCG",
                     floworder = "TACG", header_info = {'Bases':'TACCCC'})
        self.assertEqual(f._flowgram, '0.5 1.0 4.0 0.0')
        self.assertEqual(f.flowgram, [0.5, 1.0, 4.0, 0.0])
 
    def test_cmpSeqToString(self):
        """Sequence should compare equal to same string."""
        f = Flowgram('0.5 1.0 4.0 0.0', Name = 'a',floworder = "TACG",

src/p/y/pycogent-HEAD/tests/test_parse/test_flowgram.py   pycogent(Download)
 
from cogent.core.sequence import Sequence
from cogent.parse.flowgram import Flowgram, build_averaged_flowgram
 
from cogent.parse.flowgram_parser import parse_sff
 
class FlowgramTests(TestCase):
    def test_init_empty(self):
        """Flowgram should init correctly."""
        f = Flowgram()
    def test_init_data(self):
        """Flowgram init with data should set data in correct location"""
        f = Flowgram('0.5 1.0 4.0 0.0', Name = 'a',KeySeq = "ATCG",
                     floworder = "TACG", header_info = {'Bases':'TACCCC'})
        self.assertEqual(f._flowgram, '0.5 1.0 4.0 0.0')
        self.assertEqual(f.header_info, {'Bases':'TACCCC'})
 
        f = Flowgram([0.5, 1.0, 4.0, 0.0], Name = 'a',KeySeq = "ATCG",
                     floworder = "TACG", header_info = {'Bases':'TACCCC'})
        self.assertEqual(f._flowgram, '0.5 1.0 4.0 0.0')
        self.assertEqual(f.flowgram, [0.5, 1.0, 4.0, 0.0])
 
    def test_cmpSeqToString(self):
        """Sequence should compare equal to same string."""
        f = Flowgram('0.5 1.0 4.0 0.0', Name = 'a',floworder = "TACG",

src/q/i/qiime-1.8.0/tests/test_denoiser/test_utils.py   qiime(Download)
from cogent import Sequence
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
      self.tmp_filename = tmp_filename
 
      flow1 = Flowgram("0 1.2 2.1 3.4 0.02 0.01 1.02 0.08")
      append_to_flowgram_file("test_id", flow1, fh)
 
      flow2 = Flowgram('0.5 1.0 4.1 0.0 0.0 1.23 0.0 3.1',      

src/c/o/cogent-1.5.3/tests/test_parse/test_flowgram_collection.py   cogent(Download)
     pick_from_prob_density, seqs_to_flows
 
from cogent.parse.flowgram import Flowgram
from cogent.core.alignment import SequenceCollection
from tempfile import mktemp
    def test_flows_from_generic(self):
        """flows_from_flow should initialize from list of flowgram objects"""
        c = Flowgram('0.0 1.1 3.0 1.0', Name='a')
        b = Flowgram('0.5 1.0 4.0 0.0', Name = 'b')
        obs_a, obs_labels, obs_info = flows_from_generic([c,b])
        self.assertEqual(obs_info, [None,None])
 
        c =[['a',Flowgram('0.0 1.1 3.0 1.0')],['b',Flowgram('0.5 1.0 4.0 0.0')]]
        obs_a, obs_labels, obs_info = flows_from_kv_pairs(c)
        self.assertEqual(map(str,obs_a), ['0.0\t1.1\t3.0\t1.0','0.5\t1.0\t4.0\t0.0'])

src/p/y/pycogent-HEAD/tests/test_parse/test_flowgram_collection.py   pycogent(Download)
     pick_from_prob_density, seqs_to_flows
 
from cogent.parse.flowgram import Flowgram
from cogent.core.alignment import SequenceCollection
from tempfile import mktemp
    def test_flows_from_generic(self):
        """flows_from_flow should initialize from list of flowgram objects"""
        c = Flowgram('0.0 1.1 3.0 1.0', Name='a')
        b = Flowgram('0.5 1.0 4.0 0.0', Name = 'b')
        obs_a, obs_labels, obs_info = flows_from_generic([c,b])
        self.assertEqual(obs_info, [None,None])
 
        c =[['a',Flowgram('0.0 1.1 3.0 1.0')],['b',Flowgram('0.5 1.0 4.0 0.0')]]
        obs_a, obs_labels, obs_info = flows_from_kv_pairs(c)
        self.assertEqual(map(str,obs_a), ['0.0\t1.1\t3.0\t1.0','0.5\t1.0\t4.0\t0.0'])

  1 | 2  Next