LRez  v2.1
Functions
alignmentsRetrieval.h File Reference
#include "utils.h"
#include "indexManagementBam.h"
Include dependency graph for alignmentsRetrieval.h:

Go to the source code of this file.

Functions

vector< BamAlignment > retrieveAlignmentsWithBarcodeBits_BamReader (BamReader &reader, BarcodesOffsetsIndex &BarcodesOffsetsIndex, barcode b)
 
vector< BamAlignment > retrieveAlignmentsWithBarcode_BamReader (BamReader &reader, BarcodesOffsetsIndex &BarcodesOffsetsIndex, string bc)
 
vector< BamAlignment > retrieveAlignmentsWithBarcode (string bamFile, BarcodesOffsetsIndex &BarcodesOffsetsIndex, string bc)
 
vector< BamAlignment > retrieveAlignmentsWithBarcodeBits (string bamFile, BarcodesOffsetsIndex &BarcodesOffsetsIndex, barcode bc)
 
vector< BamAlignment > retrieveAlignmentsWithBarcodes_BamReader (BamReader &reader, BarcodesOffsetsIndex &BarcodesOffsetsIndex, string barcodesList)
 
vector< BamAlignment > retrieveAlignmentsWithBarcodes (string bamFile, BarcodesOffsetsIndex &BarcodesOffsetsIndex, string barcodesList, unsigned nbThreads=1)
 

Function Documentation

◆ retrieveAlignmentsWithBarcode()

vector<BamAlignment> retrieveAlignmentsWithBarcode ( string  bamFile,
BarcodesOffsetsIndex BarcodesOffsetsIndex,
string  bc 
)

Retrieve all the alignments that share a given barcode, in a given BAM file. A barcode index of the BAM must be available.

Parameters
bamFileBAM file to extract alignments from
BarcodesOffsetsIndexbarcode offsets index of the BAM file
bcbarcode of interest
Returns
a vector containing all the alignments sharing the barcode of interest

◆ retrieveAlignmentsWithBarcode_BamReader()

vector<BamAlignment> retrieveAlignmentsWithBarcode_BamReader ( BamReader &  reader,
BarcodesOffsetsIndex BarcodesOffsetsIndex,
string  bc 
)

Retrieve all the alignments that share a given barcode, in a given BAM file. A barcode index of the BAM must be available.

Parameters
readerBamReader open on the desired BAM file
BarcodesOffsetsIndexbarcode offsets index of the BAM file
bcbarcode of interest
Returns
a vector containing all the alignments sharing the barcode of interest

◆ retrieveAlignmentsWithBarcodeBits()

vector<BamAlignment> retrieveAlignmentsWithBarcodeBits ( string  bamFile,
BarcodesOffsetsIndex BarcodesOffsetsIndex,
barcode  bc 
)

Retrieve all the alignments that share a given barcode, in a given BAM file. A barcode index of the BAM must be available.

Parameters
bamFileBAM file to extract alignments from
BarcodesOffsetsIndexbarcode offsets index of the BAM file
bcbarcode of interest, in binary representation
Exceptions
ios_base::failurethrown if bamFile or its associated index could not be open
Returns
a vector containing all the alignments sharing the barcode of interest

◆ retrieveAlignmentsWithBarcodeBits_BamReader()

vector<BamAlignment> retrieveAlignmentsWithBarcodeBits_BamReader ( BamReader &  reader,
BarcodesOffsetsIndex BarcodesOffsetsIndex,
barcode  b 
)

Retrieve all the alignments that share a given barcode, in a given BAM file. A barcode index of the BAM must be available.

Parameters
readerBamReader open on the desired BAM file
BarcodesOffsetsIndexbarcode offsets index of the BAM file
bbarcode of interest, in binary representation
Exceptions
runtime_errorthrown if a given offset of the file where the barcode appears could not be seeked
Returns
a vector containing all the alignments sharing the barcode of interest

◆ retrieveAlignmentsWithBarcodes()

vector<BamAlignment> retrieveAlignmentsWithBarcodes ( string  bamFile,
BarcodesOffsetsIndex BarcodesOffsetsIndex,
string  barcodesList,
unsigned  nbThreads = 1 
)

Retrieve all the alignments that share a barcode appearing in the list of a given file

Parameters
bamFileBAM file to extract alignments from
BarcodesOffsetsIndexbarcode offsets index of the BAM file
barcodesListfile containing the list of barcodes of interest, with one barcode per line
nbThreadsnumber of threads to use, set to 1 by default
Exceptions
ios_base::failurethrown if bamFile or its associated index, or if barcodesList could not be open
Returns
a vector containing all the alignments with the barcodes of interest

◆ retrieveAlignmentsWithBarcodes_BamReader()

vector<BamAlignment> retrieveAlignmentsWithBarcodes_BamReader ( BamReader &  reader,
BarcodesOffsetsIndex BarcodesOffsetsIndex,
string  barcodesList 
)

Retrieve all the alignments that share a barcode appearing in the list of a given file

Parameters
instream open on the BAM fastq file
BarcodesOffsetsIndexbarcode offsets index of the BAM file
barcodesListfile containing the list of barcodes of interest, with one barcode per line
Exceptions
ios_base::failurethrown if barcodesList could not be open
Returns
a vector containing all the alignments with the barcodes of interest