Skip to content

Commit

Permalink
Change naming scheme for sam without rg splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
lczech committed Jun 6, 2024
1 parent 0a155c8 commit 6b5e707
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/genesis/population/stream/variant_input_stream_sources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,16 @@ VariantInputStream make_variant_input_stream_from_sam_file(
// Take this into account, and create as many empty (unnamed) samples as needed.
// This cannot be more than one though, as it can be the unaccounted or none,
// or, if we do not split by RG at all, just the one sample were every read ends up in.
data.sample_names = make_sample_name_list_( data.source_name, cur.sample_size() );
// data.sample_names = make_sample_name_list_( data.source_name, cur.sample_size() );
// assert( data.sample_names.size() <= 1 );

// Scratch that. If we treat the file as a single sample anyway, we just use the file name
// as the sample name. Way more intuitive. Unfortunately, there is then the inconsistency
// in naming, but it's more in line with what e.g. the sync does if a header is provided.
assert( data.sample_names.size() <= 1 );
if( data.sample_names.size() == 1 ) {
data.sample_names = std::vector<std::string>{ data.source_name };
}
} else {
assert( reader.split_by_rg() == true );
}
Expand Down

0 comments on commit 6b5e707

Please sign in to comment.