Class: Bio::SPTR

Inherits:
EMBLDB
  • Object
show all
Defined in:
lib/protk/bio_sptr_extensions.rb

Instance Method Summary collapse

Instance Method Details

#accessionsObject

SwissProt Accessions



92
93
94
# File 'lib/protk/bio_sptr_extensions.rb', line 92

def accessions 
  return ""
end

#altnamesObject

All alternate names



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/protk/bio_sptr_extensions.rb', line 68

def altnames
  altnames=""
  
  pname_field=self.de
  entries=pname_field.split(";")
  entries.each do |entry|
    m=entry.match(/\s*(.*?):\s*(.*?)=(.*)/)
    if ( m!=nil)
      if ( (m[1]=="AltName") && (m[2]!="CD_antigen") )
        altnames << "#{m[3]}; "
        
      end
    end
  end
  
  if ( altnames!="") # Get ride of extraneous "; "
    altnames.chop!.chop!
  end
  
  return altnames
end

#cdObject

The CD Antigen name



51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/protk/bio_sptr_extensions.rb', line 51

def cd
  pname_field=self.de
  entries=pname_field.split(";")
  entries.each do |entry|
    m=entry.match(/\s*(.*?):\s*(.*?)=(.*)/)
    if ( m!=nil)
      if ( (m[1]=="AltName") && (m[2]=="CD_antigen") )
        return m[3]
      end
    end
  end
  
  return ""
end

#diseaseObject

Disease



122
123
124
# File 'lib/protk/bio_sptr_extensions.rb', line 122

def disease
  return self.cc["DISEASE"].to_s
end

#domainObject

Domain



132
133
134
# File 'lib/protk/bio_sptr_extensions.rb', line 132

def domain
  return self.cc["DOMAIN"].to_s
end

#ensemblObject

Ensembl accession number



170
171
172
# File 'lib/protk/bio_sptr_extensions.rb', line 170

def ensembl
  return self.safely_get_drentry_for_key("Ensembl")
end

#functionObject

Function



104
105
106
# File 'lib/protk/bio_sptr_extensions.rb', line 104

def function
  return self.cc["FUNCTION"].to_s    
end

#intactObject

Intact accession number



158
159
160
# File 'lib/protk/bio_sptr_extensions.rb', line 158

def intact
  return self.safely_get_drentry_for_key("PRIDE")    
end

#ipiObject

IPI Accession number



152
153
154
# File 'lib/protk/bio_sptr_extensions.rb', line 152

def ipi
  return self.safely_get_drentry_for_key("IPI")
end

#locationObject

Subcellular Location



98
99
100
# File 'lib/protk/bio_sptr_extensions.rb', line 98

def location
  return self.cc["SUBCELLULAR LOCATION"].to_s
end

#nextbioObject

NextBIO accession number



176
177
178
# File 'lib/protk/bio_sptr_extensions.rb', line 176

def nextbio
  return self.safely_get_drentry_for_key("NextBio")
end

#num_transmemObject

Number of transmembrane regions



183
184
185
186
187
188
189
190
191
192
193
# File 'lib/protk/bio_sptr_extensions.rb', line 183

def num_transmem
  begin
    if ( self.ft["TRANSMEM"]==nil)
      return 0.to_s
    else
      return self.ft["TRANSMEM"].length.to_s
    end
  rescue
    p "Warning: Unable to parse feature table for entry #{self.accession}"
  end
end

#prideObject

Pride accession number



164
165
166
# File 'lib/protk/bio_sptr_extensions.rb', line 164

def pride
  return self.safely_get_drentry_for_key("PRIDE")
end

#recnameObject

The recommended name for the Protein



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/protk/bio_sptr_extensions.rb', line 35

def recname
  pname_field=self.de
  entries=pname_field.split(";")
  entries.each do |entry|
    m=entry.match(/\s*(.*?):\s*(.*?)=(.*)/)
    if ( m!=nil)
      if ( m[1]=="RecName")
        return m[3]
      end
    end
  end   
  return ""
end

#safely_get_drentry_for_key(key) ⇒ Object

Helper Function to create links



142
143
144
145
146
147
148
# File 'lib/protk/bio_sptr_extensions.rb', line 142

def safely_get_drentry_for_key(key)
  if ( self.dr[key]==nil)
    return ""
  end

  return dr[key][0][0]
end

#signalpObject

Number of signal peptide features



198
199
200
201
202
203
204
205
206
207
208
# File 'lib/protk/bio_sptr_extensions.rb', line 198

def signalp
  begin
    if ( self.ft["SIGNAL"]==nil)
      return 0.to_s
    else
      return self.ft["SIGNAL"].length.to_s
    end
  rescue
    p "Warning: Unable to parse feature table for entry #{self.accession}"      
  end
end

#similarityObject

Similarity



110
111
112
# File 'lib/protk/bio_sptr_extensions.rb', line 110

def similarity
  return self.cc["SIMILARITY"].to_s    
end

#subunitObject

Subunit



127
128
129
# File 'lib/protk/bio_sptr_extensions.rb', line 127

def subunit
  return self.cc["SUBUNIT"].to_s
end

#tissuesObject

Tissue Specificity



116
117
118
# File 'lib/protk/bio_sptr_extensions.rb', line 116

def tissues
  return self.cc["TISSUE SPECIFICITY"].to_s
end