Re: [R] calculating t-score/t-stats as my zscores

2020-05-06 Thread Ana Marija
his helps, > > Rui Barradas > > Às 15:31 de 06/05/20, Ana Marija escreveu: > > Hi Rui, > > > > Thank you for getting back to me. Is there is a better way to > > calculate Z scores if I have p values, SE and Beta? > > > > Thanks > > Ana >

Re: [R] calculating t-score/t-stats as my zscores

2020-05-06 Thread Ana Marija
I guess I can have z-score=Beta/StdErr On Wed, May 6, 2020 at 9:37 AM Ana Marija wrote: > > thanks, can you please tell em what would be the way not to get the > absolute (always positive values) > > On Wed, May 6, 2020 at 9:33 AM Rui Barradas wrote: > > > > Hel

Re: [R] calculating t-score/t-stats as my zscores

2020-05-06 Thread Ana Marija
's all you need/want, then the > > answer is yes, you can. > > > > Hope this helps, > > > > Rui Barradas > > > > Às 14:28 de 06/05/20, Ana Marija escreveu: > >> Hello, > >> > >> Can I apply the

Re: [R] calculating t-score/t-stats as my zscores

2020-05-06 Thread Ana Marija
Hi Rui, Thank you for getting back to me. Is there is a better way to calculate Z scores if I have p values, SE and Beta? Thanks Ana On Wed, May 6, 2020 at 9:27 AM Rui Barradas wrote: > > Hello, > > That gives the *absolute* t-scores. If it's all you need/want, then the > ans

[R] calculating t-score/t-stats as my zscores

2020-05-06 Thread Ana Marija
Hello, Can I apply the quantile function qt() this way? qt(pvals/2, 406-34, lower.tail = F) to get the T-scores? Thanks Ama __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] if else statement

2020-05-04 Thread Ana Marija
"Patrick (Malone Quantitative)" < > mal...@malonequantitative.com> wrote: > >"I tried this but I am not sure if this is correct:" > > > >Does it provide the expected result for all possible combinations of > >1/2/NA > >for both variables? > &g

[R] if else statement

2020-05-04 Thread Ana Marija
e(b$PLASER==2 | b$FLASER==2,2,NA)) Thanks Ana [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.

Re: [R] how to create a new column from two columns with conditions

2020-04-29 Thread Ana Marija
2] <- 2 > > #set the plaser > > b$pheno[b$plaser == 2] <- 2 > > > On 29 Apr 2020 22:44, Ana Marija wrote: > > Hi Rui, > > thanks for getting back to me > so I tried your method and I got: > > sum(b$PHENO==2, na.rm=T) > [1] 828 > > sum(b$P

Re: [R] how to create a new column from two columns with conditions

2020-04-29 Thread Ana Marija
t; > Hope this helps, > > Rui Barradas > > Às 20:42 de 29/04/20, Ana Marija escreveu: > > Thanks, I did this: > > b$PHENO<- ifelse(b$FLASER ==2 | b$PLASER ==2, 2, 1) > > > > On Wed, Apr 29, 2020 at 2:36 PM Ivan Krylov wrote: > >> > >>

Re: [R] how to create a new column from two columns with conditions

2020-04-29 Thread Ana Marija
Thanks, I did this: b$PHENO<- ifelse(b$FLASER ==2 | b$PLASER ==2, 2, 1) On Wed, Apr 29, 2020 at 2:36 PM Ivan Krylov wrote: > > On Wed, 29 Apr 2020 14:19:18 -0500 > Ana Marija wrote: > > > My conditions for creating a new column PHENO would be this: > > > > if

[R] how to create a new column from two columns with conditions

2020-04-29 Thread Ana Marija
1 22 4: fam1005 G1005 1 11 5: fam1009 G1009 2 1 2 6: fam1052 G1052 1 1 1 ... Thanks Ana ... __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] how to merge two files while preserving the number of rows of one file in merged one?

2020-04-21 Thread Ana Marija
this solved it: m=merge(a,b,by="ID_1",all.y = T) On Tue, Apr 21, 2020 at 9:53 AM Ana Marija wrote: > > Hello, > > > head(a) >ID_1 pheno > 1 0 B > 2 fam1000_G1000 0 > 3 fam1001_G1001 0 > 4 fam1003_G1003 1 > 5

[R] how to merge two files while preserving the number of rows of one file in merged one?

2020-04-21 Thread Ana Marija
ease let me know how would I do that? Thanks Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide com

[R-es] desagregar distribución de frecuencias

2020-04-14 Thread ANA VENTERO MARTIN
inciertos que vivimos. Ana [[alternative HTML version deleted]] ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es

Re: [R] matching doesn't work

2020-04-10 Thread Ana Marija
at 7:01 PM Rasmus Liland wrote: > > On 2020-04-10 18:46 -0500, Ana Marija wrote: > > so if I understand correctly you would just remove sep=" " from my codes? > > > > Thank you so much for working on this. > > Is there is any chance you can change my origin

Re: [R] matching doesn't work

2020-04-10 Thread Ana Marija
# adjust for the orders of sample pair pair.samp <- paste(ibdlist$ID1, ibdlist$ID2, sep=" ") plink.genome <- plink.genome[match( paste(plink.genome$IID1, plink.genome$IID2, sep=" "), pair.samp), ] On Fri, Apr 10, 2020 at 6:03 PM Rasmus Liland wrote

Re: [R] matching doesn't work

2020-04-10 Thread Ana Marija
553. On Fri, Apr 10, 2020 at 4:24 PM Rasmus Liland wrote: > > On 2020-04-10 15:38 -0500, Ana Marija wrote: > | Hi, > | > | I have this code: > > Dear Ana, > > none of the ID tuples in the head > outputs you provided matches, so I added > two lines in ibdlis

[R] matching doesn't work

2020-04-10 Thread Ana Marija
NA NA NA.4 NA NA NA NA NA NA NA NANA NA NA NA.5 NA NA NA NA NA NA NA NANA NA NA So nothing is matching here. Can you please advise, Thanks Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

Re: [R] question about system.file()

2020-04-10 Thread Ana Marija
Got it, thanks! On Fri, Apr 10, 2020 at 2:54 PM Duncan Murdoch wrote: > > On 10/04/2020 3:46 p.m., Ana Marija wrote: > > Hello, > > > > I would like to try this example in this link: > > https://www.rdocumentation.org/packages/SNPRelate/versions/1.6.4/topics/snp

Re: [R] question about system.file()

2020-04-10 Thread Ana Marija
file(filename, "rb") : file("") only supports open = "w+" and open = "w+b": using the former On Fri, Apr 10, 2020 at 2:46 PM Ana Marija wrote: > > Hello, > > I would like to try this example in this link: > https://www.rdocumentation.org

[R] question about system.file()

2020-04-10 Thread Ana Marija
am running this? Also do I need to have .gz format of output4.bed? Thanks Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] how to get all strings in a data frame that start with a particular string

2020-04-10 Thread Ana Marija
Thank you so much! On Fri, Apr 10, 2020 at 12:00 PM Rasmus Liland wrote: > > On 2020-04-10 11:15 -0500, Ana Marija wrote: > > I have a data frame (tot) with about > > 2000 columns. How can I extract from > > it all strings that start with E14? > > > >

[R] how to get all strings in a data frame that start with a particular string

2020-04-10 Thread Ana Marija
E14? Thanks Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

[R] how to create a new column with conditions

2020-04-08 Thread Ana Marija
009 11 1 2 6 fam1052_G1052 11 1 2 ... I would like to create a new column called PHENO which would satisfy these conditions: if CURRELIG=1 and RTNPTHY=1 than PHENO=1 if PLASER=2 than PHENO=2 otherwise is -9 Thanks Ana [[alternative HTML vers

Re: [R] How to match strings in two files and replace strings?

2020-03-30 Thread Ana Marija
GAAAC[A/G]TTTGACAGAGAATACA,Sty,+,-,y,,,127,phs18 1,769185,SNP_A-4303947,ss66273559,rs4040617,36.2,A,G,A,G,A,GCTGTGAGAGAGAACA[A/G]TGTCCCAAGCCC,Sty,+,+,n,,,127,phs18 1,775852,SNP_A-1886933,ss66317030,rs2980300,36.2,T,C,A,G,A,GAATGACTGTGTCTCT[C/T]TGAGTTAGTGAAGTCA,Nsp,-,+,y,,,127,phs18

[R] How to match strings in two files and replace strings?

2020-03-30 Thread Ana Marija
rs4245756TC 0.07923 3496 I tried doing this in bash but I got empty file: vi tst.awk NR==FNR { map[$1,$2]=$5; next } ($1,$4) in map { $2=map[$1,$4]; print } awk -f tst.awk FS=',' marker-info FS='\t' output11.frq > output11X.frq Can this be done in R? Thanks

Re: [R] how do I add text lables on QQ plot

2020-03-12 Thread Ana Marija
d call: > > > ..., pch=16, col = c ("red", "blue"), ... > > And remove the fill argument. > > > > On 3/13/20, Ana Marija wrote: > > I could make legend via this: > > qq(fdr2_sorted$FDR.q.val2, main = "RG_All", pch = 16, > > col=f

Re: [R] how do I add text lables on QQ plot

2020-03-12 Thread Ana Marija
e this code in order to have circles in the legend? On Thu, Mar 12, 2020 at 11:04 AM Ana Marija wrote: > > Also how would I add legend to this plot? > > I searched qqman pages and there is no mention of that > > qq(fdr2_sorted$FDR.q.val2, main = "RG_All", pch = 16, > co

Re: [R] how do I add text lables on QQ plot

2020-03-12 Thread Ana Marija
Also how would I add legend to this plot? I searched qqman pages and there is no mention of that qq(fdr2_sorted$FDR.q.val2, main = "RG_All", pch = 16, col=fdr1_sorted$group, cex = 0.8, las = 1) On Thu, Mar 12, 2020 at 9:30 AM Ana Marija wrote: > > Hi Michael, > > can you

Re: [R] how do I add text lables on QQ plot

2020-03-12 Thread Ana Marija
Hi Michael, can you please send me a line of code showing how it would be done. Thanks Ana On Thu, Mar 12, 2020 at 9:16 AM Michael Dewey wrote: > > Dear Ana > > You can specify the first three parameters to text() as vectors so it is > all done in one call. That may or may

Re: [R] how do I add text lables on QQ plot

2020-03-12 Thread Ana Marija
RANK AT MAX` = c(L, 1516L, 1427L, 1819L, 1216L, 491L), `LEADING EDGE` = c("tags=43%, list=10%, signal=47%", "tags=39%, list=13%, signal=45%", "tags=54%, list=12%, signal=61%", "tags=45%, list=16%, signal=52%", "tags=38%, list=11%, signal=42%",

Re: [R] how do I add text lables on QQ plot

2020-03-11 Thread Ana Marija
> Assuming that it's using the base graphics system, look at the >> > graphics::text function. >> > >> > text (1:10, 1:10, LETTERS [1:10]) >> > >> > If it's a different graphics system, then I don't know, but hopefully >> > someone else wil

Re: [R] how do I add text lables on QQ plot

2020-03-11 Thread Ana Marija
Thanks for getting back to me but I would need this text labels added in this particular instance On Wed, 11 Mar 2020 at 19:37, Abby Spurdle wrote: > > and I would like to get the plot like the one in attach. > > Please advise, > > This is a bad idea. > Plots should be *easy* to interpret. > >

[R] how do I add text lables on QQ plot

2020-03-10 Thread Ana Marija
t=11%, signal=42% NA 1e-10 6: 0 0 491 tags=28%, list=4%, signal=29% NA 1e-10 and I would like to get the plot like the one in attach. Please advise, Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

Re: [R] qq plot issue with ab line

2020-02-28 Thread Ana Marija
Hi Jim, I have in my code: abline(0,1,col='red') can you please tell me how to change my code to have it indeed running from 0 to 1? Thanks Ana On Fri, Feb 28, 2020 at 3:34 PM Jim Lemon wrote: > > Hi Ana, > Look carefully at that red line. It goes through (0,0) and scoots off &

[R] qq plot issue with ab line

2020-02-28 Thread Ana Marija
t; head(biob272) V1 V2 1 rs2089177 0.581204 2 rs4360974 0.418456 3 rs6502526 0.416670 4 rs8069906 0.568030 5 rs9895995 0.266746 6 rs9905280 0.510032 But the red, abline doesn't look like it is 1:1 line. Can you please advise? Thanks Ana __ R-

Re: [R] how to create density plot in R with p value

2020-02-11 Thread Ana Marija
uot;, plot.points=FALSE, auto.key=TRUE) and it is attached. The only thing I need to do is to make a line in between peaks of the curves and put the star above that line. Not a p value but just a star symbol. Please advise, Thanks On Tue, Feb 11, 2020 at 3:46 PM Ana Marija wrote: >

Re: [R] how to create density plot in R with p value

2020-02-11 Thread Ana Marija
p value with t test, say it is 0.005 But how to add that p value in between distribution of the curves? Thanks Ana On Tue, Feb 11, 2020 at 12:54 PM Ana Marija wrote: > > Hi, > > I have data like this: > > > head(a) >X geneID inter.individual.variance

Re: [R] scatter plot

2020-02-10 Thread Ana Marija
Hi, Thanks for getting back to me. I need to have there two groups: "nPDR.rg and "PDR.rg" can you please let me know how my loop would look like just with those two groups? Thanks Ana On Mon, Feb 10, 2020 at 2:03 PM John Kane wrote: > > I must admit that I do no

[R] scatter plot

2020-02-10 Thread Ana Marija
g 5 0.635 -0.112 -0.0503 nPDR.rg 6 -0.723 0.153 -0.245 nPDR.rg > tail(mds) # A tibble: 6 x 4 Dim.1 Dim.2 Dim.3 cols 1 0.760 -0.732 0.568 NoD.rg 2 -0.0918 0.645 -0.189 NoD.rg 3 -0.336 0.756 0.120 NoD.rg 4 -0.439 -0.557 0.556 NoD.rg 5 -1.90 -0.858 -0.949 NoD.rg 6

Re: [R] doing 1000 permutations and doing test statistics distribution

2020-02-05 Thread Ana Marija
4586251989901 0.0818947419096577 -0.6788584605>> my original dat matrix has 132 columns and around 15000 rows Can you please advise on this? Thanks Ana On Tue, Feb 4, 2020 at 4:45 PM Bert Gunter wrote: > > Yes, a clear thinko... Thanks for the correction. > > -- Bert > > On

Re: [R] doing 1000 permutations and doing test statistics distribution

2020-02-04 Thread Ana Marija
> > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Tue, Feb 4, 2020 at 12:41 PM Ana Marija > wrote: >>

Re: [R] doing 1000 permutations and doing test statistics distribution

2020-02-04 Thread Ana Marija
Basically I would just reshuffle column names in each of 1000 permutations how to do that and perform everything I described in my initial email On Tue, 4 Feb 2020 at 14:46, Ana Marija wrote: > Hi Bert, > > thanks for getting back to me. I have to permute those 132 columns >

Re: [R] doing 1000 permutations and doing test statistics distribution

2020-02-04 Thread Ana Marija
Hi Bert, thanks for getting back to me. I have to permute those 132 columns 1000 times and perform the code given in the previous email. Can you please show me how you would do that in the loop? This is also a huge data set ... Thanks Ana On Tue, Feb 4, 2020 at 2:34 PM Bert Gunter wrote

[R] doing 1000 permutations and doing test statistics distribution

2020-02-04 Thread Ana Marija
would have P.Value column and these I would have plotted on the end to find the distribution of all p values generated in those 1000 permutations. Please advise, Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.eth

[R] comparing variances between two sets of p values for two different conditions

2020-02-04 Thread Ana Marija
sided") If not which test you would recommend in this case? Thanks Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-

Re: [R] how to read a database in R?

2020-02-01 Thread Ana Marija
/O error Use `synchronous` = NULL to turn off this warning. Please advise, Ana On Sat, Feb 1, 2020 at 8:55 AM John Kane wrote: > > Hi Ana > Stolen from https://gist.github.com/jwolfson/72bc7d7fd8d339955b38 > I cannot remember if you will need to install any other packag

Re: [R] how to read a database in R?

2020-02-01 Thread Ana Marija
Hi Ivan Thanks for getting back to me. Can you please share with me some code I would use to see what is in my database? On Sat, 1 Feb 2020 at 06:19, Ivan Krylov wrote: > On Fri, 31 Jan 2020 17:02:16 -0600 > Ana Marija wrote: > > > I have a database DGN-WB_0.5.db is there is a

[R] how to read a database in R?

2020-01-31 Thread Ana Marija
Hello, I have a database DGN-WB_0.5.db is there is a way to explore its content in R? I don't know anything about this data base. Thanks Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r

Re: [R] how to import/read .vcf files in R

2020-01-28 Thread Ana Marija
> > Bert Gunter > > > > > On Tue, Jan 28, 2020 at 9:29 AM Ana Marija > wrote: >> >> Hello, >> >> I tried doing: >> > library(vcfR) >> > vcf <- >> > read.vcfR("ALL.chr1.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotyp

[R] how to import/read .vcf files in R

2020-01-28 Thread Ana Marija
Hello, I tried doing: > library(vcfR) > vcf <- > read.vcfR("ALL.chr1.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf", > verbose = FALSE ) but this takes forever to load and I am not sure it is even working. Any other suggestion on how I can read in .v

Re: [R] how to create a plot of permutation of 30 random values and show proportion of values

2020-01-23 Thread Ana Marija
Hi Jim, thanks for getting back to me. Can you please confirm if you can see this plot in attach? Thanks Ana On Thu, Jan 23, 2020 at 8:06 PM Jim Lemon wrote: > > Hi Ana, > You seem to be working on an identification or classification problem. > Your sample plot didn't come thro

[R] how to create a plot of permutation of 30 random values and show proportion of values

2020-01-23 Thread Ana Marija
Hello, I have a data frame which looks like this: > head(a,20) rs pvalue 1: rs185642176 0.267407 2: rs184120752 0.787681 3: rs10904045 0.508162 4: rs35849539 0.875910 5: rs141633513 0.787759 6: rs4468273 0.542171 7: rs4567378 0.539484 8: rs7084251 0.126445 9:

[R] how to save Rdata into .csv file

2020-01-22 Thread Ana Marija
Hello, I have my normalized data matrix in file:normalizedDataMatrix_filtered.RData how do I have that in .csv format? Thanks Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] Error in annotate

2020-01-20 Thread Ana Marija
("rect", xmin = 1, xmax = 2, ymin = 270, ymax =270, alpha=0.3,colour = "black") I am getting this error: > p + annotate("text", x = 1.5, y = 280, label = "p = 0.008", size = 3.5) + + annotate("rect", xmin = 1, xmax = 2, ymin = 270, ymax =270

[R] how to add annotate horizontal line between bars and decrease size and space between bars?

2020-01-20 Thread Ana Marija
= 3.5) + + annotate("rect", xmin = 1, xmax = 2, ymin = 1, ymax =1, alpha=0.3,colour = "black") Error in annotate("text", x = 1.5, y = 1.2, label = "p = 2e-16", size = 3.5) : unused arguments (x = 1.5, y = 1.2, label = "p = 2e-16", size = 3.5) Als

Re: [R] how to add annotate horizontal line between bars and decrease size and space between bars?

2020-01-20 Thread Ana Marija
2e-16") I am getting: Error in annotate("text", x = 1.5, y = 1.2, label = "p = 2e-16") : unused arguments (x = 1.5, y = 1.2, label = "p = 2e-16") On Thu, Jan 16, 2020 at 2:51 PM Ana Marija wrote: > > Hello, > > I have a code like this: > >

Re: [R] editing plot

2020-01-09 Thread Ana Marija
element_line(size = 0.1, color = "grey"), panel.grid.major.y = element_blank(), panel.grid.minor = element_blank(),axis.text.x = ax.11.text,axis.text.y=ay.11.text ) p I was wondering is there is any way to decrease the amount of white spaces around the bars? Thanks Ana On T

Re: [R] editing plot

2020-01-08 Thread Ana Marija
") + theme(aspect.ratio = 2/1,axis.title.x=element_text(size=1,face="bold")) p On Wed, Jan 8, 2020 at 12:52 PM Ana Marija wrote: > > Hello, > > I have this plot in attach. I was wondering how can I change my > plotting code in order to remove these gray horiz

[R] editing plot

2020-01-08 Thread Ana Marija
Hello, I have this plot in attach. I was wondering how can I change my plotting code in order to remove these gray horizontal background lines but keep these two vertical lines? These two vertical lines don't need to be gray, can be any other type of lines but they must be at the same place. Also

Re: [R] adjusted p value, fdr

2020-01-08 Thread Ana Marija
were only a total of 4 multiple tests in your experiment, > so FDR is low. > > Ding > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ana Marija > Sent: Tuesday, January 07, 2020 2:18 PM > To: r-help > Subject: [R] adjusted

[R] adjusted p value, fdr

2020-01-07 Thread Ana Marija
just(pval,method="BH") [1] 0.0001228876 0.0001503739 0.0002612551 0.0003900822 Can someone please explain what might be the issue. Thanks Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/list

Re: [R] issue with numeric

2019-12-18 Thread Ana Marija
Hello, the error was in the code: D = read.table(opt_input, head = FALSE, stringsAsFactors = FALSE) I should have there header=TRUE Sorry for bothering with this, Ana On Wed, Dec 18, 2019 at 2:44 PM Ana Marija wrote: > > Hi Ivan, > > here it is: > > > str(a) > 'd

Re: [R] issue with numeric

2019-12-18 Thread Ana Marija
2 [13] 11073 11074 11075 > which(is.na(as.numeric(as.character(a[,19] [1] 10757 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 [13] 11073 11074 11075 columns 18 and 19 seems to be numeric, what is could be the issue? On Wed, Dec 18, 2019 at 1:49 PM Ivan Krylov wrote: > &

[R] issue with numeric

2019-12-18 Thread Ana Marija
002893770 0.340855 0.638936 6 T 404 338.232 1.05240 180.879 0.001846080 -0.458547 0.528947 V19 1 0.198142 2 0.529105 3 0.199394 4 0.261441 5 0.633917 6 0.524186 Please advise, Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] how to create a txt file with parsed columns

2019-12-09 Thread Ana Marija
Thanks for getting back to me, I resolved my problem with this: library(reshape2) c=dcast(a, rs ~ GENE) d=merge(c,b,by="rs") d[is.na(d)] <- 0 On Sun, Dec 8, 2019 at 11:03 PM Jim Lemon wrote: > > Hi Ana, > Is this what you want? > > a<-read.table(text

[R] how to create a txt file with parsed columns

2019-12-08 Thread Ana Marija
315177 … Please advise, Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-con

[R] Lapack routine dgesv: system is exactly singular

2019-12-04 Thread Ana Marija
oaded my ENSG0154803.ld file in R as matrix (a) and: library(matrixcalc) is.singular.matrix(a, tol = 1e-08) TRUE Seems that my matrix is singular. What do you advice in this case? Thanks Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

[R] Error related to matrix system is exactly singular

2019-12-04 Thread Ana Marija
p("File not found: ", file) filecluster<-read.table(file,header=T,sep=" ",dec=".") beta<-as.matrix(filecluster[,2:(length(filecluster[1,])-1)]) when I was running it with just 3 columns in .matrix file. Please advise, is it something wrong with the format

[R] undefined columns selected

2019-12-03 Thread Ana Marija
trix(filecluster[,2:(length(filecluster[1,])-1)]) now my input is like this: https://github.com/eleporcu/TWMR/blob/master/ENSG419.matrix so 4 columns instead of 3 like it was before and when I run it I get that error above. Please advise, Ana [[alternative HTML version deleted]]

Re: [R] how to merge 5 data frames by one column

2019-12-03 Thread Ana Marija
than 2 genes sharing the same rs. Can you please advise about this On Tue, Dec 3, 2019 at 2:16 PM Ana Marija wrote: > would this make sense for the previous: > mt=na.omit(m, cols = c("V1.1","V1.2","V1.3","V1.4","V1.5")) > > On Tu

Re: [R] how to merge 5 data frames by one column

2019-12-03 Thread Ana Marija
would this make sense for the previous: mt=na.omit(m, cols = c("V1.1","V1.2","V1.3","V1.4","V1.5")) On Tue, Dec 3, 2019 at 2:09 PM Ana Marija wrote: > I can perhaps do this: > > m=Reduce(function(x, y) merge(x, y, all=TRUE), list(s11

Re: [R] how to merge 5 data frames by one column

2019-12-03 Thread Ana Marija
NA NA ENSG0141030 V3.3 V4.3 V1.4 V3.4 V4.4 V1.5 V3.5 V4.5 6 3.06126e-28 0.726948NA NANA NA ... but how to filter out this output (m) in order to remove all rows where I have NA in any of these columns: V1.1,V1.2,V1.3,V1.4,V1.5 On Tue, Dec 3, 2019 at 1:48 PM Ana Mar

Re: [R] how to merge 5 data frames by one column

2019-12-03 Thread Ana Marija
ENSG0127914 rs1208998 -0.0337989326337439 -0.00106024397995199 rs4729008 0.0630831868839983 0.00890783698397027 rs11772754 0.181375539335959 0.0012636115921931 rs10257459 0.0369962603988132 0.00509887844657462 rs17164876 0.0307882763321834 -0.00188979524322732 On Tue, Dec 3, 2019 at 1:40 PM Ana Marija

[R] how to merge 5 data frames by one column

2019-12-03 Thread Ana Marija
as one unique value in respective V1 I am trying to merge all at once all 5 data frames by the "rs" column. Can you please help with this, Ana [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRI

Re: [R] strange output with merge function

2019-12-03 Thread Ana Marija
HI Jeff, the issue got resolved after I converted data in as.data.frame. Thank you for the useful input! Ana On Tue, Dec 3, 2019 at 12:46 PM Jeff Newmiller wrote: > My guess would be that your key columns are factors with different levels. > You have to be very careful manipulating f

[R] strange output with merge function

2019-12-03 Thread Ana Marija
TRUE 6: 5.46479e-05 -0.329785 0 5.962828e-05 TRUE Please advise, Thanks Ana [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] cannot open file '--no-restore.matrix'

2019-11-23 Thread Ana Marija
x",sep=".") > if (!file.exists(file)) stop("File not found: ", file) > filecluster<-read.table(file,header=T,sep=" ",dec=".") > ... > > The call the script from the command line as: > > $ Rscript MR.R ENSG0154803 > > Th

Re: [R] cannot open file '--no-restore.matrix'

2019-11-23 Thread Ana Marija
154803.matrix [1] "ENSG0154803.ld" "ENSG0154803.matrix" Error: File not found: NA.matrix Execution halted On Sat, Nov 23, 2019 at 2:08 PM Henrik Bengtsson wrote: > > Maybe it would help to add: > > file<-paste(gene,"matrix",sep=&quo

Re: [R] cannot open file '--no-restore.matrix'

2019-11-23 Thread Ana Marija
file(file, "rt") : cannot open file 'NA.matrix': No such file or directory Execution halted Please advise On Sat, Nov 23, 2019 at 12:13 PM Duncan Murdoch wrote: > > On 23/11/2019 11:05 a.m., Ana Marija wrote: > > Hi Ben, > > > > I am not sure what you mean wh

Re: [R] cannot open file '--no-restore.matrix'

2019-11-23 Thread Ana Marija
ble -> file In addition: Warning message: In file(file, "rt") : cannot open file 'NA.matrix': No such file or directory Execution halted Please advise, Ana On Sat, Nov 23, 2019 at 9:44 AM Duncan Murdoch wrote: > > On 23/11/2019 10:26 a.m., Ana Marija wrote: > > HI Ben

Re: [R] cannot open file '--no-restore.matrix'

2019-11-23 Thread Ana Marija
e.matrix': No such file or directory Execution halted Please advise, Ana On Sat, Nov 23, 2019 at 4:16 AM Ben Tupper wrote: > > Hi, > > I think you want this order... > > Rscript [options for R] script_file.R argument_1 argument_2 ... > > So, like this ... > > Rscript --n

Re: [R] cannot open file '--no-restore.matrix'

2019-11-22 Thread Ana Marija
t 7:44 PM Ben Tupper wrote: > > Hi, > > You might check the order of your arguments. Options come before the > script filename. See the details here... > > https://www.rdocumentation.org/packages/utils/versions/3.6.1/topics/Rscript > > Ben > > On Fri, Nov 22

[R] cannot open file '--no-restore.matrix'

2019-11-22 Thread Ana Marija
in file(file, "rt") : cannot open the connection Calls: read.table -> file In addition: Warning message: In file(file, "rt") : cannot open file '--no-restore.matrix': No such file or directory Execution halted Please advise, Thanks Ana

Re: [R] Remove highly correlated variables from a data frame or matrix

2019-11-16 Thread Ana Marija
so improvement! Regards, Ana On Fri, Nov 15, 2019 at 8:01 PM Peter Langfelder wrote: > > Try hclust(as.dist(1-calc.rho), method = "average"). > > Peter > > On Fri, Nov 15, 2019 at 10:02 AM Ana Marija > wrote: > > > > HI Peter, > > > &

Re: [R] Remove highly correlated variables from a data frame or matrix

2019-11-15 Thread Ana Marija
rs8071007 rs56044345 rs17804843 On Fri, Nov 15, 2019 at 12:03 PM Ana Marija wrote: > > HI Peter, > > Thank you for getting back to me and shedding light on this. I see > your point, doing Jim's method: > > > keeprows<-apply(calc.rho,1,function(x) return(sum(x>0.8

Re: [R] Remove highly correlated variables from a data frame or matrix

2019-11-15 Thread Ana Marija
quot;) : missing value where TRUE/FALSE needed Please advise. Thanks Ana On Thu, Nov 14, 2019 at 7:37 PM Peter Langfelder wrote: > > I suspect that you want to identify which variables are highly > correlated, and then keep only "representative" variables, i.e., &g

Re: [R] Remove highly correlated variables from a data frame or matrix

2019-11-14 Thread Ana Marija
the variables with at most one absolute value greater than > 0.8 ignoring the diagonal values because I don't care about those". If > so: > > colnames(calc.jim)[colSums(abs(calc.jim)>0.8)<3] > > Any more tricks? > > Jim > > On Fri, Nov 15, 2019 at 8:1

Re: [R] Remove highly correlated variables from a data frame or matrix

2019-11-14 Thread Ana Marija
what would be the approach to remove variable that has at least 2 correlation coefficients >0.8? this is the whole output of the head() > head(calc.rho) rs56192520 rs3764410 rs145984817 rs1807401 rs1807402 rs35350506 rs56192520 1.000 0.976 0.927 0.927 0.927

Re: [R] Remove highly correlated variables from a data frame or matrix

2019-11-14 Thread Ana Marija
g an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Thu, Nov 14, 2019 at 10:50 AM Ana Marija > wrote: >> >> Hello, >> >> I have a

[R] Remove highly correlated variables from a data frame or matrix

2019-11-14 Thread Ana Marija
246 I would like to remove from this data all highly correlated variables, with correlation more than 0.8 I tried this: > data<- calc.rho[,!apply(calc.rho,2,function(x) any(abs(x) > 0.80))] > dim(data) [1] 246 0 Can you please advise, Thanks Ana But this rem

Re: [R] QQ plot

2019-11-13 Thread Ana Marija
Hi Michael, Thank you so much for that valuable idea! I will try first to clump or remove SNPs in LD and maybe the situation would improve. But this procedure of yours is definitely something that would come handy in future! Cheers, Ana On Wed, Nov 13, 2019 at 5:47 AM Michael Dewey wrote

Re: [R] QQ plot

2019-11-12 Thread Ana Marija
why I selected only those with P<0.003 to put on QQ plot is because the original data set contains 5556249 points and when I extract only P<0.001 I am getting 3713 points. Is there is a way to plot the whole data set, or choose only the representative points? On Tue, Nov 12, 2019 at 3:42

Re: [R] QQ plot

2019-11-12 Thread Ana Marija
the smallest p value in my dataset goes to 9.89e-08. How do I make that known on the new QQ plot with multiplied with 1000 values On Tue, Nov 12, 2019 at 3:37 PM Ana Marija wrote: > > Just do I need to change the axis when I multiply with 1000 and what > should I put on my axis? > &

Re: [R] QQ plot

2019-11-12 Thread Ana Marija
Just do I need to change the axis when I multiply with 1000 and what should I put on my axis? On Tue, Nov 12, 2019 at 3:07 PM Ana Marija wrote: > > Hi Duncan, > > yes I choose for QQ plot only P<1e-3 and multiplying everything with > 1000 works great! > This should no

Re: [R] QQ plot

2019-11-12 Thread Ana Marija
Hi Duncan, yes I choose for QQ plot only P<1e-3 and multiplying everything with 1000 works great! This should not in my understanding influence the interpretation of the plot, it is only changing the scale of axis. Thank you so much, Ana On Tue, Nov 12, 2019 at 2:51 PM Duncan Murdoch wr

Re: [R] QQ plot

2019-11-12 Thread Ana Marija
Hi, what I know so far that this kind of QQ plot is an indication that data has non zero mean: https://stats.stackexchange.com/questions/280634/how-to-interpret-qq-plot-not-on-the-line but is that an indication that something is wrong with the analysis? Thanks Ana On Tue, Nov 12, 2019 at 2:00

Re: [R] QQ plot

2019-11-12 Thread Ana Marija
details about my data if it is helpful: > median(dd$P,na.rm = FALSE) [1] 0.000444 > mean(dd$P,na.rm = FALSE) [1] 0.000461 > min(dd$P,na.rm = FALSE) [1] 9.89e-08 > max(dd$P,na.rm = FALSE) [1] 0.001 On Tue, Nov 12, 2019 at 2:07 PM Ana Marija wrote: > > Hi, > > what I kn

[R] QQ plot

2019-11-11 Thread Ana Marija
Hi, I was using this library, qqman https://cran.r-project.org/web/packages/qqman/vignettes/qqman.html to create QQ plot, attached. How would I change this default abline to start from the beginning of my QQ line? This is my code: qq(dd$P, main = "Q-Q plot of GWAS p-values")

Re: [R] how to find number of unique rows for combination of r columns

2019-11-08 Thread Ana Marija
the - sign >> >> If you prefer, the "Tidyverse" world has what are purported to be more >> user-friendly versions of such data handling functionality that you can use >> instead. >> >> >> Bert >> >> On Fri, Nov 8, 2019 at 7:38 AM A

<    1   2   3   4   >