Skip to content

Commit 8bae3a5

Browse files
Removed target_species_designation variable
This variable was the same as target_organism, so it was replaced with that variable when necessary.
1 parent 6299719 commit 8bae3a5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,12 @@ target_info <- ref_table %>%
9696
# Extract the relevant columns from the reference table
9797
target_taxid <- target_info$taxon # Taxonomic identifier
9898
target_org_db <- target_info$annotations # org.eg.db R package
99-
target_species_designation <- target_info$species # Full species name
10099
gtf_link <- target_info$gtf # Path to reference assembly GTF
101100
target_short_name <- target_info$name # PANTHER / UNIPROT short name; blank if not available
102101
ref_source <- target_info$ref_source # Reference files source
103102

104103
# Error handling for missing values
105-
if (is.na(target_taxid) || is.na(target_org_db) || is.na(target_species_designation) || is.na(gtf_link)) {
104+
if (is.na(target_taxid) || is.na(target_org_db) || is.na(target_organism) || is.na(gtf_link)) {
106105
stop(paste("Error: Missing data for target organism", target_organism, "in reference table."))
107106
}
108107

@@ -112,7 +111,7 @@ base_output_name <- str_replace(base_gtf_filename, ".gtf.gz", "")
112111

113112
# Add the species name to base_output_name if the reference source is not ENSEMBL
114113
if (!(ref_source %in% c("ensembl_plants", "ensembl_bacteria", "ensembl"))) {
115-
base_output_name <- paste(str_replace(target_species_designation, " ", "_"), base_output_name, sep = "_")
114+
base_output_name <- paste(str_replace(target_organism, " ", "_"), base_output_name, sep = "_")
116115
}
117116

118117
out_table_filename <- paste0(base_output_name, "-GL-annotations.tsv")
@@ -534,4 +533,4 @@ write(paste(c("\nUsed STRINGdb version:\n ", packageVersion("STRINGdb") %>% a
534533
write(paste(c("\nUsed PANTHER.db version:\n ", packageVersion("PANTHER.db") %>% as.character()), collapse = ""), out_log_filename, append = TRUE)
535534

536535
write("\n\nAll session info:\n", out_log_filename, append = TRUE)
537-
write(capture.output(sessionInfo()), out_log_filename, append = TRUE)
536+
write(capture.output(sessionInfo()), out_log_filename, append = TRUE)

0 commit comments

Comments
 (0)