                 // xxxnsubtil: we don't pad reference data to a dword multiple since variants are
                 // meant to be read-only, so RMW hazards should never happen
                 h.reference_sequence.resize(ref_start + ref_len);
-                for(uint32 i = 0; i < ref_len; i++)
-                {
-                    h.reference_sequence[ref_start + i] = from_nvbio::char_to_iupac16(ref[i]);
-                }
+                assign(ref_len,
+                       thrust::make_transform_iterator(ref.begin(), iupac16()),
+                       h.reference_sequence.stream_at_index(ref_start));
             }
 
             if (data_mask & VariantDataMask::ALTERNATE)

#include "../device/from_nvbio/dna.h"

namespace firepony {

bool load_vcf(variant_database_host *output, reference_file_handle *reference_handle, const char *filename, uint32 data_mask)
{


                // xxxnsubtil: same as above, this is not padded to dword size
                h.alternate_sequence.resize(alt_start + alt_len);
                assign(alt_len,
                       thrust::make_transform_iterator(alt.begin(), iupac16()),
                       h.alternate_sequence.stream_at_index(alt_start));
            }

            if (data_mask & VariantDataMask::QUAL)
