pub fn try_into_vcf_record_filters(
        &self,
        string_map: &StringMap,
    ) -> io::Result<Option<vcf::record::Filters>> {
        let raw_filters: Vec<_> = self
            .0
            .iter()
            .map(|&i| {
                string_map.get_index(i).ok_or_else(|| {
                    io::Error::new(
                        io::ErrorKind::InvalidInput,
                        format!("invalid string map index: {}", i),
                    )
                })
            })
            .collect::<Result<_, _>>()?;

        if raw_filters.is_empty() {
            Ok(None)
        } else {
            vcf::record::Filters::try_from_iter(raw_filters)
                .map(Some)
                .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))
        }
    }
/// Converts BCF record filters to VCF record filters.
///
/// # Examples
///
/// ```
/// # use std::io;
/// use noodles_bcf::{header::StringMap, record::Filters};
///
/// let bcf_filters = Filters::default();
/// let string_map = StringMap::default();
/// let vcf_filters = bcf_filters.try_into_vcf_record_filters(&string_map)?;
///
/// assert!(vcf_filters.is_none());
/// # Ok::<_, io::Error>(())
/// ```
Converts BCF record filters to VCF record filters.
Converts BCF record filters to VCF record filters .
pub fn try_into_vcf_record_filters(
        &self,
        string_map: &StringMap,
    ) -> io::Result<Option<vcf::record::Filters>> {
        let raw_filters: Vec<_> = self
            .0
            .iter()
            .map(|&i| {
                string_map.get_index(i).ok_or_else(|| {
                    io::Error::new(
                        io::ErrorKind::InvalidInput,
                        format!("invalid string map index: {}", i),
                    )
                })
            })
            .collect::<Result<_, _>>()?;
        if raw_filters.is_empty() {
            Ok(None)
        } else {
            vcf::record::Filters::try_from_iter(raw_filters)
                .map(Some)
                .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))
        }
    }
pub fn try_into_vcf_record_filters ( & self , string_map : & StringMap , ) -> io :: Result < Option < vcf :: record :: Filters > > { let raw_filters : Vec < _ > = self . 0 . iter ( ) . map ( | & i | { string_map . get_index ( i ) . ok_or_else ( | | { io :: Error :: new ( io :: ErrorKind :: InvalidInput , format ! ( " " i ) , ) } ) } ) . collect :: < Result < _ , _ > > ( ) ? ; if raw_filters . is_empty ( ) { Ok ( None ) } else { vcf :: record :: Filters :: try_from_iter ( raw_filters ) . map ( Some ) . map_err ( | e | io :: Error :: new ( io :: ErrorKind :: InvalidInput , e ) ) } }
Converts BCF record filters to VCF record filters.
Converts BCF record filters to VCF record filters .
&self
string_map
&StringMap
&self
string_map
&StringMap
examples
None
use std::io;
use noodles_bcf::{header::StringMap, record::Filters}.



assert!(vcf_filters.is_none()).
use noodles_bcf :: { header :: StringMap record :: Filters } . assert! ( vcf_filters . is_none () ) .
ok::<_, io::error>(())
None