Skip to content

Commit

Permalink
fix error when looking up sequence type
Browse files Browse the repository at this point in the history
  • Loading branch information
zachary-foster committed Jul 16, 2024
1 parent 0a9eda6 commit d768f89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/check_samplesheet.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ is_present <- function(x) {
args <- commandArgs(trailingOnly = TRUE)
args <- as.list(args)
# args <- list('test/data/metadata/chaos_samples.csv', 'test/data/metadata/chaos_references.csv')
# args <- list('~/Downloads/sample_data_N273_14ncbigenomes.csv', '~/Downloads/ref_data.csv')
# args <- list('test/data/metadata/chaos_samples.csv')
metadata_original_samp <- read.csv(args[[1]], check.names = FALSE)
if (length(args) > 1) {
Expand Down Expand Up @@ -713,7 +714,7 @@ lookup_sequence_type <- function(id) {
}
gsub(summary_result$expxml, pattern = '.+<Platform instrument_model="(.+?)">(.+?)</Platform>.+', replacement = '\\2')
}
undefined_accessions <- unique(metadata_samp$ncbi_accession[! is_present(metadata_samp$sequence_type)])
undefined_accessions <- unique(metadata_samp$ncbi_accession[! is_present(metadata_samp$sequence_type) & is_present(metadata_samp$ncbi_accession)])
type_replace_key <- lapply(undefined_accessions, lookup_sequence_type)
names(type_replace_key) <- undefined_accessions
is_undefined <- metadata_samp$ncbi_accession %in% undefined_accessions
Expand Down

0 comments on commit d768f89

Please sign in to comment.