Skip to content

Commit

Permalink
Fix the creation of output files where the input file name contains more
Browse files Browse the repository at this point in the history
than one period.
  • Loading branch information
williamdlees committed Dec 19, 2023
1 parent ec774fa commit 167edff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
RoxygenNote: 7.2.2
RoxygenNote: 7.2.3
LazyData: true
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@

* Added support for recent versions of IgDiscover, which now uses a AIRR format for filtered.tsv
* Added automatic sequence gapping for the AIRR format column sequence_alignment, should it not be gapped (this was required for IgDIscover support)
* Fixed the creation of output files where the input file included more than one period in its name
8 changes: 4 additions & 4 deletions R/genotype_statistics.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ generate_ogrdb_report = function(ref_filename, inferred_filename, species, filen
}

rd = read_input_files(ref_filename, inferred_filename, species, filename, chain, hap_gene, segment, chain_type, all_inferred)

file_prefix = basename(strsplit(filename, '.', fixed=TRUE)[[1]][1])
file_base = basename(filename)
file_splits = strsplit(file_base, '.', fixed=TRUE)[[1]]
file_prefix = paste(file_splits[1:length(file_splits)-1], sep='.', collapse='.')
file_loc = dirname(filename)

report('writing genotype file')
write_genotype_file(file.path(file_loc, paste0(file_prefix, '_ogrdb_report.csv')), segment, chain_type, rd$genotype)

report(paste0(file_prefix, '_ogrdb_report.csv'))

all_inferred = FALSE

Expand Down

0 comments on commit 167edff

Please sign in to comment.