Skip to content

Commit 5b04f1d

Browse files
committed
resync TODO and R/utils.R with devel branch
1 parent fdb8ace commit 5b04f1d

2 files changed

Lines changed: 85 additions & 49 deletions

File tree

‎R/utils.R‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77

88

99
### TODO: wmsg() was replaced with this in S4Vectors >= 0.45.1 so drop
10-
### wmsg2() and use wmsg() instead.
10+
### wmsg2() and use wmsg() instead in BioC >= 3.23.
1111
wmsg2 <- function(..., margin=2)
1212
{
1313
width <- getOption("width") - margin
1414
paste0(strwrap(paste0(c(...), collapse=""), width=width),
1515
collapse=paste0("\n", strrep(" ", margin)))
1616
}
1717

18-
### TODO: Move this to S4Vectors (or BiocBaseUtils).
18+
### TODO: load_package_gracefully() was added to S4Vectors 0.47.6 so drop
19+
### this and use S4Vectors:::load_package_gracefully() instead in BioC >= 3.23.
1920
load_package_gracefully <- function(package, ...)
2021
{
2122
if (!requireNamespace(package, quietly=TRUE))
@@ -69,14 +70,16 @@ drop_heading_and_trailing_white_lines <- function(lines)
6970
lines[keep_idx]
7071
}
7172

72-
### Vectorized.
73+
### TODO: has_prefix() was added to S4Vectors 0.47.5 so drop this and
74+
### use S4Vectors:::has_prefix() instead in BioC >= 3.23.
7375
has_prefix <- function(x, prefix)
7476
{
7577
stopifnot(is.character(x), isSingleString(prefix))
7678
substr(x, 1L, nchar(prefix)) == prefix
7779
}
7880

79-
### Vectorized.
81+
### TODO: has_suffix() was added to S4Vectors 0.47.5 so drop this and
82+
### use S4Vectors:::has_suffix() instead in BioC >= 3.23.
8083
has_suffix <- function(x, suffix)
8184
{
8285
stopifnot(is.character(x), isSingleString(suffix))

‎TODO‎

Lines changed: 78 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,62 @@
11
High-priority TODO list
22
=======================
33

4-
- igbrowser() improvements:
4+
o Investigate BIG inconsistency between local IgBLAST and online IgBLAST:
5+
https://www.ncbi.nlm.nih.gov/igblast/
6+
7+
Try to run the former with the -remote option to execute search remotely,
8+
and compare. Collect as much data on this issue as possible and send an
9+
email to the IgBLAST folks at NCBI (blast-help@ncbi.nlm.nih.gov or
10+
nlm-support@nlm.nih.gov).
11+
12+
o Let the user choose what loci to include in the germline dbs that they
13+
install from IMGT. That seems to be of interest when doing TCR sequence
14+
analysis, but not sure about BCR sequence analysis.
15+
In any case this can be achieved by adding the 'loci' argument to
16+
install_IMGT_germline_db(). It would take a character vector of locus
17+
names (i.e. a subset of IGH, IGK, IGL, TRA, TRB, TRG, TRD) or the special
18+
value "auto" (the default) in which case it would download all IG loci
19+
when 'tcr.db' is FALSE and all TR loci when 'tcr.db' is TRUE. Note that
20+
with this interface the user would be able to mix IG and TR loci even
21+
though it's not clear that there's a use case for that so maybe emit a
22+
warning when they do that?
23+
24+
In addition to the above the user should be able to install C-region dbs
25+
with the desired TR loci. So maybe we need an install_IMGT_c_region_db()
26+
for that? All the C-region data is already included in the package so
27+
install_IMGT_c_region_db() wouldn't need to download anything.
28+
29+
o Mismatch/indel summarization:
30+
31+
The goal is to summarize information about the mismatches and indels
32+
between the query sequences (BCR or TCR nucleotide sequences) and the
33+
germline gene alleles sequences that they’re aligned to.
34+
35+
Deliverables:
36+
37+
- tabulate_mismatches(), tabulate_insertions(), tabulate_deletions():
38+
take the AIRR-formatted data.frame and return a matrix of counts
39+
with one row per query sequence (i.e. one row per row in the data.frame)
40+
and 7 columns: fwr1, cdr1, fwr2, cdr2, fwr3, cdr3, fwr4.
41+
By default the counts are for the mismatches/indels at the nucleotide
42+
level. What we counte is the number of nucleotides involved in
43+
mismatches or indels, not the number of events e.g. an insertion
44+
of 3 nucleotides counts for 3 not for 1.
45+
46+
- Discussed at Hyrien lab meeting on Oct 29:
47+
(a) support summarization at amino acid level
48+
(b) report % identity per CDR/FR regions
49+
50+
Questions:
51+
52+
- Should we also add columns for the V, D, J, C regions?
53+
54+
o igbrowser() improvements:
555
- Display pairwise alignment between BCR query sequence and germline
656
V/D/J/C sequences.
757
- Take a look at visualization tool from IMGT/V-QUEST for inspiration.
858

9-
- Implement summarizeMismatches().
10-
The function will take the AIRR data.frame returned by igblastn() as input
11-
and, for each BCR query sequence, identify the positions of the mismatches,
12-
insertions, and deletions in the pairwise alignment. Then it should count
13-
how many of them fall in the following regions:
14-
- V, D, J, C
15-
- FWR1-4, CDR1-3
16-
The counts should be returned in a matrix (or data.frame or tibble?)
17-
with 1 row per query sequence and 11 columns (one per region).
18-
summarizeMismatches() should also have an argument that lets the user
19-
choose whether they want the matrix of counts added to the input AIRR
20-
data.frame as additional columns or not. Should be FALSE by default.
21-
E.g. 'bind.results=FALSE'.
22-
23-
- Maybe implement the following advice given by IgBLAST when using one
59+
o Maybe implement the following advice given by IgBLAST when using one
2460
of the num_alignments_V/D/J arguments:
2561

2662
Warning messages:
@@ -29,17 +65,14 @@ High-priority TODO list
2965
-seqid_file_in <INPUT_FILE_NAME> -seqid_file_out <OUT_FILE_NAME> and use
3066
<OUT_FILE_NAME> as the argument to -seqidlist
3167

32-
- Add igblastp(), a wrapper to the igblastp standalone executable included
33-
in IgBLAST. Requested by Dr Iman Haddad in an email from Aug 12, 2025.
34-
3568

3669
Things to do at BioC 3.22 release time
3770
======================================
3871

39-
- Update README.md:
72+
o Update README.md:
4073
- Update "Install and load igblastr" section.
4174

42-
- Advertize igblastr:
75+
o Advertize igblastr:
4376
- Announce on various bioc-community Slack channels.
4477
- Announce on the FH-Data Slack (fhdata.slack.com) on channels
4578
#r-user-comm and #general.
@@ -51,59 +84,59 @@ Things to do at BioC 3.22 release time
5184
Low-priority TODO list
5285
======================
5386

54-
- Add 'clonotype_out' arg to igblastn(). Add examples in man page and
87+
o Migrate code in R/AIRR-utils.R from OGRDB API v1 to OGRDB API v2.
88+
See OGRDB API v2.0.0 Guide here:
89+
https://github.com/airr-community/ogrdb/blob/master/schema/ogrdb_api_v2_guide.md
90+
91+
o Add igblastp(), a wrapper to the igblastp standalone executable included
92+
in IgBLAST. Requested by Dr Iman Haddad in an email from Aug 12, 2025.
93+
94+
o Add 'clonotype_out' arg to igblastn(). Add examples in man page and
5595
vignette that use this functionality.
5696

57-
- It was mentioned that some people use mixeR to analyse TCR sequences.
97+
o It was mentioned that some people use mixeR to analyse TCR sequences.
5898
How does this compare to using igblastn(..., ig_seqtype="TCR")?
5999

60-
- Add functionality to install/use the updated internal and/or auxiliary
100+
o Add functionality to install/use the updated internal and/or auxiliary
61101
files that are sometimes made available at:
62102
https://ftp.ncbi.nih.gov/blast/executables/igblast/release/patch/
63103
See https://ncbi.github.io/igblast/cook/How-to-set-up.html for the details.
64104

65-
- Add bibliography to vignette. See AuthoringRmdVignettes.Rmd vignette in
105+
o Add bibliography to vignette. See AuthoringRmdVignettes.Rmd vignette in
66106
BiocStyle for how to do this.
67107

68-
- Add Seqinfo to Imports (but wait until BioC 3.23 for that). Note
108+
o Add Seqinfo to Imports (but wait until BioC 3.23 for that). Note
69109
that we'll still need GenomeInfoDb just for list_ftp_dir().
70110

71-
- Clarify provenance of 1279067_1_Paired_sequences.fasta.gz and its licence.
111+
o Clarify provenance of 1279067_1_Paired_sequences.fasta.gz and its licence.
72112
Give appropriate credit. See https://opig.stats.ox.ac.uk/webapps/oas/
73113

74-
- More investigation to assess the consequences of using the static auxiliary
114+
o More investigation to assess the consequences of using the static auxiliary
75115
data included in IgBLAST.
76116

77-
- Try online IgBLAST here https://www.ncbi.nlm.nih.gov/igblast/ and compare
78-
results with igblastr.
79-
80-
- Figure out a way to automatically stamp AIRR germline dbs with a
117+
o Figure out a way to automatically stamp AIRR germline dbs with a
81118
version number that allows to go back in time when needed.
82119

83-
- One should be able to pass the name of an IMGT germline db to
120+
o One should be able to pass the name of an IMGT germline db to
84121
install_IMGT_germline_db(), or a vector of names.
85122

86-
- Improve outfmt7-utils.Rd man page (e.g. document customized format 7
123+
o Improve outfmt7-utils.Rd man page (e.g. document customized format 7
87124
and list_outfmt7_specifiers()) as well as associated unit tests (in
88125
tests/testthat/test-outfmt7-utils.R).
89126

90-
- Make 'num_threads' an explicit argument with default to 4. The doc should
127+
o Make 'num_threads' an explicit argument with default to 4. The doc should
91128
show how to specify a higher but still reasonable custom value based on
92129
detectCores().
93130

94-
- Parse $footer part of output format 7.
131+
o Parse $footer part of output format 7.
95132

96-
- Implement parsing of output formats 3 and 4?
133+
o Implement parsing of output formats 3 and 4?
97134

98-
- Set environment variable IGDATA to point to the internal_data directory.
135+
o Set environment variable IGDATA to point to the internal_data directory.
99136
Note that IGDATA must be set to the **parent** directory of the internal_data
100137
directory.
101138

102-
- Add 'loci' argument to install_IMGT_germline_db(). Set to "IGH+IGK+IGL"
103-
by default but could also be any subset of the 3 loci e.g. "IGH" or
104-
"IGK+IGL" etc...
105-
106-
- Great resource for how to use AIRR Community Reference germline sets with
139+
o Great resource for how to use AIRR Community Reference germline sets with
107140
IgBLAST: https://williamdlees.github.io/receptor_utils/_build/html/airrc_sets_with_igblast.html
108141
In particular, the author seems to be using an OGRDB REST API version 2:
109142
https://ogrdb.airr-community.org/api_v2
@@ -113,7 +146,7 @@ Low-priority TODO list
113146
https://ogrdb.airr-community.org/api
114147
which is poorly documented and is somewhat confusing (see below).
115148

116-
- Investigate the following mysteries about the germline sets provided
149+
o Investigate the following mysteries about the germline sets provided
117150
by AIRR/OGRDB:
118151

119152
1. The OGRDB API at https://ogrdb.airr-community.org/api/ allows downloading
@@ -133,6 +166,6 @@ Low-priority TODO list
133166
and IGLJ) seem to be available.
134167
See https://ogrdb.airr-community.org/germline_sets/Mus%20musculus
135168

136-
- Implement install_AIRR_germline_db(). Will download the germline sequences
169+
o Implement install_AIRR_germline_db(). Will download the germline sequences
137170
from https://ogrdb.airr-community.org/ (link provided by Kellie).
138171

0 commit comments

Comments
 (0)