Description Usage Arguments Value Functions Examples
Tests a read to see if its meets some criteria. May return TRUE
for
only one end of a paired end read. These tests are suitable for use in a
samReadFilter
but can result in unpaired reads after
application; pairedReads
should probably be run after running any
of these as filters.
1 2 3 4 5 6 7 8 9 | areReadFlagsSet(read, flags)
areReadFlagsUnset(read, flags)
areReadFlags(read, flagVec)
readHasRef(read, ref)
readMateHasRef(read, ref)
|
read |
The read to test. |
flags |
A character vector of one or more flag names to test against the flags set or unset for a read. |
flagVec |
A logical vector where the names are sam flags and the values
indicate if that flag shoud be set ( |
ref |
Regular expression matched against the reference aligned to.
Keeps a read if |
Returns TRUE
if a read passes the test, FALSE
otherwise.
Different ends of the same template will return the same result.
areReadFlagsSet
: Returns TRUE
if all the specified flags are set for
the read. Equivalent to allSetSamFlags(read$flag, flags)
areReadFlagsUnset
: Returns TRUE
if all the specified flags are set for
the read. Equivalent to allUnsetSamFlags(read$flag, flags)
areReadFlags
: Returns TRUE
if all the flags that set in the
flagVec are set for the read and all the flags that are unset in the
flagVec are unset in the read. If all flags in the flagVec checked are set
or all are unset, it is more efficient to use areReadFlagsSet
or
areReadFlagsUnset
.
readHasRef
: Returns TRUE
if the read is aligned to a
reference identified by the specified regular expressions (matched against
the reads rname
).
readMateHasRef
: Returns TRUE
if the read's mate (other paired
end) is aligned to a reference identified by the specified regular
expressions (matched against the reads rnext
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
sam <- Sam("someFile")
aRead <- SamReads(sam)[1]
areReadFlagsUnset( aRead, "NOT_PRIMARY_ALIGNMENT" )
primaryReads <- samReadFilter( sam, "areReadFlagsUnset", "NOT_PRIMARY_ALIGNMENT" )
areReadFlagsSet( aRead, "NOT_PRIMARY_ALIGNMENT" )
secondaryReads <- samReadFilter( sam, "areReadFlagsSet", "NOT_PRIMARY_ALIGNMENT" )
goodAlignmentFlagVec <- c(
"READ_PAIRED" = TRUE, "PROPER_PAIR" = TRUE,
"READ_UNMAPPED" = FALSE, "MATE_UNMAPPED" = FALSE,
"NOT_PRIMARY_ALIGNMENT" = FALSE, "READ_FAILS_VENDOR_QC" = FALSE,
"DUPLICATE_READ" = FALSE, "SUPPLEMENTARY_ALIGNMENT" = FALSE
)
areReadFlags( aRead, goodAlignmentFlagVec )
goodReads <- samReadFilter( sam, "areReadFlags", goodAlignmentFlagVec )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.