Skip to content

Commit

Permalink
Add additional make function for Gapless Stream
Browse files Browse the repository at this point in the history
  • Loading branch information
lczech committed May 30, 2024
1 parent 6971ee8 commit f2d6979
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 66 deletions.
47 changes: 0 additions & 47 deletions lib/genesis/population/stream/variant_input_stream_adapters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,53 +118,6 @@ VariantInputStream make_variant_input_stream_from_variant_parallel_input_stream(
// Variant Gapless Input Stream
// =================================================================================================

VariantInputStream make_variant_gapless_input_stream(
VariantInputStream const& input
) {
auto gapless_input = VariantGaplessInputStream( input );
return make_variant_input_stream_from_variant_gapless_input_stream( gapless_input );
}

VariantInputStream make_variant_gapless_input_stream(
VariantInputStream const& input,
std::shared_ptr<::genesis::sequence::ReferenceGenome> ref_genome
) {
auto gapless_input = VariantGaplessInputStream( input );
gapless_input.reference_genome( ref_genome );
return make_variant_input_stream_from_variant_gapless_input_stream( gapless_input );
}

VariantInputStream make_variant_gapless_input_stream(
VariantInputStream const& input,
std::shared_ptr<::genesis::sequence::SequenceDict> seq_dict
) {
auto gapless_input = VariantGaplessInputStream( input );
gapless_input.sequence_dict( seq_dict );
return make_variant_input_stream_from_variant_gapless_input_stream( gapless_input );
}

VariantInputStream make_variant_gapless_input_stream(
VariantInputStream const& input,
std::shared_ptr<::genesis::sequence::ReferenceGenome> ref_genome,
std::shared_ptr<GenomeLocusSet> genome_locus_set
) {
auto gapless_input = VariantGaplessInputStream( input );
gapless_input.reference_genome( ref_genome );
gapless_input.genome_locus_set( genome_locus_set );
return make_variant_input_stream_from_variant_gapless_input_stream( gapless_input );
}

VariantInputStream make_variant_gapless_input_stream(
VariantInputStream const& input,
std::shared_ptr<::genesis::sequence::SequenceDict> seq_dict,
std::shared_ptr<GenomeLocusSet> genome_locus_set
) {
auto gapless_input = VariantGaplessInputStream( input );
gapless_input.sequence_dict( seq_dict );
gapless_input.genome_locus_set( genome_locus_set );
return make_variant_input_stream_from_variant_gapless_input_stream( gapless_input );
}

VariantInputStream make_variant_input_stream_from_variant_gapless_input_stream(
VariantGaplessInputStream const& gapless_input
) {
Expand Down
75 changes: 56 additions & 19 deletions lib/genesis/population/stream/variant_input_stream_adapters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,27 @@ VariantInputStream make_variant_input_stream_from_variant_parallel_input_stream(
// Variant Gapless Input Stream
// =================================================================================================

/**
* @brief Create a VariantInputStream that wraps a VariantGaplessInputStream.
*
* See also make_variant_gapless_input_stream()
*/
VariantInputStream make_variant_input_stream_from_variant_gapless_input_stream(
VariantGaplessInputStream const& gapless_input
);

/**
* @brief Create a VariantGaplessInputStream from a VariantInputStream @p input, and wrap it
* agian in a VariantInputStream.
*
* See also make_variant_input_stream_from_variant_gapless_input_stream()
*/
VariantInputStream make_variant_gapless_input_stream(
inline VariantInputStream make_variant_gapless_input_stream(
VariantInputStream const& input
);
) {
auto gapless_input = VariantGaplessInputStream( input );
return make_variant_input_stream_from_variant_gapless_input_stream( gapless_input );
}

/**
* @copybrief make_variant_gapless_input_stream( VariantInputStream const& )
Expand All @@ -96,10 +108,14 @@ VariantInputStream make_variant_gapless_input_stream(
*
* See also make_variant_input_stream_from_variant_gapless_input_stream()
*/
VariantInputStream make_variant_gapless_input_stream(
inline VariantInputStream make_variant_gapless_input_stream(
VariantInputStream const& input,
std::shared_ptr<::genesis::sequence::ReferenceGenome> ref_genome
);
) {
auto gapless_input = VariantGaplessInputStream( input );
gapless_input.reference_genome( ref_genome );
return make_variant_input_stream_from_variant_gapless_input_stream( gapless_input );
}

/**
* @copybrief make_variant_gapless_input_stream( VariantInputStream const& )
Expand All @@ -108,10 +124,30 @@ VariantInputStream make_variant_gapless_input_stream(
*
* See also make_variant_input_stream_from_variant_gapless_input_stream()
*/
VariantInputStream make_variant_gapless_input_stream(
inline VariantInputStream make_variant_gapless_input_stream(
VariantInputStream const& input,
std::shared_ptr<::genesis::sequence::SequenceDict> seq_dict
);
) {
auto gapless_input = VariantGaplessInputStream( input );
gapless_input.sequence_dict( seq_dict );
return make_variant_input_stream_from_variant_gapless_input_stream( gapless_input );
}

/**
* @copybrief make_variant_gapless_input_stream( VariantInputStream const& )
*
* This overload additionally sets a genome locus set to filter the positions.
*
* See also make_variant_input_stream_from_variant_gapless_input_stream()
*/
inline VariantInputStream make_variant_gapless_input_stream(
VariantInputStream const& input,
std::shared_ptr<GenomeLocusSet> genome_locus_set
) {
auto gapless_input = VariantGaplessInputStream( input );
gapless_input.genome_locus_set( genome_locus_set );
return make_variant_input_stream_from_variant_gapless_input_stream( gapless_input );
}

/**
* @copybrief make_variant_gapless_input_stream( VariantInputStream const& )
Expand All @@ -121,11 +157,16 @@ VariantInputStream make_variant_gapless_input_stream(
*
* See also make_variant_input_stream_from_variant_gapless_input_stream()
*/
VariantInputStream make_variant_gapless_input_stream(
inline VariantInputStream make_variant_gapless_input_stream(
VariantInputStream const& input,
std::shared_ptr<::genesis::sequence::ReferenceGenome> ref_genome,
std::shared_ptr<GenomeLocusSet> genome_locus_set
);
) {
auto gapless_input = VariantGaplessInputStream( input );
gapless_input.reference_genome( ref_genome );
gapless_input.genome_locus_set( genome_locus_set );
return make_variant_input_stream_from_variant_gapless_input_stream( gapless_input );
}

/**
* @copybrief make_variant_gapless_input_stream( VariantInputStream const& )
Expand All @@ -135,20 +176,16 @@ VariantInputStream make_variant_gapless_input_stream(
*
* See also make_variant_input_stream_from_variant_gapless_input_stream()
*/
VariantInputStream make_variant_gapless_input_stream(
inline VariantInputStream make_variant_gapless_input_stream(
VariantInputStream const& input,
std::shared_ptr<::genesis::sequence::SequenceDict> seq_dict,
std::shared_ptr<GenomeLocusSet> genome_locus_set
);

/**
* @brief Create a VariantInputStream that wraps a VariantGaplessInputStream.
*
* See also make_variant_gapless_input_stream()
*/
VariantInputStream make_variant_input_stream_from_variant_gapless_input_stream(
VariantGaplessInputStream const& gapless_input
);
) {
auto gapless_input = VariantGaplessInputStream( input );
gapless_input.sequence_dict( seq_dict );
gapless_input.genome_locus_set( genome_locus_set );
return make_variant_input_stream_from_variant_gapless_input_stream( gapless_input );
}

// =================================================================================================
// Merging Input Stream
Expand Down

0 comments on commit f2d6979

Please sign in to comment.