very cool. Thanks !
I'm looking to create a list of regular expressions that can distinguish between the IDs of various databases? I know that some will be ambiguous but at least it could help narrow down which databases to check.
For example:
Kegg IDs: \w{,3}\d{1,}
Entrez IDs: \d*
RefSeq IDs: \w{2}_\d{1,}\.\d{1,}
Anyone have any to add? This might be a useful community resource.
5 answers
Look at the MIRIAM registry:
http://www.ebi.ac.uk/miriam/main/collections/
they have assembled a large collection of expressions for the identifiers/accessions of number of databases.
- dbSNP: rs[0-9]+
- Gene Ontology: GO:[0-9]+
- DOI (from the connotea bookmarklet): (doi:)?s?(10.d{4}/S+)
-
LSID : from http://goo.gl/D6PT1
String legalId = "[A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*\'\"%]*"; String lsidRE = "^[uU][rR][nN]:[lL][sS][iI][dD]:(" + legalID + "):(" + legalID + "):(" + legalID + ")[:]?(" + legalID + ")?$";
For INSDC accession numbers, we have used:
([A-Z]{1}[0–9]{5})|([A–Z]{2}[0−9]{6})|([A–Z]{4}[0−9]{8,9})|([A–Z]{5}[0−9]{7}))(\.[0–9]{1,3})
(Credit to Guy Cocharane at EBI)
Protein Data Bank (PDB):
[0-9][A-Z0-9]{3}
[A-NR-Z][0-9][A-Z][A-Z0-9][A-Z0-9][0-9]
and
[OPQ][0-9][A-Z0-9][A-Z0-9][A-Z0-9][0-9]
For gene annotations in KEGG databases such as
glutamate synthase Glt1, putative; K00264 glutamate synthase (NADPH/NADH) [EC:1.4.1.13 1.4.1.14]
To extract KEGG orthology number (KO)
(^| |\)\])(K[0-9]{5})($| |\)\])
Will work with:
- "K00264 glutamate synthase ... " id at start
- "...putative; K00264 glutamate..." in in middle
- "Glt1, putative; K00264" id at end
- "(K23102 K23010)" round brackets
- "[K23102 K23010]" square brackets
Will exclude:
- " K2041020 " back-extensions
- " AK29310 " front-extensions
_
(^| |\)\])
captures start of a string or preceded by whitespace or has a starting round/square bracket
(K[0-9]{5})
captures the kegg id i.e. K10230, K20310. This can be replaced with the metacyc id format, etc..
($| |\)\] )
captures end of a string or followed by whitespace or has a ending round/square bracket
Log in to answer this question.
changed to community wiki.
very useful topic
Yeah, I've been trying to convert a 'mixed bag' of IDs and I had trouble even placing some of them. Hopefully this will help out.