In [1]:
from rna_pdb_tools_lib import *

In [3]:
import rna_pdb_tools.utils.rna_alignment.rna_alignment as ra

In [4]:
a = ra.RNAalignment(fetch="RF00167")

In [18]:
a.plot()


Rchie: plot saved to rchie.png
Out[18]:

In [9]:
seq = a[0]

In [16]:
len(a)


Out[16]:
133

In [17]:
a.describe()


Out[17]:
'SingleLetterAlphabet() alignment with 133 rows and 113 columns'

In [13]:
seq


Out[13]:
X83878.1/168-267

In [15]:
seq.ss_no_gaps


Out[15]:
':::::::::::::::::(((.(.((((,,,<<<<<<<_______.>>>>>>>.,,,,,,,,<<<<<<<__.._____>>>>>>...>,,)))).))))::::::::::::::.'

In [12]:
seq.draw_ss()


Out[12]:

In [19]:
seq.remove_gaps()

In [23]:
??seq.draw_ss()

In [26]:
??a.find_seq("AAA")

In [27]:
from BlastPDB import *

p = BlastPDB("UUACAAUAUAAUAGGAACAC")
p.search()
print p.result


<HTML>
<TITLE>BLAST Search Results</TITLE>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#660099" ALINK="#660099">
<PRE>
<b>BLASTN 2.2.18 [Mar-02-2008]</b>


<b><a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Retrieve&list_uids
=9254694&dopt=Citation">Reference</a>:</b>
Altschul, Stephen F., Thomas L. Madden, Alejandro A. Sch&auml;ffer, 
Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997), 
"Gapped BLAST and PSI-BLAST: a new generation of protein database search
programs",  Nucleic Acids Res. 25:3389-3402.

<b>Query=</b> UNKNOWN_SEQUENCE
         (20 letters)

<b>Database:</b> pdb_nucleotide 
           17,450 sequences; 3,187,314 total letters

Searching..................................................done

 ***** No hits found ******


<PRE>
  Database: pdb_nucleotide
    Posted date:  Oct 28, 2017 12:38 AM
  Number of letters in database: 3,187,314
  Number of sequences in database:  17,450
  
Lambda     K      H
    1.37    0.711     1.31 

Gapped
Lambda     K      H
    1.37    0.711     1.31 


Matrix: blastn matrix:1 -3
Gap Penalties: Existence: 5, Extension: 2
Number of Sequences: 17450
Number of Hits to DB: 196
Number of sequences better than 10.0: 0
Number of HSP's gapped: 0
Number of HSP's successfully gapped: 0
Length of query: 20
Length of database: 3,187,314
Length adjustment: 12
Effective length of query: 8
Effective length of database: 2,977,914
Effective search space: 23823312
Effective search space used: 23823312
X1: 9 (17.8 bits)
X2: 15 (29.7 bits)
X3: 50 (99.1 bits)
S1: 9 (18.3 bits)
S2: 11 (22.3 bits)
</PRE>
</BODY>
</HTML>

In [28]:
from RfamSearch import *

seq = RNASequence("cGUUGACCCAGGAAACUGGGCGGAAGUAAGGUCCAUUGCACUCCGGGCCUGAAGCAACGCG")
rs = RfamSearch()
hit = rs.cmscan(seq)
print hit


# cmscan :: search sequence(s) against a CM database
# INFERNAL 1.1.2 (July 2016)
# Copyright (C) 2016 Howard Hughes Medical Institute.
# Freely distributed under a BSD open source license.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# query sequence file:                   /var/folders/yc/ssr9692s5fzf7k165grnhpk80000gp/T/tmpnBL2kh.fa
# target CM database:                    /home/magnus/work/db/rfamdb/Rfam.cm
# sequence reporting threshold:          E-value <= 1
# number of worker threads:              4
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Query:       target  [L=61]
Hit scores:
 rank     E-value  score  bias  modelname  start    end   mdl trunc   gc  description
 ----   --------- ------ -----  --------- ------ ------   --- ----- ----  -----------
  (1) !   2.5e-07   36.1   0.0  glnA           1     61 +  cm    no 0.61  -
 ------ inclusion threshold ------
  (2) ?      0.93    8.0   0.0  U1            20     60 +  cm    no 0.61  -


Hit alignments:
>> glnA  
 rank     E-value  score  bias mdl mdl from   mdl to       seq from      seq to       acc trunc   gc
 ----   --------- ------ ----- --- -------- --------    ----------- -----------      ---- ----- ----
  (1) !   2.5e-07   36.1   0.0  cm        3       59 ..           1          61 + [] 0.86    no 0.61

                                                                                    NC
            (((((,<<<<<<<_____>>>>>>>,,,,,,,,<<<<.....~~~~~.........>>>>,,,,))))):: CS
    glnA  3 CGUUCAuCuccccuuuuuggggaGaCGGAAGUAGGca.....*[5]*.........ugCCGAAGGAACGCg 59
            CGUU:A:C:::   +++   :::G:CGGAAGUA:G:                     :C:GAAG:AACGCG
  target  1 CGUUGACCCAG--GAAA---CUGGGCGGAAGUAAGGUccauu*[0]*gcacuccggGCCUGAAGCAACGCG 61
            **********9..8887...9***************876432.....2456778888************** PP

>> U1  
 rank     E-value  score  bias mdl mdl from   mdl to       seq from      seq to       acc trunc   gc
 ----   --------- ------ ----- --- -------- --------    ----------- -----------      ---- ----- ----
  (2) ?      0.93    8.0   0.0  cm       50       90 ..          20          60 + .. 0.96    no 0.61

                     v                      v         NC
            <<<------<<<-<<__________>>-->>->----->>> CS
      U1 50 gGgugaGGucccucCAUUGCACUucGgagggugcugaccCc 90
            G:G  AG    :UCCAUUGCACU CGG  : +    A+C:C
  target 20 GCGGAAGUAAGGUCCAUUGCACUCCGGGCCUGAAGCAACGC 60
            ***************************88889999999*** PP



Internal HMM-only pipeline statistics summary: (run for model(s) with zero basepairs)
--------------------------------------------------------------------------------------
Query sequence(s):                                               1  (122 residues searched)
Target model(s):                                               347  (40911 consensus positions)
Windows   passing  local HMM SSV           filter:               1  (0.001441); expected (0.02)
Windows   passing  local HMM MSV      bias filter:               1  (0.001441); expected (0.02)
Windows   passing  local HMM Viterbi       filter:               0  (0); expected (0.001)
Windows   passing  local HMM Forward       filter:               0  (0); expected (1e-05)
Total HMM hits reported:                                         0  (0)

Internal CM pipeline statistics summary:
----------------------------------------
Query sequence(s):                                               1  (122 residues searched)
Query sequences re-searched for truncated hits:                  1  (356.4 residues re-searched, avg per model)
Target model(s):                                              2126  (267652 consensus positions)
Windows   passing  local HMM SSV           filter:             820  (0.04551); expected (0.35)
Windows   passing  local HMM Viterbi       filter:                  (off)
Windows   passing  local HMM Viterbi  bias filter:                  (off)
Windows   passing  local HMM Forward       filter:             286  (0.01625); expected (0.02)
Windows   passing  local HMM Forward  bias filter:             275  (0.01563); expected (0.02)
Windows   passing glocal HMM Forward       filter:              52  (0.002963); expected (0.02)
Windows   passing glocal HMM Forward  bias filter:              51  (0.002903); expected (0.02)
Envelopes passing glocal HMM envelope defn filter:              49  (0.002636); expected (0.02)
Envelopes passing  local CM  CYK           filter:              10  (0.0005201); expected (0.0001)
Total CM hits reported:                                          2  (0.0001406); includes 1 truncated hit(s)

Total CM and HMM hits reported:                                  2

# CPU time: 2.07u 0.30s 00:00:02.36 Elapsed: 00:00:01.31
//
[ok]


In [ ]: