-
Notifications
You must be signed in to change notification settings - Fork 603
Added setUnplaced() to the GATKRead api to distinguish reads with no mapping information #5320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -469,6 +469,21 @@ default int numCigarElements(){ | |
*/ | ||
void setIsUnmapped(); | ||
|
||
/** | ||
* Does the read have a position assigned to it for sorting purposes. | ||
* @return `true iff this read has no assigned position or contig. | ||
*/ | ||
boolean isUnplaced(); | ||
|
||
/** | ||
* Mark the read as unmapped, and also removes mapping information from the read (i.e. sets contig to {@link ReadConstants#UNSET_CONTIG} and position to {@link ReadConstants#UNSET_POSITION}). | ||
* | ||
* NOTE: this does not remove the cigar string from the read, use {@link #setCigar(Cigar)} | ||
* | ||
* To mark a read as mapped, use {@link #setPosition} | ||
*/ | ||
void setIsUnplaced(); | ||
|
||
/** | ||
* @return True if this read's mate is unmapped (this includes mates that have a position but are explicitly marked as unmapped, | ||
* as well as mates that lack a fully-defined position but are not explicitly marked as unmapped). Otherwise false. | ||
|
@@ -477,7 +492,7 @@ default int numCigarElements(){ | |
boolean mateIsUnmapped(); | ||
|
||
/** | ||
* Mark the read's mate as unmapped (lacking a defined position on the genome). | ||
* Mark the read's mate as unmapped (lacking a defined position on the genome). (i.e. sets mate contig to {@link ReadConstants#UNSET_CONTIG} and position to {@link ReadConstants#UNSET_POSITION}). | ||
* | ||
* To mark the read's mate as mapped, use {@link #setMatePosition} | ||
* | ||
|
@@ -486,6 +501,23 @@ default int numCigarElements(){ | |
*/ | ||
void setMateIsUnmapped(); | ||
|
||
/** | ||
* Does the reads mate have a position assigned to it for sorting purposes.. | ||
* @return `true iff this reads mate has no assigned position or contig. | ||
*/ | ||
boolean mateIsUnplaced(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar to above comments There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. provide a default implementation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately I can't provide a default implementation here because getContig() masks empty values. The whole point of this PR was to provide better access to the contig index and start position in samrecord beyond what getContig(), and getStart() currently provide. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you're right that there isn't a getMateAssignedContig. Should there be? |
||
|
||
/** | ||
* Mark the read's mate as unmapped (lacking a defined position on the genome). In contrast with {@link #setMateIsUnmapped}, | ||
* this method will revert the mapping information for the mate (i.e. sets the mate's contig to "*" and position to 0). | ||
* | ||
* To mark the read's mate as mapped, use {@link #setMatePosition} | ||
* | ||
* Calling this method has the additional effect of marking the read as paired, as if {@link #setIsPaired} | ||
* were invoked with true. | ||
*/ | ||
void setMateIsUnplaced(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar to above comments |
||
|
||
/** | ||
* @return True if this read is on the reverse strand as opposed to the forward strand, otherwise false. | ||
* @throws GATKException.MissingReadField if this information is not available | ||
|
@@ -715,6 +747,12 @@ default int numCigarElements(){ | |
*/ | ||
String getSAMString(); | ||
|
||
/** | ||
* Modify this read by reverse complementing its bases and reversing its quality scores. Implementations may | ||
* also update tags that are known to need updating after the reverse complement operation. | ||
*/ | ||
public void reverseComplement(); | ||
|
||
/** | ||
* A human-digestable representation of the read. | ||
* NOTE: java will not let us have a default method override toString so we need this dance. Subclasses should override toString | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would provide a default implementation of this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same response as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't a default implementation of this one use getAssignedContig?