NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Enumerations | Functions
nvbio::io Namespace Reference

Classes

struct  Cigar
 
struct  Alignment
 
struct  AlignmentCompare
 
struct  BestAlignments
 
struct  PairedAlignments
 
struct  BestPairedAlignments
 
struct  has_second
 
struct  has_second_paired
 
struct  has_second_unpaired
 
struct  is_paired
 
struct  is_unpaired
 
struct  is_concordant
 
struct  is_discordant
 
struct  is_not_concordant
 
struct  is_aligned
 
struct  BAM_header
 
struct  BAM_reference
 
struct  BAM_alignment
 
struct  BAM_alignment_data_block
 
class  BufferedTextFile
 
struct  FMIndexDataCore
 
struct  FMIndexData
 
struct  FMIndexDataHost
 
struct  FMIndexDataMMAPInfo
 
struct  FMIndexDataMMAPServer
 
struct  FMIndexDataMMAP
 
struct  FMIndexDataDevice
 
struct  BamOutput
 
struct  DeviceOutputBatchSE
 
struct  HostOutputBatchSE
 
struct  HostOutputBatchPE
 
struct  DataBuffer
 
struct  DebugOutput
 
struct  OutputFile
 
struct  GzipCompressor
 
struct  BGZFCompressor
 
struct  AlignmentData
 
struct  SamOutput
 
struct  IOStats
 
struct  BNT
 
struct  DeviceCigarArray
 
struct  HostCigarArray
 
struct  ReadDataFile_BAM
 
struct  read_string
 
struct  ReadDataView
 
struct  ReadData
 
struct  ReadDataRAM
 
struct  ReadDataDevice
 
struct  ReadDataStream
 
struct  ReadDataFile_FASTQ_parser
 
struct  ReadDataFile_FASTQ_gz
 
struct  ReadDataFile
 
struct  ReadDataFile_TXT
 
struct  ReadDataFile_TXT_gz
 
struct  ReadDataFile_SAM
 
struct  SequenceDataInfo
 
struct  SequenceDataViewCore
 
struct  SequenceData
 
struct  SequenceDataStorage
 
struct  SequenceDataInputStream
 
struct  SequenceDataOutputStream
 
struct  SequenceDataAccess
 
struct  SequenceDataEdit
 
struct  SequenceDataFile_BAM
 
struct  sequence_string
 
struct  SequenceDataEncoderImpl
 
struct  SequenceDataEncoder
 
struct  SequenceDataFile_FASTA_gz
 
struct  SequenceDataOutputFile_FASTA
 
struct  SequenceDataFile_FASTQ_parser
 
struct  SequenceDataFile_FASTQ_gz
 
struct  SequenceDataOutputFile_FASTQ
 
struct  SequenceDataMMAPServer
 
struct  SequenceDataMMAP
 
struct  SequenceDataFile
 
struct  SequenceDataFile_SAM
 
struct  SequenceDataTraits
 
struct  SequenceDataFile_TXT
 
struct  SequenceDataFile_TXT_gz
 
struct  SequenceDataOutputFile_TXT
 
struct  SNP_sequence_index
 
struct  SNPDatabase
 

Typedefs

typedef nvbio::HostVectorArray
< uint8
HostMdsArray
 
typedef ReadDataView< uint32
*, uint32 *, char *, char * > 
ReadDataCore
 
typedef ReadDataRAM ReadDataHost
 
typedef ReadDataDevice ReadDataCUDA
 
typedef SequenceDataViewCore
< uint32 *, uint32 *, char
*, char * > 
SequenceDataView
 
A non-const SequenceData view More...
 
typedef SequenceDataViewCore
< const uint32 *, const uint32
*, const char *, const char * > 
ConstSequenceDataView
 
A const SequenceData view More...
 
typedef SequenceDataViewCore
< cuda::ldg_pointer< uint32 >
, cuda::ldg_pointer< uint32 >
, const char *, const char * > 
LdgSequenceDataView
 
An LDG-based SequenceData view More...
 
typedef SequenceDataStorage
< host_tag
SequenceDataHost
 a SequenceData object stored in host memory More...
 
typedef SequenceDataStorage
< device_tag
SequenceDataDevice
 a SequenceData object stored in device memory More...
 
typedef SequenceDataInputStream SequenceDataStream
 

Enumerations

enum  MDS_OP {
  MDS_MATCH = 0, MDS_MISMATCH = 1, MDS_INSERTION = 2, MDS_DELETION = 3,
  MDS_INVALID = 4
}
 
enum  AlignmentType { SINGLE_END, PAIRED_END }
 
enum  AlignmentMate { MATE_1 = 0, MATE_2 = 1 }
 
enum  AlignmentScore { BEST_SCORE, SECOND_BEST_SCORE }
 
enum  QualityEncoding {
  Phred = 0, Phred33 = 1, Phred64 = 2, Solexa = 3,
  Phred = 0, Phred33 = 1, Phred64 = 2, Solexa = 3
}
 
enum  ReadEncoding { FORWARD = 0x0001, REVERSE = 0x0002, FORWARD_COMPLEMENT = 0x0004, REVERSE_COMPLEMENT = 0x0008 }
 
enum  PairedEndPolicy {
  PE_POLICY_FF = 0, PE_POLICY_FR = 1, PE_POLICY_RF = 2, PE_POLICY_RR = 3,
  PE_POLICY_FF = 0, PE_POLICY_FR = 1, PE_POLICY_RF = 2, PE_POLICY_RR = 3
}
 
enum  AlignmentFlags {
  SAMFlag_MultipleSegments = 0x1, SAMFlag_AllSegmentsAligned = 0x2, SAMFlag_SegmentUnmapped = 0x4, SAMFlag_NextSegmentUnmapped = 0x8,
  SAMFlag_ReverseComplemented = 0x10, SAMFlag_NextSegmentReverseComplemented = 0x20, SAMFlag_FirstSegment = 0x40, SAMFlag_LastSegment = 0x80,
  SAMFlag_SecondaryAlignment = 0x100, SAMFlag_FailedQC = 0x200, SAMFlag_Duplicate = 0x400, SAMFlag_MultipleSegments = 0x1,
  SAMFlag_AllSegmentsAligned = 0x2, SAMFlag_SegmentUnmapped = 0x4, SAMFlag_NextSegmentUnmapped = 0x8, SAMFlag_ReverseComplemented = 0x10,
  SAMFlag_NextSegmentReverseComplemented = 0x20, SAMFlag_FirstSegment = 0x40, SAMFlag_LastSegment = 0x80, SAMFlag_SecondaryAlignment = 0x100,
  SAMFlag_FailedQC = 0x200, SAMFlag_Duplicate = 0x400
}
 
enum  QualityEncoding {
  Phred = 0, Phred33 = 1, Phred64 = 2, Solexa = 3,
  Phred = 0, Phred33 = 1, Phred64 = 2, Solexa = 3
}
 
enum  SequenceEncoding { FORWARD = 0x0001, REVERSE = 0x0002, FORWARD_COMPLEMENT = 0x0004, REVERSE_COMPLEMENT = 0x0008 }
 
enum  SequenceFlags { SEQUENCE_DATA = 0x0001, SEQUENCE_QUALS = 0x0002, SEQUENCE_NAMES = 0x0004 }
 
enum  PairedEndPolicy {
  PE_POLICY_FF = 0, PE_POLICY_FR = 1, PE_POLICY_RF = 2, PE_POLICY_RR = 3,
  PE_POLICY_FF = 0, PE_POLICY_FR = 1, PE_POLICY_RF = 2, PE_POLICY_RR = 3
}
 
enum  AlignmentFlags {
  SAMFlag_MultipleSegments = 0x1, SAMFlag_AllSegmentsAligned = 0x2, SAMFlag_SegmentUnmapped = 0x4, SAMFlag_NextSegmentUnmapped = 0x8,
  SAMFlag_ReverseComplemented = 0x10, SAMFlag_NextSegmentReverseComplemented = 0x20, SAMFlag_FirstSegment = 0x40, SAMFlag_LastSegment = 0x80,
  SAMFlag_SecondaryAlignment = 0x100, SAMFlag_FailedQC = 0x200, SAMFlag_Duplicate = 0x400, SAMFlag_MultipleSegments = 0x1,
  SAMFlag_AllSegmentsAligned = 0x2, SAMFlag_SegmentUnmapped = 0x4, SAMFlag_NextSegmentUnmapped = 0x8, SAMFlag_ReverseComplemented = 0x10,
  SAMFlag_NextSegmentReverseComplemented = 0x20, SAMFlag_FirstSegment = 0x40, SAMFlag_LastSegment = 0x80, SAMFlag_SecondaryAlignment = 0x100,
  SAMFlag_FailedQC = 0x200, SAMFlag_Duplicate = 0x400
}
 

Functions

NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE bool 
distinct_alignments (const uint32 pos1, const bool rc1, const uint32 pos2, const bool rc2, const uint32 dist)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE bool 
distinct_alignments (const uint32 apos1, const uint32 opos1, const bool arc1, const bool orc1, const uint32 apos2, const uint32 opos2, const bool arc2, const bool orc2, const uint32 dist)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE bool 
distinct_alignments (const Alignment &p1, const Alignment &p2, const uint32 dist=1)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE bool 
distinct_alignments (const PairedAlignments &p1, const PairedAlignments &p2)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE bool 
distinct_alignments (const PairedAlignments &p1, const PairedAlignments &p2, const uint32 dist)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE bool 
distinct_alignments (const uint32 apos1, const uint32 opos1, const bool arc1, const bool orc1, const uint32 apos2, const uint32 opos2, const bool arc2, const bool orc2)
 
void init_ssa (const FMIndexData &driver_data, FMIndexData::ssa_storage_type &ssa, FMIndexData::ssa_storage_type &rssa)
 
void init_ssa (const FMIndexDataDevice &driver_data, FMIndexDataDevice::ssa_storage_type &ssa, FMIndexDataDevice::ssa_storage_type &rssa)
 
AlignmentData get (HostOutputBatchSE &batch, const uint32 aln_id)
 
AlignmentData get_mate (HostOutputBatchPE &batch, const uint32 aln_id, const AlignmentMate mate)
 
AlignmentData get_anchor_mate (HostOutputBatchPE &batch, const uint32 aln_id)
 
AlignmentData get_opposite_mate (HostOutputBatchPE &batch, const uint32 aln_id)
 
uint32 compute_cigar_pos (const uint32 sink, const uint32 alignment)
 
template<typename vector_type >
uint32 reference_cigar_length (const vector_type cigar, const uint32 cigar_len)
 
template<typename vector_type >
uint32 count_symbols (const Cigar::Operation type, const vector_type cigar, const uint32 cigar_len)
 
template<typename vector_type >
void analyze_md_string (const vector_type mds, uint32 &n_mm, uint32 &n_gapo, uint32 &n_gape)
 
ReadDataStreamopen_read_file (const char *read_file_name, const QualityEncoding qualities, const uint32 max_reads, const uint32 truncate_read_len, const ReadEncoding flags)
 
template<QualityEncoding quality_encoding, typename read_type >
void encode (const read_type read, ReadData::read_stream_type::iterator stream, char *qual_stream)
 
template<typename read_type >
void encode (const QualityEncoding quality_encoding, const read_type read, ReadData::read_stream_type::iterator stream, char *qual_stream)
 
void encode (const ReadDataRAM::StrandOp conversion_flags, const QualityEncoding quality_encoding, const uint32 read_len, const uint8 *read, const uint8 *quality, ReadData::read_stream_type::iterator stream, char *qual_stream)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE bool 
operator== (const SequenceDataInfo &op1, const SequenceDataInfo &op2)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE bool 
operator!= (const SequenceDataInfo &op1, const SequenceDataInfo &op2)
 
template<Alphabet ALPHABET, typename SequenceDataT >
SequenceDataAccess< ALPHABET,
SequenceDataT > 
make_access (const SequenceDataT &data)
 
template<Alphabet ALPHABET, QualityEncoding quality_encoding, typename sequence_type >
void encode (const sequence_type sequence, typename SequenceDataEdit< ALPHABET, SequenceDataView >::sequence_stream_type stream, char *qual_stream)
 
template<Alphabet ALPHABET, typename sequence_type >
void encode (const QualityEncoding quality_encoding, const sequence_type sequence, typename SequenceDataEdit< ALPHABET, SequenceDataView >::sequence_stream_type stream, char *qual_stream)
 
template<Alphabet ALPHABET>
void encode (const SequenceDataEncoder::StrandOp conversion_flags, const QualityEncoding quality_encoding, const uint32 sequence_len, const uint8 *sequence, const uint8 *quality, typename SequenceDataEdit< ALPHABET, SequenceDataView >::sequence_stream_type stream, char *qual_stream)
 
SequenceDataEncodercreate_encoder (const Alphabet alphabet, SequenceDataHost *data)
 
int next (const Alphabet alphabet, SequenceDataHost *data, SequenceDataStream *stream, const uint32 batch_size, const uint32 batch_bps)
 
int append (const Alphabet alphabet, SequenceDataHost *data, SequenceDataStream *stream, const uint32 batch_size, const uint32 batch_bps)
 
int skip (SequenceDataStream *stream, const uint32 batch_size, const uint32 batch_bps)
 
SequenceDataMMAPmap_sequence_file (const char *sequence_file_name)
 
bool is_pac_archive (const char *sequence_file_name)
 
bool load_pac (const Alphabet alphabet, SequenceDataHost *sequence_data, const char *prefix, const SequenceFlags load_flags, const QualityEncoding qualities)
 
bool load_pac (const Alphabet alphabet, SequenceDataMMAPServer *sequence_data, const char *prefix, const char *mapped_name, const SequenceFlags load_flags, const QualityEncoding qualities)
 
SequenceDataStreamopen_sequence_file (const char *sequence_file_name, const QualityEncoding qualities, const uint32 max_seqs, const uint32 max_sequence_len, const SequenceEncoding flags, const uint32 trim3, const uint32 trim5)
 
bool load_sequence_file (const Alphabet alphabet, SequenceDataHost *sequence_data, const char *sequence_file_name, const SequenceFlags load_flags, const QualityEncoding qualities)
 
SequenceDataHostload_sequence_file (const Alphabet alphabet, const char *sequence_file_name, const SequenceFlags load_flags, const QualityEncoding qualities)
 
SequenceDataOutputStreamopen_output_sequence_file (const char *sequence_file_name, const char *options)
 
bool loadVCF (SNPDatabase &output, const char *file_name)
 

Enumeration Type Documentation

Enumerator
SAMFlag_MultipleSegments 
SAMFlag_AllSegmentsAligned 
SAMFlag_SegmentUnmapped 
SAMFlag_NextSegmentUnmapped 
SAMFlag_ReverseComplemented 
SAMFlag_NextSegmentReverseComplemented 
SAMFlag_FirstSegment 
SAMFlag_LastSegment 
SAMFlag_SecondaryAlignment 
SAMFlag_FailedQC 
SAMFlag_Duplicate 
SAMFlag_MultipleSegments 
SAMFlag_AllSegmentsAligned 
SAMFlag_SegmentUnmapped 
SAMFlag_NextSegmentUnmapped 
SAMFlag_ReverseComplemented 
SAMFlag_NextSegmentReverseComplemented 
SAMFlag_FirstSegment 
SAMFlag_LastSegment 
SAMFlag_SecondaryAlignment 
SAMFlag_FailedQC 
SAMFlag_Duplicate 

Definition at line 44 of file sam.h.

Function Documentation

template<typename vector_type >
void nvbio::io::analyze_md_string ( const vector_type  mds,
uint32 &  n_mm,
uint32 &  n_gapo,
uint32 &  n_gape 
)

Definition at line 77 of file output_utils.h.

int nvbio::io::append ( const Alphabet  alphabet,
SequenceDataHost *  data,
SequenceDataStream *  stream,
const uint32  batch_size,
const uint32  batch_bps 
)
related

Definition at line 504 of file sequence_encoder.cpp.

uint32 nvbio::io::compute_cigar_pos ( const uint32  sink,
const uint32  alignment 
)
inline

Definition at line 37 of file output_utils.h.

template<typename vector_type >
uint32 nvbio::io::count_symbols ( const Cigar::Operation  type,
const vector_type  cigar,
const uint32  cigar_len 
)

Definition at line 60 of file output_utils.h.

SequenceDataEncoder * nvbio::io::create_encoder ( const Alphabet  alphabet,
SequenceDataHost *  data 
)

create a sequence encoder

Definition at line 424 of file sequence_encoder.cpp.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool nvbio::io::distinct_alignments ( const uint32  apos1,
const uint32  opos1,
const bool  arc1,
const bool  orc1,
const uint32  apos2,
const uint32  opos2,
const bool  arc2,
const bool  orc2 
)

Definition at line 51 of file alignments_inl.h.

template<Alphabet ALPHABET, QualityEncoding quality_encoding, typename sequence_type >
void nvbio::io::encode ( const sequence_type  sequence,
typename SequenceDataEdit< ALPHABET, SequenceDataView >::sequence_stream_type  stream,
char *  qual_stream 
)

Definition at line 180 of file sequence_encoder.cpp.

template<Alphabet ALPHABET, typename sequence_type >
void nvbio::io::encode ( const QualityEncoding  quality_encoding,
const sequence_type  sequence,
typename SequenceDataEdit< ALPHABET, SequenceDataView >::sequence_stream_type  stream,
char *  qual_stream 
)

Definition at line 207 of file sequence_encoder.cpp.

template<Alphabet ALPHABET>
void nvbio::io::encode ( const SequenceDataEncoder::StrandOp  conversion_flags,
const QualityEncoding  quality_encoding,
const uint32  sequence_len,
const uint8 *  sequence,
const uint8 *  quality,
typename SequenceDataEdit< ALPHABET, SequenceDataView >::sequence_stream_type  stream,
char *  qual_stream 
)

Definition at line 236 of file sequence_encoder.cpp.

template<QualityEncoding quality_encoding, typename read_type >
void nvbio::io::encode ( const read_type  read,
ReadData::read_stream_type::iterator  stream,
char *  qual_stream 
)

Definition at line 382 of file reads.cpp.

template<typename read_type >
void nvbio::io::encode ( const QualityEncoding  quality_encoding,
const read_type  read,
ReadData::read_stream_type::iterator  stream,
char *  qual_stream 
)

Definition at line 409 of file reads.cpp.

void nvbio::io::encode ( const ReadDataRAM::StrandOp  conversion_flags,
const QualityEncoding  quality_encoding,
const uint32  read_len,
const uint8 *  read,
const uint8 *  quality,
ReadData::read_stream_type::iterator  stream,
char *  qual_stream 
)

Definition at line 434 of file reads.cpp.

AlignmentData nvbio::io::get ( HostOutputBatchSE &  batch,
const uint32  aln_id 
)

Definition at line 41 of file output_priv.cpp.

AlignmentData nvbio::io::get_anchor_mate ( HostOutputBatchPE &  batch,
const uint32  aln_id 
)

Definition at line 85 of file output_priv.cpp.

AlignmentData nvbio::io::get_mate ( HostOutputBatchPE &  batch,
const uint32  aln_id,
const AlignmentMate  mate 
)

Definition at line 57 of file output_priv.cpp.

AlignmentData nvbio::io::get_opposite_mate ( HostOutputBatchPE &  batch,
const uint32  aln_id 
)

Definition at line 101 of file output_priv.cpp.

bool nvbio::io::is_pac_archive ( const char *  sequence_file_name)

check whether the file name points to a pac archive

Definition at line 244 of file sequence_pac.cpp.

bool nvbio::io::load_pac ( const Alphabet  alphabet,
SequenceDataHost *  sequence_data,
const char *  prefix,
const SequenceFlags  load_flags,
const QualityEncoding  qualities 
)

load a sequence file

Parameters
sequence_file_namethe file to open
qualitiesthe encoding of the qualities
max_seqsmaximum number of reads to input
max_sequence_lenmaximum read length - reads will be truncated
flagsa set of flags indicating which strands to encode in the batch for each read. For example, passing FORWARD | REVERSE_COMPLEMENT will result in a stream containing BOTH the forward and reverse-complemented strands.

Definition at line 275 of file sequence_pac.cpp.

bool nvbio::io::load_pac ( const Alphabet  alphabet,
struct SequenceDataMMAPServer *  sequence_data,
const char *  prefix,
const char *  mapped_name,
const SequenceFlags  load_flags,
const QualityEncoding  qualities 
)

load a sequence file

Parameters
sequence_file_namethe file to open
qualitiesthe encoding of the qualities
max_seqsmaximum number of reads to input
max_sequence_lenmaximum read length - reads will be truncated
flagsa set of flags indicating which strands to encode in the batch for each read. For example, passing FORWARD | REVERSE_COMPLEMENT will result in a stream containing BOTH the forward and reverse-complemented strands.

Definition at line 359 of file sequence_pac.cpp.

bool nvbio::io::load_sequence_file ( const Alphabet  alphabet,
SequenceDataHost *  sequence_data,
const char *  sequence_file_name,
const SequenceFlags  load_flags,
const QualityEncoding  qualities 
)

Definition at line 227 of file sequence_priv.cpp.

SequenceDataHost* nvbio::io::load_sequence_file ( const Alphabet  alphabet,
const char *  sequence_file_name,
const SequenceFlags  load_flags,
const QualityEncoding  qualities 
)

load a sequence file

Parameters
alphabetthe alphabet used to encode the sequence data
sequence_file_namethe file to open
load_flagsa set of flags indicating what to load
qualitiesthe encoding of the qualities

Definition at line 255 of file sequence_priv.cpp.

bool nvbio::io::loadVCF ( SNPDatabase &  output,
const char *  file_name 
)

Definition at line 95 of file vcf.cpp.

int nvbio::io::next ( const Alphabet  alphabet,
SequenceDataHost *  data,
SequenceDataStream *  stream,
const uint32  batch_size,
const uint32  batch_bps 
)
related

Definition at line 455 of file sequence_encoder.cpp.

SequenceDataOutputStream* nvbio::io::open_output_sequence_file ( const char *  sequence_file_name,
const char *  options 
)
related

Definition at line 276 of file sequence_priv.cpp.

SequenceDataStream* nvbio::io::open_sequence_file ( const char *  sequence_file_name,
const QualityEncoding  qualities,
const uint32  max_seqs,
const uint32  max_sequence_len,
const SequenceEncoding  flags,
const uint32  trim3,
const uint32  trim5 
)
related

Definition at line 85 of file sequence_priv.cpp.

template<typename vector_type >
uint32 nvbio::io::reference_cigar_length ( const vector_type  cigar,
const uint32  cigar_len 
)

Definition at line 44 of file output_utils.h.

int nvbio::io::skip ( SequenceDataStream *  stream,
const uint32  batch_size,
const uint32  batch_bps 
)

Definition at line 553 of file sequence_encoder.cpp.