Skip to content

Commit

Permalink
Changed the names of the parameters
Browse files Browse the repository at this point in the history
fix on vanilla ID mapping
  • Loading branch information
iquasere committed Jul 7, 2023
1 parent 853cf2b commit 652ce7a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Load Docker image
run: docker load --input /tmp/upimapi.tar
- name: IDs inputted through TXT file (comma-separated)
run: docker run upimapi /bin/bash -c "upimapi -i UPIMAPI/ci/ids.csv -rd resources_directory --no-annotation -cols 'Entry&KEGG&Interacts with'"
run: docker run upimapi /bin/bash -c "upimapi -i UPIMAPI/ci/ids.csv -cols 'Entry&KEGG&Interacts with'"

txt-file-newline-separated:
runs-on: ubuntu-latest
Expand All @@ -53,7 +53,7 @@ jobs:
- name: Load Docker image
run: docker load --input /tmp/upimapi.tar
- name: Full IDs inputted through TXT file (newline-separated)
run: docker run upimapi /bin/bash -c "upimapi -i UPIMAPI/ci/full_ids.txt -rd resources_directory --no-annotation"
run: docker run upimapi /bin/bash -c "upimapi -i UPIMAPI/ci/full_ids.txt"

blast-file:
runs-on: ubuntu-latest
Expand All @@ -67,7 +67,7 @@ jobs:
- name: Load Docker image
run: docker load --input /tmp/upimapi.tar
- name: IDs inputted through BLAST file
run: docker run upimapi /bin/bash -c "upimapi -i UPIMAPI/ci/ids.blast -rd resources_directory --no-annotation --blast"
run: docker run upimapi /bin/bash -c "upimapi -i UPIMAPI/ci/ids.blast -rd resources_directory --blast"

get-fasta-sequences:
runs-on: ubuntu-latest
Expand All @@ -81,7 +81,7 @@ jobs:
- name: Load Docker image
run: docker load --input /tmp/upimapi.tar
- name: Obtain FASTA sequences
run: docker run upimapi /bin/bash -c "upimapi -i UPIMAPI/ci/ids.csv -rd resources_directory --no-annotation --fasta"
run: docker run upimapi /bin/bash -c "upimapi -i UPIMAPI/ci/ids.csv -rd resources_directory --fasta"

basic-id-mapping:
runs-on: ubuntu-latest
Expand All @@ -94,7 +94,7 @@ jobs:
path: /tmp
- name: Load Docker image
run: docker load --input /tmp/upimapi.tar
- name: Obtain FASTA sequences
- name: Perform basic ID mapping
run: docker run upimapi /bin/bash -c "upimapi -i UPIMAPI/ci/ids.csv -rd resources_directory --from 'UniProtKB AC/ID' --to 'EMBL/GenBank/DDBJ CDS'"

full-workflow:
Expand Down
10 changes: 5 additions & 5 deletions upimapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ def get_arguments():
parser.add_argument(
"-cols", "--columns", default=None, help="List of UniProt columns to obtain information from (separated by &)")
parser.add_argument(
"--from", default="UniProtKB AC/ID", choices=from_fields.keys(),
"--from-db", default="UniProtKB AC/ID", choices=from_fields.keys(),
help="Which database are the IDs from. If from UniProt, default is fine [UniProtKB AC/ID]")
parser.add_argument(
"--to", default="UniProtKB", choices=to_fields.keys(),
"--to-db", default="UniProtKB", choices=to_fields.keys(),
help="To which database the IDs should be mapped. If only interested in columns information "
"(which include cross-references), default is fine [UniProtKB]")
parser.add_argument(
Expand Down Expand Up @@ -346,7 +346,7 @@ def basic_idmapping_multiprocess(ids, output, from_db, to_db, step=1000, threads


def get_valid_entries(ids):
job_id = submit_id_mapping("UniProtKB_AC-ID", "UniProtKB", ids)
job_id = submit_id_mapping("UniProtKB AC/ID", "UniProtKB", ids)
r = get_id_mapping_results(job_id)
valid_entries = [res["from"] for res in r.json()["results"] if '_' not in res["from"]]
while r.links.get("next", {}).get("url"):
Expand Down Expand Up @@ -1355,16 +1355,16 @@ def upimapi():
return

if not args.skip_id_checking:
# UniProt's API now fails if outdated IDs or entry names are submitted. This function removes those IDs.
ids, not_valid = get_valid_entries_multiprocess(ids, threads=args.threads)
# UniProt's API now fails if outdated IDs or entry names are submitted. This function removes those
with open(f'{args.output}/valid_ids.txt', 'w') as f:
f.write('\n'.join(ids))
with open(f'{args.output}/not_valid_ids.txt', 'w') as f:
f.write('\n'.join(not_valid))

# Get UniProt information
if not args.fasta:
# ID mapping through local information
# ID mapping through local SwissProt information
if args.local_id_mapping:
ids = set(ids) - set(local_id_mapping(
sp_ids, f'{args.resources_directory}/uniprot_sprot.dat', f'{args.resources_directory}/taxonomy.tsv',
Expand Down

0 comments on commit 652ce7a

Please sign in to comment.