The functions has*
can be used to subset the GRanges object containing
information about tRNAs.
Please not that the settings mismatches
and bulged
take
precedence before unpaired
or paired
. This means that by
setting either mismatches
or bulged
to either TRUE
or
FALSE
, unpaired = TRUE
or paired = TRUE
are
automatically set to allow specific subsetting. If this removes elements from
the results, please consider constructing a logical vectors with two calls as
suggested in the examples.
hasTStem(x, length = NA, unpaired = NA, mismatches = NA, bulged = NA)
hasDStem(x, length = NA, unpaired = NA, mismatches = NA, bulged = NA)
hasAcceptorStem(x, length = NA, unpaired = NA, mismatches = NA, bulged = NA)
hasAnticodonStem(x, length = NA, unpaired = NA, mismatches = NA, bulged = NA)
hasTloop(x, length = NA)
hasDloop(x, length = NA)
hasAnticodonLoop(x, length = NA)
hasVariableLoop(x, length = NA, paired = NA, mismatches = NA, bulged = NA)
# S4 method for GRanges
hasTStem(x, length = NA, unpaired = NA, mismatches = NA, bulged = NA)
# S4 method for GRanges
hasDStem(x, length = NA, unpaired = NA, mismatches = NA, bulged = NA)
# S4 method for GRanges
hasAcceptorStem(x, length = NA, unpaired = NA, mismatches = NA, bulged = NA)
# S4 method for GRanges
hasAnticodonStem(x, length = NA, unpaired = NA, mismatches = NA, bulged = NA)
# S4 method for GRanges
hasTloop(x, length = NA)
# S4 method for GRanges
hasDloop(x, length = NA)
# S4 method for GRanges
hasAnticodonLoop(x, length = NA)
# S4 method for GRanges
hasVariableLoop(x, length = NA, paired = NA, mismatches = NA, bulged = NA)
a GRanges object from a tRNAscan import or with equivalent information
the length as integer
logical: has unpaired nucleotides
logical: has mismatched nucleotides
logical: has mismatched nucleotides of different length creating a bulge
logical: has paired nucleotides (only used for loops)
a logical vector of the length or input GRanges object
data("gr", package = "tRNA")
hasTStem(gr, length = 5, mismatches = TRUE)
#> [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [25] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [49] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [61] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [97] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [109] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [121] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [133] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [145] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE
#> [157] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [169] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [181] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [193] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [205] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [217] FALSE FALSE TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
#> [229] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [241] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [253] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [265] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
#> [277] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [289] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
gr[hasTStem(gr, length = 5, mismatches = TRUE)]
#> GRanges object with 11 ranges and 18 metadata columns:
#> seqnames ranges strand | no tRNA_length tRNA_type
#> <Rle> <IRanges> <Rle> | <integer> <integer> <character>
#> [1] chrIII 227942-228042 + | 4 81 Ser
#> [2] chrIV 1175829-1175901 + | 12 72 Met
#> [3] chrV 288443-288524 - | 17 81 Ser
#> [4] chrIX 248850-248931 + | 4 81 Ser
#> [5] chrX 391043-391115 - | 19 72 Met
#> [6] chrX 422937-423009 + | 8 72 Met
#> [7] chrXIII 572883-572955 - | 12 72 Met
#> [8] chrXIII 808246-808317 - | 8 70 Gln
#> [9] chrXV 976421-976493 + | 12 72 Met
#> [10] chrXVI 689565-689646 + | 3 81 Ser
#> [11] chrmt 731-802 + | 1 71 Pro
#> tRNA_anticodon tRNA_anticodon.start tRNA_anticodon.end tRNAscan_score
#> <character> <integer> <integer> <numeric>
#> [1] CGA 34 36 71.6
#> [2] CAT 34 36 69.9
#> [3] TGA 34 36 80.1
#> [4] TGA 34 36 80.1
#> [5] CAT 34 36 69.9
#> [6] CAT 34 36 69.9
#> [7] CAT 34 36 69.9
#> [8] CTG 34 36 59.9
#> [9] CAT 34 36 69.9
#> [10] TGA 34 36 80.1
#> [11] TGG 33 35 37.0
#> tRNA_seq tRNA_str tRNA_CCA.end
#> <RNAStringSet> <DotBracketStringSet> <logical>
#> [1] GGCACUAUGG...GCUGGUGUCG <<<<<<<..<...>>>>>>>>>. FALSE
#> [2] GCUUCAGUAG...CCCUGGAGCA <<<<<<<..<....>>>>>>>>. FALSE
#> [3] GGCACUAUGG...GCUGGUGUCG <<<<<<<..<...>>>>>>>>>. FALSE
#> [4] GGCACUAUGG...GCUGGUGUCG <<<<<<<..<...>>>>>>>>>. FALSE
#> [5] GCUUCAGUAG...CCCUGGAGCA <<<<<<<..<....>>>>>>>>. FALSE
#> [6] GCUUCAGUAG...CCCUGGAGCA <<<<<<<..<....>>>>>>>>. FALSE
#> [7] GCUUCAGUAG...CCCUGGAGCA <<<<<<<..<....>>>>>>>>. FALSE
#> [8] GGUCCUAUAG...GGUGGGACCU <<<<<<<..<...>>>>>>>>>. FALSE
#> [9] GCUUCAGUAG...CCCUGGAGCA <<<<<<<..<....>>>>>>>>. FALSE
#> [10] GGCACUAUGG...GCUGGUGUCG <<<<<<<..<...>>>>>>>>>. FALSE
#> [11] CAGAUAGAAG...UCCUAUCUGA <<<<<<<..<....>>>>>>>>. FALSE
#> tRNAscan_potential.pseudogene tRNAscan_intron.start tRNAscan_intron.end
#> <logical> <integer> <integer>
#> [1] FALSE 227979 227997
#> [2] FALSE <NA> <NA>
#> [3] FALSE <NA> <NA>
#> [4] FALSE <NA> <NA>
#> [5] FALSE <NA> <NA>
#> [6] FALSE <NA> <NA>
#> [7] FALSE <NA> <NA>
#> [8] FALSE <NA> <NA>
#> [9] FALSE <NA> <NA>
#> [10] FALSE <NA> <NA>
#> [11] FALSE <NA> <NA>
#> tRNAscan_intron.locstart tRNAscan_intron.locend tRNAscan_hmm.score
#> <integer> <integer> <numeric>
#> [1] 38 56 48.7
#> [2] <NA> <NA> 53.7
#> [3] <NA> <NA> 58.0
#> [4] <NA> <NA> 58.0
#> [5] <NA> <NA> 53.7
#> [6] <NA> <NA> 53.7
#> [7] <NA> <NA> 53.7
#> [8] <NA> <NA> 36.7
#> [9] <NA> <NA> 53.7
#> [10] <NA> <NA> 58.0
#> [11] <NA> <NA> NA
#> tRNAscan_sec.str.score tRNAscan_infernal
#> <numeric> <numeric>
#> [1] 22.9 NA
#> [2] 16.2 NA
#> [3] 22.1 NA
#> [4] 22.1 NA
#> [5] 16.2 NA
#> [6] 16.2 NA
#> [7] 16.2 NA
#> [8] 23.2 NA
#> [9] 16.2 NA
#> [10] 22.1 NA
#> [11] NA NA
#> -------
#> seqinfo: 17 sequences from an unspecified genome; no seqlengths
gr[hasDStem(gr, unpaired = FALSE) & hasDStem(gr, mismatches = FALSE)]
#> GRanges object with 298 ranges and 18 metadata columns:
#> seqnames ranges strand | no tRNA_length tRNA_type
#> <Rle> <IRanges> <Rle> | <integer> <integer> <character>
#> [1] chrI 139152-139254 + | 1 71 Pro
#> [2] chrI 166267-166339 + | 2 72 Ala
#> [3] chrI 181141-181254 + | 3 80 Leu
#> [4] chrI 182522-182603 - | 4 81 Ser
#> [5] chrII 9583-9666 + | 1 82 Leu
#> ... ... ... ... . ... ... ...
#> [294] chrmt 72632-72705 + | 20 72 Met
#> [295] chrmt 77431-77502 + | 21 71 Phe
#> [296] chrmt 78091-78162 - | 24 71 Sup
#> [297] chrmt 78533-78605 + | 22 72 Val
#> [298] chrmt 85035-85107 + | 23 72 Met
#> tRNA_anticodon tRNA_anticodon.start tRNA_anticodon.end tRNAscan_score
#> <character> <integer> <integer> <numeric>
#> [1] TGG 33 35 62.1
#> [2] TGC 34 36 76.0
#> [3] CAA 35 37 57.5
#> [4] AGA 34 36 83.1
#> [5] TAA 35 37 75.2
#> ... ... ... ... ...
#> [294] CAT 35 37 61.2
#> [295] GAA 33 35 60.1
#> [296] TTA 33 35 51.3
#> [297] TAC 34 36 64.6
#> [298] CAT 35 37 51.2
#> tRNA_seq tRNA_str tRNA_CCA.end
#> <RNAStringSet> <DotBracketStringSet> <logical>
#> [1] GGGCGUGUGG...AGCUCGCCCC <<<<<.<..<...>>>.>>>>>. FALSE
#> [2] GGGCACAUGG...GUUGCGUCCA <<<<.<<..<...>>>>.>>>>. FALSE
#> [3] GGUUGUUUGG...UUAGCAACCA <<<<<<<..<...>>>>>>>>>. FALSE
#> [4] GGCAACUUGG...GCAGUUGUCG <<<<<<<..<...>>>>>>>>>. FALSE
#> [5] GGAGGGUUGG...GCAUCCUUCA <<<<<<<..<...>>>>>>>>>. FALSE
#> ... ... ... ...
#> [294] GCUUGUAUAG...UCUACAAGUA <<<<<<<..<...>.>>>>>>>. FALSE
#> [295] GCUUUUAUAG...AUUAAGGGCA <<<<<<<..<...>>>>>>>>>. FALSE
#> [296] GUAAAUAUAA...AGUAUUUACA <<<<<<<..<...>>>>>>>>>. FALSE
#> [297] AGGAGAUUAG...AUAUUUCCUA <<<<<<<..<...>>>>>>>>>. FALSE
#> [298] UGCAAUAUGA...AUUAUUGCUA .<<<<<<..<...>>>>>>>>.. FALSE
#> tRNAscan_potential.pseudogene tRNAscan_intron.start tRNAscan_intron.end
#> <logical> <integer> <integer>
#> [1] FALSE 139188 139218
#> [2] FALSE <NA> <NA>
#> [3] FALSE 181179 181210
#> [4] FALSE <NA> <NA>
#> [5] FALSE <NA> <NA>
#> ... ... ... ...
#> [294] FALSE <NA> <NA>
#> [295] FALSE <NA> <NA>
#> [296] FALSE <NA> <NA>
#> [297] FALSE <NA> <NA>
#> [298] FALSE <NA> <NA>
#> tRNAscan_intron.locstart tRNAscan_intron.locend tRNAscan_hmm.score
#> <integer> <integer> <numeric>
#> [1] 37 67 37.9
#> [2] <NA> <NA> 53.4
#> [3] 39 70 27.0
#> [4] <NA> <NA> 49.7
#> [5] <NA> <NA> 45.3
#> ... ... ... ...
#> [294] <NA> <NA> NA
#> [295] <NA> <NA> NA
#> [296] <NA> <NA> NA
#> [297] <NA> <NA> NA
#> [298] <NA> <NA> NA
#> tRNAscan_sec.str.score tRNAscan_infernal
#> <numeric> <numeric>
#> [1] 24.2 NA
#> [2] 22.6 NA
#> [3] 30.5 NA
#> [4] 33.4 NA
#> [5] 29.9 NA
#> ... ... ...
#> [294] NA NA
#> [295] NA NA
#> [296] NA NA
#> [297] NA NA
#> [298] NA NA
#> -------
#> seqinfo: 17 sequences from an unspecified genome; no seqlengths