public final class ArtificialReadUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_READ_LENGTH |
static java.lang.String |
READ_GROUP_ID |
Constructor and Description |
---|
ArtificialReadUtils() |
Modifier and Type | Method and Description |
---|---|
static GATKRead |
createArtificialRead(byte[] bases,
byte[] qual,
java.lang.String cigar) |
static GATKRead |
createArtificialRead(htsjdk.samtools.Cigar cigar) |
static GATKRead |
createArtificialRead(htsjdk.samtools.Cigar cigar,
java.lang.String name) |
static GATKRead |
createArtificialRead(htsjdk.samtools.SAMFileHeader header,
byte[] bases,
byte[] qual,
java.lang.String cigar)
Create an artificial GATKRead with the following default parameters :
header:
numberOfChromosomes = 1
startingChromosome = 1
chromosomeSize = 1000000
read:
name = "default_read"
refIndex = 0
alignmentStart = 10000
|
static GATKRead |
createArtificialRead(htsjdk.samtools.SAMFileHeader header,
htsjdk.samtools.Cigar cigar) |
static GATKRead |
createArtificialRead(htsjdk.samtools.SAMFileHeader header,
java.lang.String cigarString) |
static GATKRead |
createArtificialRead(htsjdk.samtools.SAMFileHeader header,
java.lang.String name,
int refIndex,
int alignmentStart,
byte[] bases,
byte[] qual)
Create an artificial GATKRead based on the parameters.
|
static GATKRead |
createArtificialRead(htsjdk.samtools.SAMFileHeader header,
java.lang.String name,
int refIndex,
int alignmentStart,
byte[] bases,
byte[] qual,
java.lang.String cigar)
Create an artificial GATKRead based on the parameters
|
static GATKRead |
createArtificialRead(htsjdk.samtools.SAMFileHeader header,
java.lang.String name,
int refIndex,
int alignmentStart,
int length)
Create an artificial GATKRead based on the parameters.
|
static GATKRead |
createArtificialRead(htsjdk.samtools.SAMFileHeader header,
java.lang.String name,
java.lang.String contig,
int alignmentStart,
byte[] bases,
byte[] qual)
Create an artificial GATKRead based on the parameters.
|
static GATKRead |
createArtificialRead(htsjdk.samtools.SAMFileHeader header,
java.lang.String name,
java.lang.String contig,
int alignmentStart,
byte[] bases,
byte[] qual,
java.lang.String cigar)
Create an artificial GATKRead based on the parameters
|
static GATKRead |
createArtificialRead(java.lang.String cigarString) |
static htsjdk.samtools.SAMFileHeader |
createArtificialSamHeader()
Creates an artificial SAM header with standard test parameters
|
static htsjdk.samtools.SAMFileHeader |
createArtificialSamHeader(int numberOfChromosomes,
int startingChromosome,
int chromosomeSize)
Creates an artificial SAM header, matching the parameters, chromosomes which will be labeled chr1, chr2, etc
|
static htsjdk.samtools.SAMFileHeader |
createArtificialSamHeader(htsjdk.samtools.SAMSequenceDictionary dict)
Creates an artificial SAM header based on the sequence dictionary dict
|
static htsjdk.samtools.SAMFileHeader |
createArtificialSamHeaderWithGroups(int numberOfChromosomes,
int startingChromosome,
int chromosomeSize,
int groupCount)
Creates an artificial SAM header, matching the parameters, chromosomes which will be labeled chr1, chr2, etc
It also adds read groups.
|
static htsjdk.samtools.SAMFileHeader |
createArtificialSamHeaderWithPrograms(int numberOfChromosomes,
int startingChromosome,
int chromosomeSize,
int programCount)
Creates an artificial SAM header, matching the parameters, chromosomes which will be labeled chr1, chr2, etc
It also adds program records.
|
static htsjdk.samtools.SAMFileHeader |
createArtificialSamHeaderWithReadGroup(htsjdk.samtools.SAMReadGroupRecord readGroup)
Creates an artificial SAM header with standard test parameters and a Read Group
|
static htsjdk.samtools.SAMRecord |
createArtificialSAMRecord(byte[] bases,
byte[] qual,
java.lang.String cigar) |
static htsjdk.samtools.SAMRecord |
createArtificialSAMRecord(htsjdk.samtools.Cigar cigar) |
static htsjdk.samtools.SAMRecord |
createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header,
byte[] bases,
byte[] qual,
java.lang.String cigar)
Create an artificial SAMRecord with the following default parameters :
header:
numberOfChromosomes = 1
startingChromosome = 1
chromosomeSize = 1000000
read:
name = "default_read"
refIndex = 0
alignmentStart = 10000
|
static htsjdk.samtools.SAMRecord |
createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header,
htsjdk.samtools.Cigar cigar) |
static htsjdk.samtools.SAMRecord |
createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header,
htsjdk.samtools.Cigar cigar,
java.lang.String name) |
static htsjdk.samtools.SAMRecord |
createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header,
java.lang.String name,
int refIndex,
int alignmentStart,
byte[] bases,
byte[] qual)
Create an artificial SAMRecord based on the parameters.
|
static htsjdk.samtools.SAMRecord |
createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header,
java.lang.String name,
int refIndex,
int alignmentStart,
byte[] bases,
byte[] qual,
java.lang.String cigar)
Create an artificial SAMRecord based on the parameters
|
static htsjdk.samtools.SAMRecord |
createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header,
java.lang.String name,
int refIndex,
int alignmentStart,
int length)
Create an artificial SAMRecord based on the parameters.
|
static GATKRead |
createArtificialUnmappedRead(htsjdk.samtools.SAMFileHeader header,
byte[] bases,
byte[] qual) |
static GATKRead |
createArtificialUnmappedReadWithAssignedPosition(htsjdk.samtools.SAMFileHeader header,
java.lang.String contig,
int alignmentStart,
byte[] bases,
byte[] qual) |
static GATKRead |
createHeaderlessSamBackedRead(java.lang.String name,
java.lang.String contig,
int start,
int length)
Creates an artificial GATKRead backed by a SAMRecord with no header.
|
static java.util.Collection<GATKRead> |
createIdenticalArtificialReads(int size,
htsjdk.samtools.SAMFileHeader header,
java.lang.String name,
int refIndex,
int alignmentStart,
int length)
Create a collection of identical artificial reads based on the parameters.
|
static PileupElement |
createNonIndelPileupElement(int offsetIntoRead,
htsjdk.variant.variantcontext.Allele newAllele,
int lengthOfRead)
See
createSplicedInsertionPileupElement(int, htsjdk.variant.variantcontext.Allele, int) , except that this method returns a
pileup element containing base-by-base replacement. |
static java.util.List<GATKRead> |
createPair(htsjdk.samtools.SAMFileHeader header,
java.lang.String name,
int readLen,
int leftStart,
int rightStart,
boolean leftIsFirst,
boolean leftIsNegative) |
static java.util.List<GATKRead> |
createPair(htsjdk.samtools.SAMFileHeader header,
java.lang.String name,
int readLen,
int refIndex,
int leftStart,
int rightStart,
boolean leftIsFirst,
boolean leftIsNegative) |
static GATKRead |
createRandomRead(int length) |
static GATKRead |
createRandomRead(int length,
boolean allowNs) |
static GATKRead |
createRandomRead(htsjdk.samtools.SAMFileHeader header,
int length) |
static GATKRead |
createRandomRead(htsjdk.samtools.SAMFileHeader header,
int length,
boolean allowNs) |
static byte[] |
createRandomReadBases(int length,
boolean allowNs)
Create random read qualities
|
static byte[] |
createRandomReadQuals(int length)
Create random read qualities
|
static GATKRead |
createSamBackedRead(java.lang.String name,
int start,
int length)
Creates an artificial GATKRead backed by a SAMRecord.
|
static GATKRead |
createSamBackedRead(java.lang.String name,
java.lang.String contig,
int start,
int length)
Creates an artificial GATKRead backed by a SAMRecord.
|
static PileupElement |
createSplicedDeletionPileupElement(int offsetIntoRead,
htsjdk.variant.variantcontext.Allele referenceAllele,
int lengthOfRead)
See
createSplicedInsertionPileupElement(int, htsjdk.variant.variantcontext.Allele, int) , except that this method returns a
pileup element containing the specified deletion. |
static PileupElement |
createSplicedInsertionPileupElement(int offsetIntoRead,
htsjdk.variant.variantcontext.Allele insertionAllele,
int lengthOfRead)
Create a pileupElement with the given insertion added to the bases.
|
static GATKRead |
createUniqueArtificialRead(htsjdk.samtools.Cigar cigar)
Makes a new read with a name that is unique (so that it will return false to equals(otherRead)
|
static GATKRead |
createUniqueArtificialRead(java.lang.String cigarString)
Makes a new read with a name that is unique (so that it will return false to equals(otherRead)
|
static htsjdk.samtools.SAMRecord |
createUniqueArtificialSAMRecord(htsjdk.samtools.Cigar cigar)
Makes a new read with a name that is unique (so that it will return false to equals(otherRead)
|
static ArtificialReadQueryIterator |
mappedAndUnmappedReadIterator(int startingChr,
int endingChr,
int readCount,
int unmappedReadCount)
create an iterator containing the specified read piles
|
static ArtificialReadQueryIterator |
mappedReadIterator(int startingChr,
int endingChr,
int readCount)
create an iterator containing the specified read piles
|
public static final int DEFAULT_READ_LENGTH
public static final java.lang.String READ_GROUP_ID
public static htsjdk.samtools.SAMFileHeader createArtificialSamHeader(int numberOfChromosomes, int startingChromosome, int chromosomeSize)
numberOfChromosomes
- the number of chromosomes to createstartingChromosome
- the starting number for the chromosome (most likely set to 1)chromosomeSize
- the length of each chromosomepublic static htsjdk.samtools.SAMFileHeader createArtificialSamHeaderWithGroups(int numberOfChromosomes, int startingChromosome, int chromosomeSize, int groupCount)
numberOfChromosomes
- the number of chromosomes to createstartingChromosome
- the starting number for the chromosome (most likely set to 1)chromosomeSize
- the length of each chromosomegroupCount
- the number of groups to makepublic static htsjdk.samtools.SAMFileHeader createArtificialSamHeaderWithPrograms(int numberOfChromosomes, int startingChromosome, int chromosomeSize, int programCount)
numberOfChromosomes
- the number of chromosomes to createstartingChromosome
- the starting number for the chromosome (most likely set to 1)chromosomeSize
- the length of each chromosomeprogramCount
- the number of programs to makepublic static htsjdk.samtools.SAMFileHeader createArtificialSamHeader()
public static htsjdk.samtools.SAMFileHeader createArtificialSamHeaderWithReadGroup(htsjdk.samtools.SAMReadGroupRecord readGroup)
readGroup
- read grouppublic static GATKRead createArtificialRead(htsjdk.samtools.SAMFileHeader header, java.lang.String name, int refIndex, int alignmentStart, int length)
header
- the SAM header to associate the read withname
- the name of the readrefIndex
- the reference index, i.e. what chromosome to associate it withalignmentStart
- where to start the alignmentlength
- the length of the readpublic static GATKRead createArtificialRead(htsjdk.samtools.SAMFileHeader header, java.lang.String name, int refIndex, int alignmentStart, byte[] bases, byte[] qual)
header
- the SAM header to associate the read withname
- the name of the readrefIndex
- the reference index, i.e. what chromosome to associate it withalignmentStart
- where to start the alignmentbases
- the sequence of the readqual
- the qualities of the readpublic static GATKRead createArtificialRead(htsjdk.samtools.SAMFileHeader header, java.lang.String name, java.lang.String contig, int alignmentStart, byte[] bases, byte[] qual)
header
- the SAM header to associate the read withname
- the name of the readcontig
- the contig to which the read is alignedalignmentStart
- where to start the alignmentbases
- the sequence of the readqual
- the qualities of the readpublic static GATKRead createArtificialRead(htsjdk.samtools.SAMFileHeader header, java.lang.String name, int refIndex, int alignmentStart, byte[] bases, byte[] qual, java.lang.String cigar)
header
- the SAM header to associate the read withname
- the name of the readrefIndex
- the reference index, i.e. what chromosome to associate it withalignmentStart
- where to start the alignmentbases
- the sequence of the readqual
- the qualities of the readcigar
- the cigar string of the readpublic static GATKRead createArtificialRead(htsjdk.samtools.SAMFileHeader header, java.lang.String name, java.lang.String contig, int alignmentStart, byte[] bases, byte[] qual, java.lang.String cigar)
header
- the SAM header to associate the read withname
- the name of the readcontig
- the contig to which the read is alignedalignmentStart
- where to start the alignmentbases
- the sequence of the readqual
- the qualities of the readcigar
- the cigar string of the readpublic static GATKRead createArtificialRead(htsjdk.samtools.SAMFileHeader header, byte[] bases, byte[] qual, java.lang.String cigar)
header
- SAM header for the readbases
- the sequence of the readqual
- the qualities of the readcigar
- the cigar string of the readpublic static GATKRead createArtificialRead(byte[] bases, byte[] qual, java.lang.String cigar)
public static GATKRead createArtificialRead(htsjdk.samtools.SAMFileHeader header, java.lang.String cigarString)
public static GATKRead createArtificialRead(htsjdk.samtools.SAMFileHeader header, htsjdk.samtools.Cigar cigar)
public static GATKRead createArtificialRead(htsjdk.samtools.Cigar cigar)
public static GATKRead createUniqueArtificialRead(htsjdk.samtools.Cigar cigar)
public static GATKRead createArtificialRead(htsjdk.samtools.Cigar cigar, java.lang.String name)
public static GATKRead createArtificialRead(java.lang.String cigarString)
public static GATKRead createArtificialUnmappedRead(htsjdk.samtools.SAMFileHeader header, byte[] bases, byte[] qual)
public static GATKRead createArtificialUnmappedReadWithAssignedPosition(htsjdk.samtools.SAMFileHeader header, java.lang.String contig, int alignmentStart, byte[] bases, byte[] qual)
public static GATKRead createUniqueArtificialRead(java.lang.String cigarString)
public static GATKRead createSamBackedRead(java.lang.String name, int start, int length)
name
- name of the new readstart
- start position of the new readlength
- number of bases in the new readpublic static GATKRead createSamBackedRead(java.lang.String name, java.lang.String contig, int start, int length)
name
- name of the new readcontig
- contig the new read is mapped tostart
- start position of the new readlength
- number of bases in the new readpublic static GATKRead createHeaderlessSamBackedRead(java.lang.String name, java.lang.String contig, int start, int length)
name
- name of the new readcontig
- contig the new read is mapped tostart
- start position of the new readlength
- number of bases in the new readpublic static htsjdk.samtools.SAMRecord createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header, java.lang.String name, int refIndex, int alignmentStart, int length)
header
- the SAM header to associate the read withname
- the name of the readrefIndex
- the reference index, i.e. what chromosome to associate it withalignmentStart
- where to start the alignmentlength
- the length of the readpublic static htsjdk.samtools.SAMRecord createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header, java.lang.String name, int refIndex, int alignmentStart, byte[] bases, byte[] qual)
header
- the SAM header to associate the read withname
- the name of the readrefIndex
- the reference index, i.e. what chromosome to associate it withalignmentStart
- where to start the alignmentbases
- the sequence of the readqual
- the qualities of the readpublic static htsjdk.samtools.SAMRecord createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header, java.lang.String name, int refIndex, int alignmentStart, byte[] bases, byte[] qual, java.lang.String cigar)
header
- the SAM header to associate the read withname
- the name of the readrefIndex
- the reference index, i.e. what chromosome to associate it withalignmentStart
- where to start the alignmentbases
- the sequence of the readqual
- the qualities of the readcigar
- the cigar string of the readpublic static htsjdk.samtools.SAMRecord createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header, byte[] bases, byte[] qual, java.lang.String cigar)
header
- SAM header for the readbases
- the sequence of the readqual
- the qualities of the readcigar
- the cigar string of the readpublic static htsjdk.samtools.SAMRecord createArtificialSAMRecord(byte[] bases, byte[] qual, java.lang.String cigar)
public static htsjdk.samtools.SAMRecord createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header, htsjdk.samtools.Cigar cigar, java.lang.String name)
public static htsjdk.samtools.SAMRecord createArtificialSAMRecord(htsjdk.samtools.SAMFileHeader header, htsjdk.samtools.Cigar cigar)
public static htsjdk.samtools.SAMRecord createArtificialSAMRecord(htsjdk.samtools.Cigar cigar)
public static htsjdk.samtools.SAMRecord createUniqueArtificialSAMRecord(htsjdk.samtools.Cigar cigar)
public static java.util.List<GATKRead> createPair(htsjdk.samtools.SAMFileHeader header, java.lang.String name, int readLen, int leftStart, int rightStart, boolean leftIsFirst, boolean leftIsNegative)
public static java.util.List<GATKRead> createPair(htsjdk.samtools.SAMFileHeader header, java.lang.String name, int readLen, int refIndex, int leftStart, int rightStart, boolean leftIsFirst, boolean leftIsNegative)
public static java.util.Collection<GATKRead> createIdenticalArtificialReads(int size, htsjdk.samtools.SAMFileHeader header, java.lang.String name, int refIndex, int alignmentStart, int length)
size
- number of identical reads to createheader
- the SAM header to associate each read withname
- name associated with each readrefIndex
- the reference index, i.e. what chromosome to associate them withalignmentStart
- where to start each alignmentlength
- the length of each readpublic static GATKRead createRandomRead(htsjdk.samtools.SAMFileHeader header, int length)
public static GATKRead createRandomRead(int length)
public static GATKRead createRandomRead(htsjdk.samtools.SAMFileHeader header, int length, boolean allowNs)
public static GATKRead createRandomRead(int length, boolean allowNs)
public static byte[] createRandomReadQuals(int length)
length
- the length of the readpublic static byte[] createRandomReadBases(int length, boolean allowNs)
length
- the length of the readallowNs
- whether or not to allow N's in the readpublic static ArtificialReadQueryIterator mappedReadIterator(int startingChr, int endingChr, int readCount)
startingChr
- the chromosome (reference ID) to start fromendingChr
- the id to end withreadCount
- the number of reads per chromosomepublic static ArtificialReadQueryIterator mappedAndUnmappedReadIterator(int startingChr, int endingChr, int readCount, int unmappedReadCount)
startingChr
- the chromosome (reference ID) to start fromendingChr
- the id to end withreadCount
- the number of reads per chromosomeunmappedReadCount
- the count of unmapped reads to place at the end of the iterator, like in a sorted bam filepublic static htsjdk.samtools.SAMFileHeader createArtificialSamHeader(htsjdk.samtools.SAMSequenceDictionary dict)
public static PileupElement createSplicedInsertionPileupElement(int offsetIntoRead, htsjdk.variant.variantcontext.Allele insertionAllele, int lengthOfRead)
offsetIntoRead
- the offset into the read where the insertion Allele should appear. As a reminder, the
insertion allele should have a single ref base prepend. Must be 0 - (lengthOfRead-1)insertionAllele
- the allele as you would see in a VCF for the insertion. So, it is prepended with a ref base. Never null
lengthOfRead
- the length of the artificial read. Does not include any length differences due to the spliced indel. Must be greater than zero.public static PileupElement createSplicedDeletionPileupElement(int offsetIntoRead, htsjdk.variant.variantcontext.Allele referenceAllele, int lengthOfRead)
createSplicedInsertionPileupElement(int, htsjdk.variant.variantcontext.Allele, int)
, except that this method returns a
pileup element containing the specified deletion.offsetIntoRead
- See createSplicedInsertionPileupElement(int, htsjdk.variant.variantcontext.Allele, int)
referenceAllele
- the reference allele as you would see in a VCF for the deletion.
In other words, it is the deletion prepended with a single ref base. Never null
lengthOfRead
- See createSplicedInsertionPileupElement(int, htsjdk.variant.variantcontext.Allele, int)
public static PileupElement createNonIndelPileupElement(int offsetIntoRead, htsjdk.variant.variantcontext.Allele newAllele, int lengthOfRead)
createSplicedInsertionPileupElement(int, htsjdk.variant.variantcontext.Allele, int)
, except that this method returns a
pileup element containing base-by-base replacement. As a result, the length of the read will not change.offsetIntoRead
- See createSplicedInsertionPileupElement(int, htsjdk.variant.variantcontext.Allele, int)
newAllele
- The new bases that should be in the read at the specified position. If this allele causes the
replacement to extend beyond the end of the read
(i.e. offsetIntoRead + length(newAllele) is greater than length of read),
the replacement will be truncated.lengthOfRead
- See createSplicedInsertionPileupElement(int, htsjdk.variant.variantcontext.Allele, int)