Export annotation from GenomicInteractions package
1
0
Entering edit mode
ls760 • 0
@ls760-20976
Last seen 4.5 years ago

Hi All!

I am using the R package GenomicInteractions to import HiC data from a bedpe format. I'd like to annotate them with some bed files coming from ChiP experiments. I used the function annotateInteractions() and it looks like is working fine, but how and where are this information stored? I've tried to exporte them using the varies export.x() functions but none of them is giving me what I am loocking for.

In my mind I have a fine file resemble this line: Chromosomeregion1 Startregion1 Endregion1 Annotationregion1 Chromosomeregion2 Startregion2 Endregion2 Annotationregion2

which is something the package is doing, because it can plot and count the annotations of the two nodes.

Here the systeminfo()

R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Scientific Linux 7.6 (Nitrogen)

Matrix products: default
BLAS: /rds/project/who1000-1/rds-who1000-cbrc/user/cbrcmod/modules/out/modulebin/R/3.5.0/lib/R/lib/libRblas.so
LAPACK: /rds/project/who1000-1/rds-who1000-cbrc/user/cbrcmod/modules/out/modulebin/R/3.5.0/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] GenomicInteractions_1.16.0  InteractionSet_1.10.0      
 [3] SummarizedExperiment_1.12.0 DelayedArray_0.8.0         
 [5] BiocParallel_1.16.6         matrixStats_0.54.0         
 [7] Biobase_2.42.0              GenomicRanges_1.34.0       
 [9] GenomeInfoDb_1.18.2         IRanges_2.16.0             
[11] S4Vectors_0.20.1            BiocGenerics_0.28.0        

loaded via a namespace (and not attached):
 [1] ProtGenerics_1.14.0       bitops_1.0-6             
 [3] bit64_0.9-7               RColorBrewer_1.1-2       
 [5] progress_1.2.0            httr_1.4.0               
 [7] tools_3.5.0               backports_1.1.3          
 [9] R6_2.4.0                  rpart_4.1-13             
[11] Hmisc_4.2-0               DBI_1.0.0                
[13] lazyeval_0.2.1            Gviz_1.26.5              
[15] colorspace_1.4-0          nnet_7.3-12              
[17] tidyselect_0.2.5          gridExtra_2.3            
[19] prettyunits_1.0.2         bit_1.1-14               
[21] curl_3.3                  compiler_3.5.0           
[23] htmlTable_1.13.1          rtracklayer_1.42.2       
[25] scales_1.0.0              checkmate_1.9.1          
[27] stringr_1.4.0             digest_0.6.18            
[29] Rsamtools_1.34.1          foreign_0.8-71           
[31] XVector_0.22.0            base64enc_0.1-3          
[33] dichromat_2.0-0           pkgconfig_2.0.2          
[35] htmltools_0.3.6           ensembldb_2.6.8          
[37] BSgenome_1.50.0           htmlwidgets_1.3          
[39] rlang_0.3.1               rstudioapi_0.9.0         
[41] RSQLite_2.1.1             acepack_1.4.1            
[43] dplyr_0.8.0.1             VariantAnnotation_1.28.13
[45] RCurl_1.95-4.12           magrittr_1.5             
[47] GenomeInfoDbData_1.2.0    Formula_1.2-3            
[49] Matrix_1.2-14             Rcpp_1.0.0               
[51] munsell_0.5.0             stringi_1.3.1            
[53] zlibbioc_1.28.0           plyr_1.8.4               
[55] grid_3.5.0                blob_1.1.1               
[57] crayon_1.3.4              lattice_0.20-35          
[59] Biostrings_2.50.2         splines_3.5.0            
[61] GenomicFeatures_1.34.8    hms_0.4.2                
[63] knitr_1.21                pillar_1.3.1             
[65] igraph_1.2.4.1            biomaRt_2.38.0           
[67] XML_3.98-1.20             glue_1.3.0               
[69] biovizBase_1.30.1         latticeExtra_0.6-28      
[71] data.table_1.12.0         gtable_0.2.0             
[73] purrr_0.3.2               assertthat_0.2.0         
[75] ggplot2_3.1.0             xfun_0.5                 
[77] AnnotationFilter_1.6.0    survival_2.43-3          
[79] tibble_2.0.1              GenomicAlignments_1.18.1 
[81] AnnotationDbi_1.44.0      memoise_1.1.0            
[83] cluster_2.0.7-1 
genomicInteractions annotation • 932 views
ADD COMMENT
2
Entering edit mode
@lizingsimmons-6935
Last seen 4.1 years ago
Germany

Hi there,

You can use as.data.frame to turn the object into a data frame, and then select the columns you want to export, and export with e.g. write.table.

library("GenomicInteractions")
library("GenomicRanges")

data(hic_example_data)
data(mm9_refseq_promoters)

mm9_refseq_grl = split(mm9_refseq_promoters, mm9_refseq_promoters$id)
annotateInteractions(hic_example_data, list(promoter=mm9_refseq_grl))
hic_example_data

hic_example_data_df <- as.data.frame(hic_example_data)
head(hic_example_data_df[,c("seqnames1", "start1", "end1", "node.class1", 
    "seqnames2", "start2", "end2", "node.class2")])

# seqnames1   start1     end1 node.class1 seqnames2   start2     end2 node.class2
# 1     chr15 97600000 97699999    promoter     chr15 97500000 97599999    promoter
# 2     chr15 74800000 74899999    promoter     chr15 74700000 74799999    promoter
# 3     chr14 55000000 55099999    promoter     chr14 54800000 54899999    promoter
# 4     chr15 80400000 80499999    promoter     chr15 80300000 80399999    promoter
# 5     chr14 55100000 55199999    promoter     chr14 54800000 54899999    promoter
# 6     chr15 66600000 66699999    promoter     chr15 66500000 66599999    promoter 
ADD COMMENT
0
Entering edit mode

Great answer!! I haven't thought about it!

ADD REPLY
0
Entering edit mode

Great answer!! I haven't thought about it!

ADD REPLY

Login before adding your answer.

Traffic: 606 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6