Question: motifMatrix input object type, confused VRange and GRange
0
solo777310 wrote:

motif-functions {SomaticSignatures}

Usage

motifMatrix(vr, group = "sampleNames", normalize = TRUE)
Arguments

vr
GRanges object [required]

But, the example from the manual shows

Examples

data(sca_motifs_tiny)

motifMatrix(sca_motifs_tiny, group = "study")

However, sca_motifs is a VRange object. So, what is the right type for motifMatrix? VRange or GRange?

Answer: motifMatrix input object type, confused VRange and GRange
1
Julian Gehring1.3k wrote:

Both GRanges and VRanges work as inputs for motifMatrix. Since the input to that function is in most workflows the output of the mutationContext function, it often is a VRanges that describes a set of variants. But, any object that inherits from a GRanges  is suitable, if it contains the information of alteration and context.

You can check that both work the same way by trying it out:

data(sca_motifs_tiny)
m1 = motifMatrix(sca_motifs_tiny, group = "study") ## VRanges input
m2 = motifMatrix(as(sca_motifs_tiny, "GRanges"), group = "study") ## GRanges input
identical(m1, m2) ## same output
{"ft_lang_label":"__label__en","ft_lang_prob":0.53056675,"math_prob":0.92621887,"size":355,"snap":"2019-43-2019-47","text_gpt3_token_len":99,"char_repetition_ratio":0.15384616,"word_repetition_ratio":0.0,"special_character_ratio":0.2140845,"punctuation_ratio":0.16363636,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95177186,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-11-15T08:58:13Z\",\"WARC-Record-ID\":\"<urn:uuid:590634f6-a580-4a4e-a01c-a65cd6c847d8>\",\"Content-Length\":\"19615\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:81c8862f-2145-4665-9083-46e600e2d00d>\",\"WARC-Concurrent-To\":\"<urn:uuid:6b975283-8bb5-4d8d-8824-eda71da71720>\",\"WARC-IP-Address\":\"52.3.239.161\",\"WARC-Target-URI\":\"https://support.bioconductor.org/p/84808/\",\"WARC-Payload-Digest\":\"sha1:W7X3J5XNK7RK3VEHRDRDXNS2FYBMR4HR\",\"WARC-Block-Digest\":\"sha1:DMNJR52KZ66U227XEERLEYKOOY6NQ77H\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-47/CC-MAIN-2019-47_segments_1573496668594.81_warc_CC-MAIN-20191115065903-20191115093903-00437.warc.gz\"}"}