|
2 | 2 | # Written by Mike Lee
|
3 | 3 | # GeneLab script for generating organism-specific gene annotation tables
|
4 | 4 | # Example usage: Rscript GL-DPPD-7110-A_build-genome-annots-tab.R 'Mus musculus'
|
5 |
| - |
| 5 | +options(timeout = 3600) |
6 | 6 |
|
7 | 7 | # Define variables associated with current pipeline and annotation table versions
|
8 | 8 | GL_DPPD_ID <- "GL-DPPD-7110-A"
|
@@ -80,9 +80,6 @@ library(rtracklayer)
|
80 | 80 | ############## Define variables and output file names ###################
|
81 | 81 | #########################################################################
|
82 | 82 |
|
83 |
| -# Set timeout time to ensure annotation file downloads will complete |
84 |
| -options(timeout = 600) |
85 |
| - |
86 | 83 | ref_table <- tryCatch(
|
87 | 84 | read.csv(ref_tab_path),
|
88 | 85 | error = function(e) {
|
@@ -133,9 +130,6 @@ if ( file.exists(out_table_filename) ) {
|
133 | 130 | ######## Load annotation databases #########
|
134 | 131 | #############################################
|
135 | 132 |
|
136 |
| -# Set timeout time to ensure annotation file downloads will complete |
137 |
| -options(timeout = 600) |
138 |
| - |
139 | 133 | ####### GTF ##########
|
140 | 134 |
|
141 | 135 | # Create the GTF dataframe from its path, unique gene identities in the reference assembly are under 'gene_id'
|
@@ -186,15 +180,18 @@ install_and_load_org_db <- function(target_organism, target_org_db, ref_tab_path
|
186 | 180 |
|
187 | 181 | # Load the package into the R session
|
188 | 182 | library(target_org_db, character.only = TRUE)
|
| 183 | + |
| 184 | + # Return the target_org_db name |
| 185 | + return(target_org_db) |
189 | 186 | }
|
190 | 187 |
|
191 | 188 | # Define list of supported organisms which do not use annotations from an org.db
|
192 | 189 | no_org_db <- c("Lactobacillus acidophilus", "Mycobacterium marinum", "Oryza sativa", "Pseudomonas aeruginosa",
|
193 | 190 | "Serratia liquefaciens", "Staphylococcus aureus", "Streptococcus mutans", "Vibrio fischeri")
|
194 | 191 |
|
195 |
| -# Run the function unless the target_organism is in no_org_db |
| 192 | +# Run the function unless the target_organism is in no_org_db and update target_org_db with the result |
196 | 193 | if (!(target_organism %in% no_org_db) && (target_organism %in% currently_accepted_orgs)) {
|
197 |
| - install_and_load_org_db(target_organism, target_org_db, ref_tab_path) |
| 194 | + target_org_db <- install_and_load_org_db(target_organism, target_org_db, ref_tab_path) |
198 | 195 | }
|
199 | 196 |
|
200 | 197 | ############################################
|
|
0 commit comments