Skip to content

Commit

Permalink
new fix read order
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-marsh committed Jul 10, 2023
1 parent ac9ed5c commit c2c391e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/Read_&_Write_Data.R
Original file line number Diff line number Diff line change
Expand Up @@ -1156,8 +1156,11 @@ Read_CellBender_h5_Mat <- function(
"i" = "If unsure, check contents of H5 file {.code rhdf5::h5ls('{file_name}')}."))
}

# Read file
infile <- hdf5r::H5File$new(filename = file_name, mode = "r")

# Get list of H5 contents
h5_dataset_list <- hdf5r::list.datasets(file_name)
h5_dataset_list <- hdf5r::list.datasets(infile)

# Check feature_slot_name is correct
if (!length(x = grep(pattern = feature_slot_name, x = h5_dataset_list, value = TRUE)) > 0) {
Expand All @@ -1184,9 +1187,6 @@ Read_CellBender_h5_Mat <- function(
}
}

# Read file
infile <- hdf5r::H5File$new(filename = file_name, mode = "r")

# add name check
group_names <- names(x = infile)

Expand Down

0 comments on commit c2c391e

Please sign in to comment.