Open holtgrewe opened 9 months ago
There is indeed no consensus on how fixed-sized character arrays are encoded/decoded. I'll try to push samtools/hts-specs#631 to see if can be resolved first.
As a workaround in noodles, you can modify the RNC
format header record type definition to be a single string value, e.g.,
use noodles::vcf::{self, header::{record::value::map::format::Type, Number};
let mut header = reader.read_header()?;
// In a write context, write the original header before the modification to preserve the type
// definition.
writer.write_header(&header);
if let Some(format) = header.formats_mut().get_mut("RNC") {
*format.number_mut() = Number::Count(1);
*format.type_mut() = Type::String;
}
let mut record = vcf::Record::default();
reader.read_record(&header, &mut record)?;
writer.write_record(&header, &record)?;
Thank you very much!
The glnexus tool writes out a
FORMAT/RNC
field with the following header.In the data rows this looks as follows:
In other words, it writes it out as strings of length 2. This is not allowed by noodles that expects
I,I
or.,.
.Is this a special case that could be supported by nodles-vcf?
Also see: