forked from enviPath/enviPy
[Feature] External Identifier/References
Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#139
This commit is contained in:
@ -277,6 +277,53 @@ class ExternalDatabase(TimeStampedModel):
|
||||
return self.url_pattern.format(id=identifier_value)
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def get_databases():
|
||||
return {
|
||||
'compound': [
|
||||
{
|
||||
'database': ExternalDatabase.objects.get(name='PubChem Compound'),
|
||||
'placeholder': 'PubChem Compound ID e.g. 12345',
|
||||
}, {
|
||||
'database': ExternalDatabase.objects.get(name='PubChem Substance'),
|
||||
'placeholder': 'PubChem Substance ID e.g. 12345',
|
||||
}, {
|
||||
'database': ExternalDatabase.objects.get(name='KEGG Reaction'),
|
||||
'placeholder': 'KEGG ID including entity Prefix e.g. C12345',
|
||||
}, {
|
||||
'database': ExternalDatabase.objects.get(name='ChEBI'),
|
||||
'placeholder': 'ChEBI ID without prefix e.g. 12345',
|
||||
},
|
||||
],
|
||||
'structure': [
|
||||
{
|
||||
'database': ExternalDatabase.objects.get(name='PubChem Compound'),
|
||||
'placeholder': 'PubChem Compound ID e.g. 12345',
|
||||
}, {
|
||||
'database': ExternalDatabase.objects.get(name='PubChem Substance'),
|
||||
'placeholder': 'PubChem Substance ID e.g. 12345',
|
||||
}, {
|
||||
'database': ExternalDatabase.objects.get(name='KEGG Reaction'),
|
||||
'placeholder': 'KEGG ID including entity Prefix e.g. C12345',
|
||||
}, {
|
||||
'database': ExternalDatabase.objects.get(name='ChEBI'),
|
||||
'placeholder': 'ChEBI ID without prefix e.g. 12345',
|
||||
},
|
||||
],
|
||||
'reaction': [
|
||||
{
|
||||
'database': ExternalDatabase.objects.get(name='KEGG Reaction'),
|
||||
'placeholder': 'KEGG ID including entity Prefix e.g. C12345',
|
||||
}, {
|
||||
'database': ExternalDatabase.objects.get(name='RHEA'),
|
||||
'placeholder': 'RHEA ID without Prefix e.g. 12345',
|
||||
}, {
|
||||
'database': ExternalDatabase.objects.get(name='UniProt'),
|
||||
'placeholder': 'Query ID for UniPro e.g. rhea:12345',
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
class ExternalIdentifier(TimeStampedModel):
|
||||
uuid = models.UUIDField(default=uuid4, editable=False, unique=True)
|
||||
|
||||
Reference in New Issue
Block a user