Package picard.sam
Class FixMateInformation
- java.lang.Object
-
- picard.cmdline.CommandLineProgram
-
- picard.sam.FixMateInformation
-
@DocumentedFeature public class FixMateInformation extends CommandLineProgram
Summary
This tool ensures that all mate-pair information is in sync between each read and its mate pair. If noOUTPUT
file is supplied then the output is written to a temporary file and then copied over theINPUT
file (with the original placed in a .old file.) Reads marked with the secondary alignment flag are written to the output file unchanged. However, supplementary reads are corrected so that they point to the primary, non-supplemental mate record.Usage example:
java -jar picard.jar FixMateInformation \ I=input.bam \ O=fixed_mate.bam \ ADD_MATE_CIGAR=true
Caveats
The program should run with fairly limited memory unless there are many mate pairs that are missing or far apart from each other in the file, as it keeps track of the unmatched mates
-
-
Field Summary
Fields Modifier and Type Field Description Boolean
ADD_MATE_CIGAR
boolean
ASSUME_SORTED
Boolean
IGNORE_MISSING_MATES
List<File>
INPUT
protected htsjdk.samtools.SAMFileWriter
out
File
OUTPUT
htsjdk.samtools.SAMFileHeader.SortOrder
SORT_ORDER
-
Fields inherited from class picard.cmdline.CommandLineProgram
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY
-
-
Constructor Summary
Constructors Constructor Description FixMateInformation()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeWriter()
protected void
createSamFileWriter(htsjdk.samtools.SAMFileHeader header)
protected int
doWork()
Do the work after command line has been parsed.static void
main(String[] args)
protected void
writeAlignment(htsjdk.samtools.SAMRecord sam)
-
Methods inherited from class picard.cmdline.CommandLineProgram
customCommandLineValidation, getCommandLine, getCommandLineParser, getDefaultHeaders, getFaqLink, getMetricsFile, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser
-
-
-
-
Field Detail
-
INPUT
@Argument(shortName="I", doc="The input files to check and fix. Multiple files will be merged and sorted.") public List<File> INPUT
-
OUTPUT
@Argument(shortName="O", optional=true, doc="The output file to write to. If no output file is supplied, the input file is overwritten (only available with single input file).") public File OUTPUT
-
SORT_ORDER
@Argument(shortName="SO", optional=true, doc="Optional sort order if the OUTPUT file should be sorted differently than the INPUT file.") public htsjdk.samtools.SAMFileHeader.SortOrder SORT_ORDER
-
ASSUME_SORTED
@Argument(doc="If true, assume that the input file is queryname sorted, even if the header says otherwise.", shortName="AS") public boolean ASSUME_SORTED
-
ADD_MATE_CIGAR
@Argument(shortName="MC", optional=true, doc="Adds the mate CIGAR tag (MC) if true, does not if false.") public Boolean ADD_MATE_CIGAR
-
IGNORE_MISSING_MATES
@Argument(doc="If true, ignore missing mates, otherwise will throw an exception when missing mates are found.", optional=true) public Boolean IGNORE_MISSING_MATES
-
out
protected htsjdk.samtools.SAMFileWriter out
-
-
Method Detail
-
main
public static void main(String[] args)
-
doWork
protected int doWork()
Description copied from class:CommandLineProgram
Do the work after command line has been parsed. RuntimeException may be thrown by this method, and are reported appropriately.- Specified by:
doWork
in classCommandLineProgram
- Returns:
- program exit status.
-
createSamFileWriter
protected void createSamFileWriter(htsjdk.samtools.SAMFileHeader header)
-
writeAlignment
protected void writeAlignment(htsjdk.samtools.SAMRecord sam)
-
closeWriter
protected void closeWriter()
-
-