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 self.ac
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


185
186
187
# File 'lib/protk/bio_sptr_extensions.rb', line 185

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

211
212
213
# File 'lib/protk/bio_sptr_extensions.rb', line 211

def ensembl_link
  return "http://www.ensembl.org/Homo_sapiens/Transcript/Summary?db=core;t=#{self.ensembl}"
end

#feature_dumpObject


260
261
262
# File 'lib/protk/bio_sptr_extensions.rb', line 260

def feature_dump
  return self.ft.to_s
end

#functionObject

Function


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

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

#go_entriesObject


166
167
168
# File 'lib/protk/bio_sptr_extensions.rb', line 166

def go_entries
  return self.dr["GO"]
end

#go_termsObject


157
158
159
160
161
162
163
164
# File 'lib/protk/bio_sptr_extensions.rb', line 157

def go_terms
  terms = self.dr["GO"]
  if terms
    return terms.collect { |e| e[0] }
  else
    return nil
  end
end

#intactObject

Intact accession number


173
174
175
# File 'lib/protk/bio_sptr_extensions.rb', line 173

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

203
204
205
# File 'lib/protk/bio_sptr_extensions.rb', line 203

def intact_link
  return "http://www.ebi.ac.uk/intact/pages/interactions/interactions.xhtml?query=#{self.intact}*"
end

#ipiObject

IPI Accession number


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

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

#ncbi_taxon_idObject


252
253
254
# File 'lib/protk/bio_sptr_extensions.rb', line 252

def ncbi_taxon_id
  return self.ox["NCBI_TaxID"]
end

#nextbioObject

NextBIO accession number


191
192
193
# File 'lib/protk/bio_sptr_extensions.rb', line 191

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

199
200
201
# File 'lib/protk/bio_sptr_extensions.rb', line 199

def nextbio_link
  return "http://www.nextbio.com/b/home/home.nb?id=#{self.nextbio}&type=feature"
end

#num_transmemObject

Number of transmembrane regions


217
218
219
220
221
222
223
224
225
226
227
# File 'lib/protk/bio_sptr_extensions.rb', line 217

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


179
180
181
# File 'lib/protk/bio_sptr_extensions.rb', line 179

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

207
208
209
# File 'lib/protk/bio_sptr_extensions.rb', line 207

def pride_link
  return "http://www.ebi.ac.uk/pride/searchSummary.do?queryTypeSelected=identification%20accession%20number&identificationAccessionNumber=#{self.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

#ref_dumpObject


244
245
246
# File 'lib/protk/bio_sptr_extensions.rb', line 244

def ref_dump
  return self.ref.to_s
end

#safely_get_drentry_for_key(key) ⇒ Object

Helper Function to create links


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

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

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

#seq_dumpObject


248
249
250
# File 'lib/protk/bio_sptr_extensions.rb', line 248

def seq_dump
  return self.seq.to_s
end

#signalpObject

Number of signal peptide features


232
233
234
235
236
237
238
239
240
241
242
# File 'lib/protk/bio_sptr_extensions.rb', line 232

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

#species_dumpObject


256
257
258
# File 'lib/protk/bio_sptr_extensions.rb', line 256

def species_dump
  return self.os.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

195
196
197
# File 'lib/protk/bio_sptr_extensions.rb', line 195

def uniprot_link
  return "http://www.uniprot.org/uniprot/#{self.accession}.html"
end