Skip to content

Commit

Permalink
Small changes to reference fetching logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasHickman committed Apr 30, 2018
1 parent 5e12dcd commit c918f88
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ cram_os_h = cram/os.h $(htslib_hts_endian_h)
cram_sam_header_h = cram/sam_header.h cram/string_alloc.h cram/pooled_alloc.h $(htslib_khash_h) $(htslib_kstring_h)
cram_samtools_h = cram/cram_samtools.h $(htslib_sam_h) $(cram_sam_header_h)
cram_structs_h = cram/cram_structs.h $(htslib_thread_pool_h) cram/string_alloc.h $(htslib_khash_h)
cram_op]en_trace_file_h = cram/open_trace_file.h cram/mFILE.h

hfile_internal_h = hfile_internal.h $(htslib_hfile_h) $(textutils_internal_h)
hts_internal_h = hts_internal.h $(htslib_hts_h) $(textutils_internal_h)
Expand Down
3 changes: 2 additions & 1 deletion cram/cram_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1924,8 +1924,9 @@ static int cram_populate_ref(cram_fd *fd, int id, ref_entry *r) {
int no_m5 = 0;
char* ref_fn;

if (!(tag = sam_hdr_find_key(fd->header, ty, "M5", NULL)))
if (!(tag = sam_hdr_find_key(fd->header, ty, "M5", NULL))){
no_m5 = 1;
}
else {
const char* m5_str = tag->str+3;
hts_log_info("Querying ref %s", m5_str);
Expand Down
4 changes: 2 additions & 2 deletions htslib/ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern "C" {

/* m5_to_ref() - returns the reference genome that has a given MD5 string
* @param m5_str: The m5 string to query
* @returns: A hFile with a reference genome
* @returns: A hFILE containing a file pointer to a reference genome.
* NULL on failure
*
* Note: This function is not currently thread safe, so locks
Expand All @@ -47,7 +47,7 @@ hFILE* m5_to_ref(const char *m5_str);
/* m5_to_path() - returns a path to a reference genome that has a
* given MD5 string
* @param m5_str: The m5 string to query
* @returns: A path to a reference genome
* @returns: A path to the correct reference genome.
* NULL on failure
*
* Note: This function is not currently thread safe, so locks
Expand Down

0 comments on commit c918f88

Please sign in to comment.