Skip to content

Commit f06cf14

Browse files
committed
move timeout to top of scripts, add to readme
1 parent d1ea649 commit f06cf14

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

GeneLab_Reference_Annotations/Workflow_Documentation/GL_RefAnnotTable-A/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ The GL_RefAnnotTable-A workflow can be run using one of two approaches:
5454

5555
Please follow the instructions for the approach that best matches your setup and preferences. Each method is explained in detail below.
5656

57+
> **Note**: If you encounter timeout errors, you can increase the default timeout (3600 seconds) by modifying the `options(timeout=3600)` line at the top of the `GL-DPPD-7110-A_build-genome-annots-tab.R` script.
58+
5759
<br>
5860

5961
---
@@ -198,6 +200,8 @@ The input and output data are the same for both [Approach 1: Using Singularity](
198200

199201
If the reference table does not specify an annotations database for the target organism in the 'annotations' column of the [GL-DPPD-7110-A_annotations.csv](../../Pipeline_GL-DPPD-7110_Versions/GL-DPPD-7110-A/GL-DPPD-7110-A_annotations.csv) file, the `install_annotations` function (defined in `install-org-db.R`) will be executed by default. This function can also be run as a stand-alone script:
200202

203+
> **Note**: If you encounter timeout errors, you can increase the default timeout (3600 seconds) by modifying the `options(timeout=3600)` line at the top of the `install-org-db.R` script.
204+
201205
<br>
202206

203207
#### Using Singularity

GeneLab_Reference_Annotations/Workflow_Documentation/GL_RefAnnotTable-A/workflow_code/GL-DPPD-7110-A_build-genome-annots-tab.R

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Written by Mike Lee
33
# GeneLab script for generating organism-specific gene annotation tables
44
# Example usage: Rscript GL-DPPD-7110-A_build-genome-annots-tab.R 'Mus musculus'
5-
5+
options(timeout = 3600)
66

77
# Define variables associated with current pipeline and annotation table versions
88
GL_DPPD_ID <- "GL-DPPD-7110-A"
@@ -80,9 +80,6 @@ library(rtracklayer)
8080
############## Define variables and output file names ###################
8181
#########################################################################
8282

83-
# Set timeout time to ensure annotation file downloads will complete
84-
options(timeout = 600)
85-
8683
ref_table <- tryCatch(
8784
read.csv(ref_tab_path),
8885
error = function(e) {
@@ -133,9 +130,6 @@ if ( file.exists(out_table_filename) ) {
133130
######## Load annotation databases #########
134131
#############################################
135132

136-
# Set timeout time to ensure annotation file downloads will complete
137-
options(timeout = 600)
138-
139133
####### GTF ##########
140134

141135
# 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
186180

187181
# Load the package into the R session
188182
library(target_org_db, character.only = TRUE)
183+
184+
# Return the target_org_db name
185+
return(target_org_db)
189186
}
190187

191188
# Define list of supported organisms which do not use annotations from an org.db
192189
no_org_db <- c("Lactobacillus acidophilus", "Mycobacterium marinum", "Oryza sativa", "Pseudomonas aeruginosa",
193190
"Serratia liquefaciens", "Staphylococcus aureus", "Streptococcus mutans", "Vibrio fischeri")
194191

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
196193
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)
198195
}
199196

200197
############################################

GeneLab_Reference_Annotations/Workflow_Documentation/GL_RefAnnotTable-A/workflow_code/install-org-db.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# install-org-db.R
2-
2+
options(timeout=3600)
33
# Load required libraries
44
library(tidyverse)
55
library(AnnotationForge)

0 commit comments

Comments
 (0)