public class SamAlignmentMerger extends AbstractAlignmentMerger
MAX_RECORDS_IN_RAM, referenceFasta
Constructor and Description |
---|
SamAlignmentMerger(File unmappedBamFile,
File targetBamFile,
File referenceFasta,
SAMProgramRecord programRecord,
boolean clipAdapters,
boolean bisulfiteSequence,
boolean alignedReadsOnly,
List<File> alignedSamFile,
int maxGaps,
List<String> attributesToRetain,
List<String> attributesToRemove,
Integer read1BasesTrimmed,
Integer read2BasesTrimmed,
List<File> read1AlignedSamFile,
List<File> read2AlignedSamFile,
List<SamPairUtil.PairOrientation> expectedOrientations,
SAMFileHeader.SortOrder sortOrder,
PrimaryAlignmentSelectionStrategy primaryAlignmentSelectionStrategy,
boolean addMateCigar)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
getForceSort() |
protected CloseableIterator<SAMRecord> |
getQuerynameSortedAlignedRecords()
Reads the aligned SAM records into a SortingCollection and returns an iterator over that collection
|
protected boolean |
ignoreAlignment(SAMRecord sam)
For now, we only ignore those alignments that have more than
maxGaps insertions
or deletions. |
void |
mergeAlignment(File referenceFasta)
Merges the alignment from the map file with the non-aligned records from the source BAM file.
|
clipForOverlappingReads, close, createNewCigarsIfMapsOffEndOfReference, getHeader, getProgramRecord, getSequenceDictionary, isClipOverlappingReads, isKeepAlignerProperPairFlags, isReservedTag, resetRefSeqFileWalker, setClipOverlappingReads, setIncludeSecondaryAlignments, setKeepAlignerProperPairFlags, setMaxRecordsInRam, setProgramRecord, setValuesFromAlignment, updateCigarForTrimmedOrClippedBases
public SamAlignmentMerger(File unmappedBamFile, File targetBamFile, File referenceFasta, SAMProgramRecord programRecord, boolean clipAdapters, boolean bisulfiteSequence, boolean alignedReadsOnly, List<File> alignedSamFile, int maxGaps, List<String> attributesToRetain, List<String> attributesToRemove, Integer read1BasesTrimmed, Integer read2BasesTrimmed, List<File> read1AlignedSamFile, List<File> read2AlignedSamFile, List<SamPairUtil.PairOrientation> expectedOrientations, SAMFileHeader.SortOrder sortOrder, PrimaryAlignmentSelectionStrategy primaryAlignmentSelectionStrategy, boolean addMateCigar)
unmappedBamFile
- The BAM file that was used as the input to the aligner, which will
include info on all the reads that did not map. Required.targetBamFile
- The file to which to write the merged SAM records. Required.referenceFasta
- The reference sequence for the map files. Required.programRecord
- Program record for taget file SAMRecords created.clipAdapters
- Whether adapters marked in unmapped BAM file should be marked as
soft clipped in the merged bam. Required.bisulfiteSequence
- Whether the reads are bisulfite sequence (used when calculating the
NM and UQ tags). Required.alignedReadsOnly
- Whether to output only those reads that have alignment dataalignedSamFile
- The SAM file(s) with alignment information. Optional. If this is
not provided, then read1AlignedSamFile and read2AlignedSamFile must be.maxGaps
- The maximum number of insertions or deletions permitted in an
alignment. Alignments with more than this many gaps will be ignored.
-1 means to allow any number of gaps.attributesToRetain
- attributes from the alignment record that should be
removed when merging. This overrides attributesToRetain if they share
common tags.read1BasesTrimmed
- The number of bases trimmed from start of read 1 prior to alignment. Optional.read2BasesTrimmed
- The number of bases trimmed from start of read 2 prior to alignment. Optional.read1AlignedSamFile
- The alignment records for read1. Used when the two ends of a read are
aligned separately. This is optional, but must be specified if
alignedSamFile is not.read2AlignedSamFile
- The alignment records for read1. Used when the two ends of a read are
aligned separately. This is optional, but must be specified if
alignedSamFile is not.expectedOrientations
- A List of SamPairUtil.PairOrientations that are expected for
aligned pairs. Used to determine the properPair flag.sortOrder
- The order in which the merged records should be output. If null,
output will be coordinate-sortedprimaryAlignmentSelectionStrategy
- How to handle multiple alignments for a fragment or read pair,
in which none are primary, or more than one is marked primaryaddMateCigar
- True if we are to add or maintain the mate CIGAR (MC) tag, false if we are to remove or not include.public void mergeAlignment(File referenceFasta)
mergeAlignment
in class AbstractAlignmentMerger
protected CloseableIterator<SAMRecord> getQuerynameSortedAlignedRecords()
getQuerynameSortedAlignedRecords
in class AbstractAlignmentMerger
protected boolean ignoreAlignment(SAMRecord sam)
maxGaps
insertions
or deletions.ignoreAlignment
in class AbstractAlignmentMerger
public boolean getForceSort()