File: sequtil.sqlapi

package info (click to toggle)
libchado-perl 1.23-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 23,976 kB
  • ctags: 10,378
  • sloc: xml: 192,540; sql: 165,945; perl: 28,339; sh: 101; python: 73; makefile: 46
file content (45 lines) | stat: -rw-r--r-- 2,112 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--
-- functions for bio sequences
--

DECLARE FUNCTION reverse_complement(
   residues TEXT)
 RETURNS TEXT;
COMMENT ON FUNCTION reverse_complement(TEXT) IS
 '
Calculates the reverse complement of a DNA sequence. The value of the argument must an an IUPAC compliant string
 ';

-- Requires: gencode module; see modules/sequence/gencode
DECLARE FUNCTION translate_dna(
   residues TEXT)
 RETURNS TEXT;
COMMENT ON FUNCTION translate_dna(TEXT) IS
 '
Translates a DNA sequence to AA sequence based on standard genetic code
 ';

-- Requires: gencode schema; see modules/sequence/gencode
DECLARE FUNCTION translate_dna(
   residues TEXT,
   gencode_id INT)
 RETURNS TEXT;
COMMENT ON FUNCTION translate_dna(TEXT,INT) IS
 '
Translates a DNA sequence to AA sequence based on NCBI genetic code ID (1=standard). See gencode schema module for details
 ';

DECLARE FUNCTION share_exons()
  RETURNS void;
COMMENT ON FUNCTION share_exons() IS
'
This is a function to 'unshare' exons.  It looks for exons that have the same fmin and fmax and belong to the same gene and only keeps one.  The other, redundant exons are marked obsolete in the feature table.  Nothing is done with those features' entries in the featureprop, feature_dbxref, feature_pub, or feature_cvterm tables.  For the moment, I'm assuming that any annotations that they have when this script is run are identical to their non-obsoleted doppelgangers.  If that's not the case, they could be merged via query.  The bulk of this code was contributed by Robin Houston at GeneDB/Sanger Centre.
'

DECLARE FUNCTION order_exons(
    parent_type_id INT)
  RETURNS void;
COMMENT ON FUNCTION order_exons(INT) IS 
 '
This is a function to seek out exons of transcripts and orders them, using feature_relationship.rank, in "transcript order" numbering from 0, taking strand into account. It will not touch transcripts that already have their exons ordered (in case they have a non-obvious ordering due to trans splicing). It takes as an argument the feature.type_id of the parent transcript type (typically, mRNA, although non coding transcript types should work too).
 ';