Contents

1 Introduction

The data preparation is an important step before the BOBaFIT analysis. In this vignete we will explain how to download the TCGA-BRCA dataset(Tomczak, Czerwińska, and Wiznerowicz 2015) the package TCGAbiolink (Colaprico et al. 2015) and how to add information like chromosomal arm and CN value of each segments, which operating principle of the package. Further, here we show the column names of the input file for all the BOBaFIT function.

2 Download from TCGA

To download the TCGCA-BRCA(Tomczak, Czerwińska, and Wiznerowicz 2015), we used the R package TCGAbiolinks (Colaprico et al. 2015)and we construct the query. The query includs Breast Cancer samples analyzed by SNParray method (GenomeWide_SNP6), obtaining their Copy Number (CN) profile.

BiocManager::install("TCGAbiolinks")
library(TCGAbiolinks)

query <- GDCquery(project = "TCGA-BRCA",
                  data.category = "Copy Number Variation",
                  data.type = "Copy Number Segment",
                  sample.type = "Primary Tumor"
                  )

#Selecting first 100 samples using the TCGA barcode 
subset <- query[[1]][[1]]
barcode <- subset$cases[1:100]

TCGA_BRCA_CN_segments <- GDCquery(project = "TCGA-BRCA",
                  data.category = "Copy Number Variation",
                  data.type = "Copy Number Segment",
                  sample.type = "Primary Tumor",
                  barcode = barcode
)

GDCdownload(TCGA_BRCA_CN_segments, method = "api", files.per.chunk = 50)

#prepare a data.frame where working
data <- GDCprepare(TCGA_BRCA_CN_segments, save = TRUE, 
           save.filename= "TCGA_BRCA_CN_segments.txt")

In the last step, a dataframe with the segments of all samples is prepared. However some information are missing, so the dataset is not ready as BOBaFIT input.

3 Columns preparation

Further, here we show the column names of the input file for all the BOBaFIT function.

names(data)
BOBaFIT_names <- c("ID", "chr", "start", "end", "Num_Probes", 
           "Segment_Mean","Sample")
names(data)<- BOBaFIT_names
names(data)

4 Assign the chromosome arm with Popeye

The arm column is an very important information that support the diploid region check ofDRrefit and the chromosome list computation of ComputeNormalChromosome. As it is lacking in the TCGA-BRCAdataset, the function Popeyehas been specially designed to calculate which chromosomal arm the segment belongs to. Thanks to this algorithm, not only the TCGA-BRCA dataset, but any database you want to analyze can be analyzed by any function of BOBaFIT.

library(BOBaFIT)
segments <- Popeye(data)
chr start end width strand ID Num_Probes Segment_Mean Sample arm chrarm
1 62920 21996664 21933745 * 01428281-1653-4839-b5cf-167bc62eb147 12088 -0.4756 TCGA-BH-A18R-01A-11D-A12A-01 p 1p
1 22001786 22002025 240 * 01428281-1653-4839-b5cf-167bc62eb147 2 -7.4436 TCGA-BH-A18R-01A-11D-A12A-01 p 1p
1 22004046 22010750 6705 * 01428281-1653-4839-b5cf-167bc62eb147 2 -2.1226 TCGA-BH-A18R-01A-11D-A12A-01 p 1p
1 22011632 25256850 3245219 * 01428281-1653-4839-b5cf-167bc62eb147 1914 -0.4808 TCGA-BH-A18R-01A-11D-A12A-01 p 1p
1 25266637 25320198 53562 * 01428281-1653-4839-b5cf-167bc62eb147 22 -2.1144 TCGA-BH-A18R-01A-11D-A12A-01 p 1p
1 25320253 30316360 4996108 * 01428281-1653-4839-b5cf-167bc62eb147 2434 -0.4905 TCGA-BH-A18R-01A-11D-A12A-01 p 1p

5 Calculation of the Copy Number

The last step is the computation of the copy number value from the “Segment_Mean” column (logR), with the following formula. At this point the data is ready to be analyzed by the whole package.

#When data coming from SNParray platform are used, the user have to apply the
#compression factor in the formula (0.55). In case of WGS/WES data, the
#correction factor is equal to 1.  
compression_factor <- 0.55
segments$CN <- 2^(segments$Segment_Mean/compression_factor + 1)
chr start end width strand ID Num_Probes Segment_Mean Sample arm chrarm CN
1 62920 21996664 21933745 * 01428281-1653-4839-b5cf-167bc62eb147 12088 -0.4756 TCGA-BH-A18R-01A-11D-A12A-01 p 1p 1.0983004
1 22001786 22002025 240 * 01428281-1653-4839-b5cf-167bc62eb147 2 -7.4436 TCGA-BH-A18R-01A-11D-A12A-01 p 1p 0.0001686
1 22004046 22010750 6705 * 01428281-1653-4839-b5cf-167bc62eb147 2 -2.1226 TCGA-BH-A18R-01A-11D-A12A-01 p 1p 0.1378076
1 22011632 25256850 3245219 * 01428281-1653-4839-b5cf-167bc62eb147 1914 -0.4808 TCGA-BH-A18R-01A-11D-A12A-01 p 1p 1.0911264
1 25266637 25320198 53562 * 01428281-1653-4839-b5cf-167bc62eb147 22 -2.1144 TCGA-BH-A18R-01A-11D-A12A-01 p 1p 0.1392391
1 25320253 30316360 4996108 * 01428281-1653-4839-b5cf-167bc62eb147 2434 -0.4905 TCGA-BH-A18R-01A-11D-A12A-01 p 1p 1.0778690

Session info

## R version 4.2.1 (2022-06-23)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.4 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.15-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.15-bioc/R/lib/libRlapack.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_GB              LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] dplyr_1.0.9      BOBaFIT_1.0.1    BiocStyle_2.24.0
## 
## loaded via a namespace (and not attached):
##   [1] backports_1.4.1             Hmisc_4.7-0                
##   [3] BiocFileCache_2.4.0         plyr_1.8.7                 
##   [5] lazyeval_0.2.2              splines_4.2.1              
##   [7] BiocParallel_1.30.3         GenomeInfoDb_1.32.2        
##   [9] ggplot2_3.3.6               digest_0.6.29              
##  [11] ensembldb_2.20.2            htmltools_0.5.2            
##  [13] magick_2.7.3                fansi_1.0.3                
##  [15] magrittr_2.0.3              checkmate_2.1.0            
##  [17] memoise_2.0.1               BSgenome_1.64.0            
##  [19] cluster_2.1.3               Biostrings_2.64.0          
##  [21] matrixStats_0.62.0          ggbio_1.44.1               
##  [23] prettyunits_1.1.1           jpeg_0.1-9                 
##  [25] colorspace_2.0-3            blob_1.2.3                 
##  [27] rappdirs_0.3.3              xfun_0.31                  
##  [29] crayon_1.5.1                RCurl_1.98-1.7             
##  [31] jsonlite_1.8.0              graph_1.74.0               
##  [33] survival_3.3-1              VariantAnnotation_1.42.1   
##  [35] glue_1.6.2                  polyclip_1.10-0            
##  [37] gtable_0.3.0                zlibbioc_1.42.0            
##  [39] XVector_0.36.0              DelayedArray_0.22.0        
##  [41] plyranges_1.16.0            BiocGenerics_0.42.0        
##  [43] scales_1.2.0                DBI_1.1.3                  
##  [45] GGally_2.1.2                Rcpp_1.0.9                 
##  [47] progress_1.2.2              htmlTable_2.4.1            
##  [49] foreign_0.8-82              bit_4.0.4                  
##  [51] OrganismDbi_1.38.1          Formula_1.2-4              
##  [53] stats4_4.2.1                htmlwidgets_1.5.4          
##  [55] httr_1.4.3                  RColorBrewer_1.1-3         
##  [57] ellipsis_0.3.2              pkgconfig_2.0.3            
##  [59] reshape_0.8.9               XML_3.99-0.10              
##  [61] farver_2.1.1                nnet_7.3-17                
##  [63] sass_0.4.1                  dbplyr_2.2.1               
##  [65] deldir_1.0-6                utf8_1.2.2                 
##  [67] labeling_0.4.2              tidyselect_1.1.2           
##  [69] rlang_1.0.4                 reshape2_1.4.4             
##  [71] AnnotationDbi_1.58.0        munsell_0.5.0              
##  [73] tools_4.2.1                 cachem_1.0.6               
##  [75] cli_3.3.0                   generics_0.1.3             
##  [77] RSQLite_2.2.14              evaluate_0.15              
##  [79] stringr_1.4.0               fastmap_1.1.0              
##  [81] yaml_2.3.5                  knitr_1.39                 
##  [83] bit64_4.0.5                 purrr_0.3.4                
##  [85] KEGGREST_1.36.3             AnnotationFilter_1.20.0    
##  [87] RBGL_1.72.0                 xml2_1.3.3                 
##  [89] biomaRt_2.52.0              compiler_4.2.1             
##  [91] rstudioapi_0.13             filelock_1.0.2             
##  [93] curl_4.3.2                  png_0.1-7                  
##  [95] tibble_3.1.7                tweenr_1.0.2               
##  [97] bslib_0.3.1                 stringi_1.7.8              
##  [99] highr_0.9                   GenomicFeatures_1.48.3     
## [101] lattice_0.20-45             ProtGenerics_1.28.0        
## [103] Matrix_1.4-1                vctrs_0.4.1                
## [105] pillar_1.7.0                lifecycle_1.0.1            
## [107] BiocManager_1.30.18         jquerylib_0.1.4            
## [109] data.table_1.14.2           bitops_1.0-7               
## [111] rtracklayer_1.56.1          GenomicRanges_1.48.0       
## [113] R6_2.5.1                    BiocIO_1.6.0               
## [115] latticeExtra_0.6-30         bookdown_0.27              
## [117] gridExtra_2.3               IRanges_2.30.0             
## [119] codetools_0.2-18            dichromat_2.0-0.1          
## [121] MASS_7.3-58                 assertthat_0.2.1           
## [123] SummarizedExperiment_1.26.1 rjson_0.2.21               
## [125] GenomicAlignments_1.32.0    Rsamtools_2.12.0           
## [127] S4Vectors_0.34.0            GenomeInfoDbData_1.2.8     
## [129] parallel_4.2.1              hms_1.1.1                  
## [131] grid_4.2.1                  rpart_4.1.16               
## [133] tidyr_1.2.0                 NbClust_3.0.1              
## [135] rmarkdown_2.14              MatrixGenerics_1.8.1       
## [137] biovizBase_1.44.0           ggforce_0.3.3              
## [139] Biobase_2.56.0              base64enc_0.1-3            
## [141] interp_1.1-3                restfulr_0.0.15

Colaprico, Antonio, Tiago C. Silva, Catharina Olsen, Luciano Garofano, Claudia Cava, Davide Garolini, Thais S. Sabedot, et al. 2015. “TCGAbiolinks: An R/Bioconductor Package for Integrative Analysis of Tcga Data.” Nucleic Acids Research 44 (8): e71–e71. https://doi.org/10.1093/nar/gkv1507.

Tomczak, Katarzyna, Patrycja Czerwińska, and Maciej Wiznerowicz. 2015. “Review the Cancer Genome Atlas (Tcga): An Immeasurable Source of Knowledge.” Współczesna Onkologia 1A: 68–77. https://doi.org/10.5114/wo.2014.47136.