Last updated: 2019-01-11

workflowr checks: (Click a bullet for more information)
  • R Markdown file: uncommitted changes The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

  • Environment: empty

    Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

  • Seed: set.seed(12345)

    The command set.seed(12345) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

  • Session information: recorded

    Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

  • Repository version: dd9d56a

    Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

    Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
    
    Ignored files:
        Ignored:    .Rhistory
        Ignored:    .Rproj.user/
        Ignored:    analysis/.DS_Store
        Ignored:    analysis/.httr-oauth
        Ignored:    code/.DS_Store
        Ignored:    code/differential_expression/
        Ignored:    code/differential_phase/
        Ignored:    data/
        Ignored:    docs/.DS_Store
        Ignored:    docs/figure/.DS_Store
        Ignored:    docs/figure/neighboring_genes.Rmd/.DS_Store
        Ignored:    output/compare/
        Ignored:    output/ctss_clustering/
        Ignored:    output/differential_detection/
        Ignored:    output/differential_expression/
        Ignored:    output/differential_phase/
        Ignored:    output/extensive_transcription/
        Ignored:    output/final_utrs/
        Ignored:    output/gcbias/
        Ignored:    output/homopolymer_analysis/
        Ignored:    output/neighboring_genes/
        Ignored:    output/promoter_architecture/
        Ignored:    output/tfbs_analysis/
        Ignored:    output/transcript_abundance/
    
    Untracked files:
        Untracked:  _workflowr.yml
        Untracked:  docs/figure/tfbs_analysis.Rmd/
        Untracked:  figures/
    
    Unstaged changes:
        Modified:   README.md
        Modified:   analysis/_site.yml
        Modified:   analysis/about.Rmd
        Modified:   analysis/analyze_neighboring_genes.Rmd
        Modified:   analysis/array_correlations.Rmd
        Modified:   analysis/calculate_transcript_abundance.Rmd
        Deleted:    analysis/chunks.R
        Modified:   analysis/comparing_utrs.Rmd
        Modified:   analysis/ctss_clustering.Rmd
        Modified:   analysis/dynamic_tss.Rmd
        Modified:   analysis/extensive_transcription.Rmd
        Modified:   analysis/final_utrs.Rmd
        Modified:   analysis/gcbias.Rmd
        Modified:   analysis/index.Rmd
        Modified:   analysis/license.Rmd
        Modified:   analysis/process_neighboring_genes.Rmd
        Modified:   analysis/promoter_architecture.Rmd
        Modified:   analysis/strain_differential_detection.Rmd
        Modified:   analysis/strain_differential_expression.Rmd
        Modified:   analysis/strain_differential_phase.Rmd
        Modified:   analysis/tfbs_analysis.Rmd
        Modified:   code/differential_detection/detect_transcripts.R
        Modified:   code/figures.R
        Deleted:    docs/Rplots.pdf
    
    
    Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
Expand here to see past versions:
    File Version Author Date Message
    Rmd fafe120 Philipp Ross 2018-10-01 finished dynamic tsss
    Rmd f0b9974 Philipp Ross 2018-09-23 update to neighboring gene analysis
    html f0b9974 Philipp Ross 2018-09-23 update to neighboring gene analysis
    Rmd f59e2e3 Philipp Ross 2018-09-22 hellooooo
    html f59e2e3 Philipp Ross 2018-09-22 hellooooo

Overview

What is the relationship between the distances between neighboring genes and their co-expression? Can we identify putative bidirectional promoters this way? Are convergent neighboring genes that overlap more likely to be expressed at different time points?

Analysis

First let’s read in the data we generated during processing the data:

Before and after UTR predictions

Let’s make some plots of the before and after picture of distance between genes and their correlation to one another. Before we do this we need to actually generate the data we care about. We need to calculate the neighboring genes and the distances beween those genes. Then we can import that data, calculate the correlations between those neighboring genes, and create a gene-by-gene table of neighboring genes, the distances between them, their orientations, and the correlations between their expression patterns.

Should we remove genes for which we don’t have UTR predictions?

Correlation by distance plots

We also want to filter out genes for which we have no 5’ or 3’ UTR predictions

And genes for which we actually detect a confident level of transcription:

First we should look at some randomly sampled neighboring genes to get an idea of what the average level of correlatino between genes is:

We can visualize this either as a density plot or boxplot:

Are the convergent and divergent correlations significantly different than random pairs?


    Wilcoxon rank sum test with continuity correction

data:  filtered_divergent$cor and random_neighboring$cor
W = 759400, p-value < 2.2e-16
alternative hypothesis: true location shift is not equal to 0

    Wilcoxon rank sum test with continuity correction

data:  filtered_convergent$cor and random_neighboring$cor
W = 490430, p-value = 0.00376
alternative hypothesis: true location shift is not equal to 0

Now let’s filter the rest of the neighboring genes for the full-transcript distances:

First we can make 3D7 plots. We can look at the before and after shots:

  left_gene          right_gene             dist            cor           
 Length:1119        Length:1119        Min.   :   19   Min.   :-0.947766  
 Class :character   Class :character   1st Qu.: 1192   1st Qu.:-0.005024  
 Mode  :character   Mode  :character   Median : 1946   Median : 0.493932  
                                       Mean   : 2286   Mean   : 0.351075  
                                       3rd Qu.: 3014   3rd Qu.: 0.784766  
                                       Max.   :12047   Max.   : 0.999899  
 orientation       
 Length:1119       
 Class :character  
 Mode  :character  
                   
                   
                   

Expand here to see past versions of headhead-1.png:
Version Author Date
f0b9974 Philipp Ross 2018-09-23
f59e2e3 Philipp Ross 2018-09-22
  left_gene          right_gene             dist            cor           
 Length:1119        Length:1119        Min.   :-2869   Min.   :-0.947766  
 Class :character   Class :character   1st Qu.:  229   1st Qu.:-0.005024  
 Mode  :character   Mode  :character   Median :  548   Median : 0.493932  
                                       Mean   :  857   Mean   : 0.351075  
                                       3rd Qu.: 1283   3rd Qu.: 0.784766  
                                       Max.   :10276   Max.   : 0.999899  
 orientation       
 Length:1119       
 Class :character  
 Mode  :character  
                   
                   
                   

Expand here to see past versions of 3d7headhead-1.png:
Version Author Date
f0b9974 Philipp Ross 2018-09-23
f59e2e3 Philipp Ross 2018-09-22
  left_gene          right_gene             dist             cor          
 Length:1059        Length:1059        Min.   : -99.0   Min.   :-0.94701  
 Class :character   Class :character   1st Qu.: 446.0   1st Qu.:-0.35060  
 Mode  :character   Mode  :character   Median : 657.0   Median : 0.11516  
                                       Mean   : 760.0   Mean   : 0.09809  
                                       3rd Qu.: 957.5   3rd Qu.: 0.58076  
                                       Max.   :7692.0   Max.   : 0.99123  
 orientation       
 Length:1059       
 Class :character  
 Mode  :character  
                   
                   
                   

Expand here to see past versions of tailtail-1.png:
Version Author Date
f0b9974 Philipp Ross 2018-09-23
f59e2e3 Philipp Ross 2018-09-22
  left_gene          right_gene             dist        
 Length:1059        Length:1059        Min.   :-3135.0  
 Class :character   Class :character   1st Qu.: -376.0  
 Mode  :character   Mode  :character   Median : -124.0  
                                       Mean   : -125.1  
                                       3rd Qu.:   69.5  
                                       Max.   : 7139.0  
      cor           orientation       
 Min.   :-0.94701   Length:1059       
 1st Qu.:-0.35060   Class :character  
 Median : 0.11516   Mode  :character  
 Mean   : 0.09809                     
 3rd Qu.: 0.58076                     
 Max.   : 0.99123                     

Expand here to see past versions of 3d7tailtail-1.png:
Version Author Date
f0b9974 Philipp Ross 2018-09-23
f59e2e3 Philipp Ross 2018-09-22

Then we can make the HB3 plots:

  left_gene          right_gene             dist            cor         
 Length:1005        Length:1005        Min.   :-2344   Min.   :-0.9510  
 Class :character   Class :character   1st Qu.:  330   1st Qu.: 0.0330  
 Mode  :character   Mode  :character   Median :  713   Median : 0.6427  
                                       Mean   : 1051   Mean   : 0.4212  
                                       3rd Qu.: 1520   3rd Qu.: 0.8935  
                                       Max.   : 7437   Max.   : 0.9992  
 orientation       
 Length:1005       
 Class :character  
 Mode  :character  
                   
                   
                   

Expand here to see past versions of hb3headhead-1.png:
Version Author Date
f0b9974 Philipp Ross 2018-09-23
f59e2e3 Philipp Ross 2018-09-22
  left_gene          right_gene             dist         
 Length:814         Length:814         Min.   :-2491.00  
 Class :character   Class :character   1st Qu.: -279.75  
 Mode  :character   Mode  :character   Median :   23.00  
                                       Mean   :  -31.44  
                                       3rd Qu.:  165.25  
                                       Max.   : 7494.00  
      cor          orientation       
 Min.   :-0.9564   Length:814        
 1st Qu.:-0.3743   Class :character  
 Median : 0.2185   Mode  :character  
 Mean   : 0.1552                     
 3rd Qu.: 0.6882                     
 Max.   : 0.9963                     

Expand here to see past versions of hb3tailtail-1.png:
Version Author Date
f0b9974 Philipp Ross 2018-09-23
f59e2e3 Philipp Ross 2018-09-22

And finally for IT:

  left_gene          right_gene             dist              cor         
 Length:942         Length:942         Min.   :-4477.0   Min.   :-0.9243  
 Class :character   Class :character   1st Qu.:  355.2   1st Qu.: 0.1205  
 Mode  :character   Mode  :character   Median :  762.5   Median : 0.6316  
                                       Mean   : 1141.9   Mean   : 0.4459  
                                       3rd Qu.: 1699.8   3rd Qu.: 0.8848  
                                       Max.   : 7426.0   Max.   : 0.9999  
 orientation       
 Length:942        
 Class :character  
 Mode  :character  
                   
                   
                   

Expand here to see past versions of itheadhead-1.png:
Version Author Date
f0b9974 Philipp Ross 2018-09-23
f59e2e3 Philipp Ross 2018-09-22
  left_gene          right_gene             dist              cor         
 Length:779         Length:779         Min.   :-2118.0   Min.   :-0.9810  
 Class :character   Class :character   1st Qu.: -128.0   1st Qu.:-0.3282  
 Mode  :character   Mode  :character   Median :   70.0   Median : 0.1520  
                                       Mean   :  104.9   Mean   : 0.1503  
                                       3rd Qu.:  253.5   3rd Qu.: 0.6782  
                                       Max.   : 4603.0   Max.   : 0.9951  
 orientation       
 Length:779        
 Class :character  
 Mode  :character  
                   
                   
                   

Expand here to see past versions of ittailtail-1.png:
Version Author Date
f0b9974 Philipp Ross 2018-09-23
f59e2e3 Philipp Ross 2018-09-22

Individual profile plots

We need to scale the data for appropriate plotting:

Divergent example

Expand here to see past versions of unnamed-chunk-17-1.png:
Version Author Date
f0b9974 Philipp Ross 2018-09-23
f59e2e3 Philipp Ross 2018-09-22

Bidirectional promoters

What if we split up the divergent neighboring genes by the distance separating them and plot their correlations individually. Do we see anything interesting?

# A tibble: 6 x 2
  group          m
  <fct>      <dbl>
1 < 0       0.568 
2 0-500     0.494 
3 500-1000  0.337 
4 1000-1500 0.0937
5 1500-2000 0.176 
6 > 2000    0.123 
  left_gene          right_gene             dist            cor           
 Length:1119        Length:1119        Min.   :-2869   Min.   :-0.947766  
 Class :character   Class :character   1st Qu.:  229   1st Qu.:-0.005024  
 Mode  :character   Mode  :character   Median :  548   Median : 0.493932  
                                       Mean   :  857   Mean   : 0.351075  
                                       3rd Qu.: 1283   3rd Qu.: 0.784766  
                                       Max.   :10276   Max.   : 0.999899  
 orientation              group    
 Length:1119        < 0      :115  
 Class :character   0-500    :417  
 Mode  :character   500-1000 :225  
                    1000-1500:137  
                    1500-2000: 97  
                    > 2000   :128  

Expand here to see past versions of unnamed-chunk-18-1.png:
Version Author Date
f0b9974 Philipp Ross 2018-09-23
f59e2e3 Philipp Ross 2018-09-22

Now to make a table of predicted bidirectional promoters:

Transcriptional interference

# A tibble: 6 x 2
  group           m
  <fct>       <dbl>
1 < -1000    0.0394
2 -1000--500 0.0991
3 -500-0     0.126 
4 0-500      0.0694
5 500-1000   0.160 
6 > 1000     0.0189
  left_gene          right_gene             dist        
 Length:1059        Length:1059        Min.   :-3135.0  
 Class :character   Class :character   1st Qu.: -376.0  
 Mode  :character   Mode  :character   Median : -124.0  
                                       Mean   : -125.1  
                                       3rd Qu.:   69.5  
                                       Max.   : 7139.0  
      cor           orientation               group    
 Min.   :-0.94701   Length:1059        < -1000   : 37  
 1st Qu.:-0.35060   Class :character   -1000--500:128  
 Median : 0.11516   Mode  :character   -500-0    :433  
 Mean   : 0.09809                      0-500     :390  
 3rd Qu.: 0.58076                      500-1000  : 49  
 Max.   : 0.99123                      > 1000    : 22  

Session information

R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Gentoo/Linux

Matrix products: default
BLAS: /usr/local/lib64/R/lib/libRblas.so
LAPACK: /usr/local/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [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] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] gdtools_0.1.7                        
 [2] bindrcpp_0.2.2                       
 [3] BSgenome.Pfalciparum.PlasmoDB.v24_1.0
 [4] BSgenome_1.48.0                      
 [5] rtracklayer_1.40.6                   
 [6] Biostrings_2.48.0                    
 [7] XVector_0.20.0                       
 [8] GenomicRanges_1.32.7                 
 [9] GenomeInfoDb_1.16.0                  
[10] org.Pf.plasmo.db_3.6.0               
[11] AnnotationDbi_1.42.1                 
[12] IRanges_2.14.12                      
[13] S4Vectors_0.18.3                     
[14] Biobase_2.40.0                       
[15] BiocGenerics_0.26.0                  
[16] scales_1.0.0                         
[17] cowplot_0.9.3                        
[18] magrittr_1.5                         
[19] forcats_0.3.0                        
[20] stringr_1.3.1                        
[21] dplyr_0.7.6                          
[22] purrr_0.2.5                          
[23] readr_1.1.1                          
[24] tidyr_0.8.1                          
[25] tibble_1.4.2                         
[26] ggplot2_3.0.0                        
[27] tidyverse_1.2.1                      

loaded via a namespace (and not attached):
 [1] nlme_3.1-137                bitops_1.0-6               
 [3] matrixStats_0.54.0          lubridate_1.7.4            
 [5] bit64_0.9-7                 RColorBrewer_1.1-2         
 [7] httr_1.3.1                  rprojroot_1.3-2            
 [9] tools_3.5.1                 backports_1.1.2            
[11] utf8_1.1.4                  R6_2.3.0                   
[13] DBI_1.0.0                   lazyeval_0.2.1             
[15] colorspace_1.3-2            withr_2.1.2                
[17] tidyselect_0.2.4            bit_1.1-14                 
[19] compiler_3.5.1              git2r_0.23.0               
[21] cli_1.0.1                   rvest_0.3.2                
[23] xml2_1.2.0                  DelayedArray_0.6.6         
[25] labeling_0.3                digest_0.6.17              
[27] Rsamtools_1.32.3            svglite_1.2.1              
[29] rmarkdown_1.10              R.utils_2.7.0              
[31] pkgconfig_2.0.2             htmltools_0.3.6            
[33] rlang_0.2.2                 readxl_1.1.0               
[35] rstudioapi_0.8              RSQLite_2.1.1              
[37] shiny_1.1.0                 bindr_0.1.1                
[39] jsonlite_1.5                BiocParallel_1.14.2        
[41] R.oo_1.22.0                 RCurl_1.95-4.11            
[43] GenomeInfoDbData_1.1.0      Matrix_1.2-15              
[45] fansi_0.3.0                 Rcpp_0.12.19               
[47] munsell_0.5.0               R.methodsS3_1.7.1          
[49] stringi_1.2.4               whisker_0.3-2              
[51] yaml_2.2.0                  SummarizedExperiment_1.10.1
[53] zlibbioc_1.26.0             plyr_1.8.4                 
[55] grid_3.5.1                  blob_1.1.1                 
[57] promises_1.0.1              crayon_1.3.4               
[59] miniUI_0.1.1.1              lattice_0.20-38            
[61] haven_1.1.2                 hms_0.4.2                  
[63] knitr_1.20                  pillar_1.3.0               
[65] XML_3.98-1.16               glue_1.3.0                 
[67] evaluate_0.11               modelr_0.1.2               
[69] httpuv_1.4.5                cellranger_1.1.0           
[71] gtable_0.2.0                assertthat_0.2.0           
[73] ggExtra_0.8                 mime_0.5                   
[75] xtable_1.8-3                broom_0.5.0                
[77] later_0.7.5                 GenomicAlignments_1.16.0   
[79] memoise_1.1.0               workflowr_1.1.1            



This reproducible R Markdown analysis was created with workflowr 1.1.1