@@ -46,8 +46,8 @@ compute_V_gene_delineations(gapped_V_alleles, as.IRangesList=FALSE)
4646 \item The data.frame returned by \code {compute_V_gene_delineations()} has
4747 the following additional columns :
4848 \enumerate {
49- \item \code {fwr3_trimmed }: how many nucleotides a sequence is
50- missing on its 3 ' end in order to have a complete FWR3 ;
49+ \item \code {seq_len }: length of the sequence after removal of
50+ the gaps ;
5151 \item \code {starting_gap }: size (in number of nucleotides ) of
5252 gap block located at the very beginning of the sequence
5353 if any (0 if no such block );
@@ -82,10 +82,10 @@ compute_V_gene_delineations(gapped_V_alleles, as.IRangesList=FALSE)
8282
8383\e xamples{
8484## ---------------------------------------------------------------------
85- # # BASIC USAGE
85+ ## 1. USING HUMAN GERMLINE V GENE ALLELE SEQUENCES FROM OGRDB
8686## ---------------------------------------------------------------------
8787## Visit https://ogrdb.airr-community.org/germline_sets/Homo%20sapiens
88- # # for the list of germline sets available for human at OGRDB.
88+ ## for the list of human germline sets available at OGRDB.
8989
9090## Download OGRDB germline gene allele sequences for human locus IGK
9191## to a temporary directory:
@@ -106,9 +106,6 @@ as.character(IGKV_alleles[1:3])
106106IGKV_gene_delinea <- compute_V_gene_delineations(IGKV_alleles)
107107head(IGKV_gene_delinea)
108108
109- # # ---------------------------------------------------------------------
110- # # COMPARE WITH V GENE DELINEATIONS PROVIDED BY AIRR-C JSON FILE
111- # # ---------------------------------------------------------------------
112109## As a sanity check, we' re going to compare ' IGKV_gene_delinea' with
113110# # the V gene delineations provided by the corresponding AIRR-C JSON
114111# # file from OGRDB.
@@ -134,6 +131,51 @@ IGKV_gene_delinea2 <- IGKV_gene_delinea2[ , shared_colnames]
134131# # order):
135132stopifnot(same_ndm_data(IGKV_gene_delinea , IGKV_gene_delinea2 ))
136133
134+ # # Remove temporary directory:
135+ unlink(destdir , recursive = TRUE )
136+
137+ # # ---------------------------------------------------------------------
138+ # # 2. USING MOUSE GERMLINE V GENE ALLELE SEQUENCES FROM OGRDB
139+ # # ---------------------------------------------------------------------
140+ # # Visit https://ogrdb.airr-community.org/germline_sets/Mus%20musculus
141+ # # for the list of mouse germline sets available at OGRDB.
142+
143+ # # Download OGRDB germline V gene allele sequences for locus IGL of
144+ # # mouse strain MSM/MsJ to a temporary directory:
145+ germline_set <- c(`MSM/MsJ IGLV` = 1 )
146+
147+ dir.create(destdir <- tempfile())
148+ download_OGRDB_germline_sequences(" Mus musculus" , germline_set ,
149+ destdir = destdir )
150+
151+ # # List the downloaded files:
152+ list.files(destdir ) # 1 FASTA file
153+
154+ # # Compute the V gene delineations for 'IGKV_alleles':
155+ IGLV_alleles <- file.path(destdir , " IGLV.fasta" )
156+ IGLV_gene_delinea <- compute_V_gene_delineations(IGLV_alleles )
157+ IGLV_gene_delinea
158+
159+ # # Note that for the first two alleles, the length of the **ungapped**
160+ # # sequence (seq_len) is smaller than the FWR3 end position (fwr3_end):
161+ IGLV_gene_delinea [ , c(" fwr3_end" , " seq_len" )]
162+
163+ # # In other words, the sequences of alleles IGLV0-37NY*00 and
164+ # # IGLV0-COOR*00 end before the end of their FWR3.
165+
166+ # # This is reflected in the V gene delineations provided by the
167+ # # corresponding AIRR-C JSON file from OGRDB:
168+ download_OGRDB_germline_json(" Mus musculus" , germline_set ,
169+ destdir = destdir )
170+ list.files(destdir )
171+ ogrdb_json_file <- file.path(destdir , " IGLV.json" )
172+ IGLV_gene_delinea2 <- makeogrannote(ogrdb_json_file )
173+ IGLV_gene_delinea2
174+
175+ # # As you can see, when a V allele sequence ends before the end of
176+ # # its FWR3, the FWR3 end position reported in the AIRR-C JSON file
177+ # # is the position of the last nucleotide in the (ungapped) sequence.
178+
137179# # Remove temporary directory:
138180unlink(destdir , recursive = TRUE )
139181}
0 commit comments