Opened 4 years ago

Closed 12 months ago

#920 closed request (fixed)

resize VCF::Data

Reported by: Peter Owned by: Peter
Priority: major Milestone: yat 0.20
Component: omic Version:
Keywords: Cc:

Description

With current API there is no easy way to change number of samples in a VCF::Data instance. It's kind of expected to

1) Construct a VCF with given number of samples. VCF(void) creates a zero-sample VCF.

2) Construct a VCF with a subset of samples in another VCF, either by a subset copy construction or by removing unwanted samples. One use case is to create a single-sample VCF from a multi-sample and in that case removing is probably unnecessarily slow.

Currently the easiest way is to output the VCF to stringstream, split the string into a vector, pick elements as wanted, glue them together to s string that is passed to VCF constructor.

Note that increasing number of samples when FMT is not empty is problematic as it's not trivial to fill the data field with appropriate data for the different formats.

Change History (4)

comment:1 Changed 12 months ago by Peter

Milestone: yat 0.x+yat 0.20
Status: newaccepted
Type: discussionrequest

comment:2 Changed 12 months ago by Peter

In 4144:

Add interface to construct a VCF with n samples and to select a subset of current samples. refs #920

comment:3 Changed 12 months ago by Peter

In 4145:

implement subset functions and constructor taking #samples (refs #920). Refactor VCF::Info, so it is stored as a map and vector when the data is manipulated and string when not manipulated.

comment:4 Changed 12 months ago by Peter

Resolution: fixed
Status: acceptedclosed

In 4146:

assuming that VCF::Info operator<< is used more often that ::str(), swap so the latter is using the former rather that vice versa. closes #920.

Note: See TracTickets for help on using tickets.