@@ -64,6 +64,9 @@ julia> uniprotX("Q8VGW6_MOUSE/31-308")
6464```
6565"""
6666function uniprotX (name:: AbstractString ):: AbstractString
67+ if startswith (name, " tr|" ) || startswith (name, " sp|" )
68+ name = name[4 : end ]
69+ end
6770 m = match (rex_uniprotX_Swiss, name)
6871 m != = nothing && return m. captures[1 ]
6972 m = match (rex_uniprot_accession, name)
@@ -101,7 +104,7 @@ function query_uniprot_accession(id)
101104end
102105
103106"""
104- jobID = GPCRAnalysis.map_uniprot_submit(ids, from, to="UniProtKB")
107+ jobID = GPCRAnalysis.map_uniprot_submit(ids, from="UniProtKB_AC-ID" , to="UniProtKB")
105108
106109Submit a list of `ids` to the Uniprot ID mapping service, to convert from ID convention `from` to `to`.
107110The jobID can be used to check the status (`map_uniprot_status`) and retrieve the results (`map_uniprot_retrieve`).
@@ -111,24 +114,24 @@ The jobID can be used to check the status (`map_uniprot_status`) and retrieve th
111114julia> jobID = GPCRAnalysis.map_uniprot_submit(["ENSMUSG00000067064", "ENSMUSG00000057464"], "Ensembl");
112115```
113116"""
114- function map_uniprot_submit (ids:: AbstractString , from:: AbstractString , to:: AbstractString = " UniProtKB" )
117+ function map_uniprot_submit (ids:: AbstractString , from:: AbstractString = " UniProtKB_AC-ID " , to:: AbstractString = " UniProtKB" )
115118 resp = HTTP. post (" https://rest.uniprot.org/idmapping/run" , [],
116- Dict (" from" => from, " to" => " UniProtKB " , " ids" => ids))
119+ Dict (" from" => from, " to" => to , " ids" => ids))
117120 if resp. status == 200
118121 return JSON3. read (String (resp. body))[" jobId" ]
119122 end
120123 return nothing
121124end
122- map_uniprot_submit (ids:: AbstractVector , from :: AbstractString ) = map_uniprot_submit (join (ids, ' ,' ), from )
125+ map_uniprot_submit (ids:: AbstractVector , args ... ) = map_uniprot_submit (join (ids, ' ,' ), args ... )
123126
124127"""
125- status = GPCRAnalysis.map_uniprot_status(jobId )
128+ status = GPCRAnalysis.map_uniprot_status(jobID )
126129
127130Check the status of a Uniprot ID mapping job. Returns `true` if the results are
128131ready. Otherwise, returns the status object.
129132"""
130- function map_uniprot_status (jobId )
131- resp = HTTP. get (" https://rest.uniprot.org/idmapping/status/$jobId " , [" Accept" => " application/json" ])
133+ function map_uniprot_status (jobID )
134+ resp = HTTP. get (" https://rest.uniprot.org/idmapping/status/$jobID " , [" Accept" => " application/json" ]; decompress = true )
132135 if resp. status == 200
133136 status = JSON3. read (String (HTTP. decode (resp)))
134137 haskey (status, " results" ) && return true
@@ -138,12 +141,12 @@ function map_uniprot_status(jobId)
138141end
139142
140143"""
141- result = GPCRAnalysis.map_uniprot_retrieve(jobId )
144+ result = GPCRAnalysis.map_uniprot_retrieve(jobID )
142145
143146Retrieve the results of a Uniprot ID mapping job.
144147"""
145- function map_uniprot_retrieve (jobId )
146- resp = HTTP. get (" https://rest.uniprot.org/idmapping/stream/$jobId " , [" Accept" => " application/json" ])
148+ function map_uniprot_retrieve (jobID )
149+ resp = HTTP. get (" https://rest.uniprot.org/idmapping/stream/$jobID " , [" Accept" => " application/json" ]; decompress = true )
147150 if resp. status == 200
148151 return JSON3. read (String (HTTP. decode (resp)))
149152 end
0 commit comments