コード例 #1
0
ファイル: ppi.py プロジェクト: JohnReid/biopsy
 def create_analysis(
         self,
         pssm_names,
         file_tag='',
         max_threshold=0.0
 ):
     print 'Analysing %s' % self.name
     hits, max_chain, unadjusted_hits = biopsy.score_pssms_on_phylo_sequences(
             pssm_names,
             self.converted_seqs,
             threshold = self.threshold,
             phylo_threshold = self.phylo_threshold
     )
     notes = 'Species:\n\t%s\nThreshold: %f\nPhylo: %f' % (
             "\n\t".join( self.seqs.keys() ),
             self.threshold,
             self.phylo_threshold
     )
     self.write_svg(
             filename = '%s/bifa-%s%s.svg' % (self.directory, self.name, file_tag),
             max_threshold = max_threshold,
             notes = notes,
             hits = hits,
             max_chain = max_chain
     )
     return hits, max_chain
コード例 #2
0
ファイル: biopsy_test.py プロジェクト: JohnReid/biopsy
def test_score_fasta():
    print '******** test_score_fasta()'
    sequences = biopsy.SequenceVec()
    for name, seq in biopsy.parse_fasta( 'c:/analysis/keiths/msx1/enhancerD.fa' ).iteritems():
        print name, ':', len( seq ), 'bases'
        sequences.append( seq )
        if len( sequences) >= 3: break
    phylo_result = biopsy.score_pssms_on_phylo_sequences(
            biopsy.get_transfac_pssm_accessions( biopsy.get_default_transfac_pssm_filter() ),
            sequences,
            0.05 )
    print 'Max Chain:'
    print phylo_result[ 1 ]
    # print biopsy.sort_hits_by_position( phylo_result[ 0 ] )
    print 'Got', len( phylo_result[ 0 ] ), 'hits from', len( sequences[ 0 ] ), 'bases'
コード例 #3
0
ファイル: biopsy_test.py プロジェクト: pombredanne/biopsy
def test_score_fasta():
    print '******** test_score_fasta()'
    sequences = biopsy.SequenceVec()
    for name, seq in biopsy.parse_fasta(
            'c:/analysis/keiths/msx1/enhancerD.fa').iteritems():
        print name, ':', len(seq), 'bases'
        sequences.append(seq)
        if len(sequences) >= 3: break
    phylo_result = biopsy.score_pssms_on_phylo_sequences(
        biopsy.get_transfac_pssm_accessions(
            biopsy.get_default_transfac_pssm_filter()), sequences, 0.05)
    print 'Max Chain:'
    print phylo_result[1]
    # print biopsy.sort_hits_by_position( phylo_result[ 0 ] )
    print 'Got', len(phylo_result[0]), 'hits from', len(sequences[0]), 'bases'
コード例 #4
0
ファイル: ppi.py プロジェクト: pombredanne/biopsy
 def create_analysis(self, pssm_names, file_tag='', max_threshold=0.0):
     print 'Analysing %s' % self.name
     hits, max_chain, unadjusted_hits = biopsy.score_pssms_on_phylo_sequences(
         pssm_names,
         self.converted_seqs,
         threshold=self.threshold,
         phylo_threshold=self.phylo_threshold)
     notes = 'Species:\n\t%s\nThreshold: %f\nPhylo: %f' % ("\n\t".join(
         self.seqs.keys()), self.threshold, self.phylo_threshold)
     self.write_svg(filename='%s/bifa-%s%s.svg' %
                    (self.directory, self.name, file_tag),
                    max_threshold=max_threshold,
                    notes=notes,
                    hits=hits,
                    max_chain=max_chain)
     return hits, max_chain