The requested reprex....
Rendering reprex...
Error in parse(text = x, keep.source = TRUE) :
? <text>:26:2: unexpected ')'
25:
26: 2)
? ? ?^
And the subset of the data....
?row.names = c(NA, 6L), class = "data.frame")
Best,
Spencer
On Tue, Jun 25, 2019 at 2:25 PM Rui Barradas <ruipbarradas at sapo.pt
<mailto:ruipbarradas at sapo.pt>> wrote:
Hello,
No I wasn't expecting a very large file.
Try to make a reproducible example. If the problem seems to be with the
sapply/strsplit post a subset of the data like just some of the
colnames:
colnames(meth)[1:10]
This would allow us to run the code you are having trouble with.
Hope this helps,
Rui Barradas
?s 17:36 de 25/06/19, Spencer Brackett escreveu:
> The result of dput(head(meth)) is a very large data table/listing of
> data by category of what I presume to be the data from the two
> files I referenced previously. Is this the output you were expecting?
>
> On Tue, Jun 25, 2019 at 12:19 PM Rui Barradas
<ruipbarradas at sapo.pt <mailto:ruipbarradas at sapo.pt>
> <mailto:ruipbarradas at sapo.pt <mailto:ruipbarradas at sapo.pt>>> wrote:
>
>? ? ?Hello,
>
>? ? ?1) That error comes from not closing }) after the paste()
>? ? ?The complete statement would be
>
>
>? ? ?colnames(meth) = sapply(colnames(meth), function(i){
>? ? ? ? ?c1 = strsplit(i, split ='\\', fixed = T)[[1]]
>? ? ? ? ?c1[4] = paste(strsplit(c1[4],split = "",fixed =
>? ? ?T)[[1]][1:2],collapse
>? ? ?=? "")
>? ? ? ? ?paste(c1,collapse = ".")
>? ? ?})
>
>
>? ? ?2) Can you post the output of the following?
>
>? ? ?dput(head(meth))
>
>
>? ? ?Hope this helps,
>
>? ? ?Rui Barradas
>
>? ? ??s 16:58 de 25/06/19, Spencer Brackett escreveu:
>? ? ? > The following is what I have implemented thus far...
>? ? ? >
>? ? ? > The file object for the two files listed in lines 1-2 was
>? ? ? > working directory, and are under the folder "Vakul's GBM
>? ? ?hence
>? ? ? > the source of the odd 'prefix' for .txt files shown
>? ? ? >
>? ? ? >? >library(data.table)>.anno = as.data.frame(fread(file =
>? ? ?"~Vakul's GBM
>? ? ? > Code/mapper.txt", sep ="\t", header = T))
>? ? ? >? >meth = read.table(file = "~Vakul's GBM Code/GBM.txt",
>? ? ? > header = T, row.names = 1)
>? ? ? >? >meth = as.matrix(meth)
>? ? ? >
>? ? ? > ##? the loop just formats the methylation column names to
>? ? ?format ##
>? ? ? > colnames(meth) = sapply(colnames(meth), function(i){
>? ? ? >? ? c1 = strsplit(i,split ='\\', fixed = T)[[1]]
>? ? ? >? ? c1[4] = paste(strsplit(c1[4],split = "",fixed =
>? ? ?T)[[1]][1:2],collapse
>? ? ? > = ?"")
>? ? ? >? ? paste(c1,collapse = ".")
>? ? ? >
>? ? ? > Rendering reprex...
>? ? ? > Error in parse(text = x, keep.source = TRUE) :
>? ? ? >? ? <text>:28:0: unexpected end of input
>? ? ? >
>? ? ? > Best,
>? ? ? >
>? ? ? > Spencer
>? ? ? >
>? ? ? >
>? ? ? >
>? ? ? > On Tue, Jun 25, 2019 at 11:45 AM Spencer Brackett
>? ? ? > <spbrackett20 at saintjosephhs.com
<mailto:spbrackett20 at saintjosephhs.com>
>? ? ?<mailto:spbrackett20 at saintjosephhs.com
<mailto:spbrackett20 at saintjosephhs.com>>
>? ? ?<mailto:spbrackett20 at saintjosephhs.com
<mailto:spbrackett20 at saintjosephhs.com>
>? ? ?<mailto:spbrackett20 at saintjosephhs.com
<mailto:spbrackett20 at saintjosephhs.com>>>>
>? ? ? > wrote:
>? ? ? >
>? ? ? >? ? ?Mr. Barradas,
>? ? ? >
>? ? ? >? ? ?I got the same "output" as before, which is the?+
>? ? ? >? ? ?the expression is incomplete (according to some R users
>? ? ?response in
>? ? ? >? ? ?this chain).
>? ? ? >
>? ? ? >? ? ?Should the argument perhaps be c1 = strsplit(i, split
>? ? ?fixed
>? ? ? >? ? ?= T)[[1]] .... thereby eliminating the "." ?
>? ? ? >? ? ?The reprex and error message as the result of this is
>? ? ? >? ? ?the previous one I sent.
>? ? ? >
>? ? ? >? ? ?I will send a more detailed description of what code I
>? ? ?done so
>? ? ? >? ? ?far for context.
>? ? ? >
>? ? ? >? ? ?Best,
>? ? ? >
>? ? ? >? ? ?Spencer
>? ? ? >
>? ? ? >? ? ?On Tue, Jun 25, 2019 at 11:30 AM Rui Barradas
>? ? ?<ruipbarradas at sapo.pt <mailto:ruipbarradas at sapo.pt>
<mailto:ruipbarradas at sapo.pt <mailto:ruipbarradas at sapo.pt>>
>? ? ? >? ? ?<mailto:ruipbarradas at sapo.pt
<mailto:ruipbarradas at sapo.pt> <mailto:ruipbarradas at sapo.pt
<mailto:ruipbarradas at sapo.pt>>>>
>? ? ?wrote:
>? ? ? >
>? ? ? >? ? ? ? ?Hello,
>? ? ? >
>? ? ? >? ? ? ? ?Maybe with
>? ? ? >
>? ? ? >? ? ? ? ?c1 = strsplit(i, split = '\\.', fixed = T)[[1]]
>? ? ? >
>? ? ? >? ? ? ? ?instead of split = '.'
>? ? ? >
>? ? ? >? ? ? ? ?The dot is a metacharacter that matches any
>? ? ?it has
>? ? ? >? ? ? ? ?to be
>? ? ? >? ? ? ? ?escaped.
>? ? ? >
>? ? ? >? ? ? ? ?Hope this helps,
>? ? ? >
>? ? ? >? ? ? ? ?Rui Barradas
>? ? ? >
>? ? ? >? ? ? ? ??s 16:11 de 25/06/19, Spencer Brackett escreveu:
>? ? ? >? ? ? ? ? > c1 = strsplit(i,split ='.', fixed = T)[[1]]
>? ? ? >
>