Displaying 20 results from an estimated 89 matches for "maf".
Did you mean:
mac
2012 Feb 10
3
problem subsetting data frame with variable instead of constant
...thod subset(), or maybe this
is something I don't know about said method that when you're subsetting
based on the columns of a data frame you can only use constants (0.1, 2.3,
2.2) instead of variables?
Here's a look at my data frame called 'ea.cad.pwr':
*>ea.ca.pwr[1:5,]
MAF OR POWER
1 0.02 0.01 0.9999
2 0.02 0.02 0.9998
3 0.02 0.03 0.9997
4 0.02 0.04 0.9995
5 0.02 0.05 0.9993*
Here's my subset lines which finds no rows:
*power1 = subset(ea.cad.pwr, MAF == maf1 & OR == odds)
power2 = subset(ea.cad.pwr, MAF == maf2 & OR == odds)
*
Now when maf1 = 0.2 an...
2010 Nov 29
2
FW: how to use by() ?
...k you for the suggestion, Bill. The result is not quite what I would like. Here's sample code for you or anyone else who may be interested:
Al1 = c('A','C','C','C')
Al2 = c('G','G','G','T')
Freq1 = c(0.0078,0.0567,0.9434,0.9908)
MAF = c(0.0078,0.0567,0.0566,0.0092)
m1 = data.frame(Al1=Al1, Al2=Al2,Freq1=Freq1,MAF=MAF,major_allele='')
m1
Al1 Al2 Freq1 MAF major_allele
1 A G 0.0078 0.0078
2 C G 0.0567 0.0567
3 C G 0.9434 0.0566
4 C T 0.9908 0.0092
U...
2017 Nov 18
3
Complicated analysis for huge databases
The loop :
AllMAFs <- list()
for (i in length(SeparatedGroupsofmealsCombs) {
AllMAFs[[i]] <- apply( SeparatedGroupsofmealsCombs[[i]], 2, function(x)maf( tabulate( x+1) ))
}
gives these errors (I tried this many times and I'm sure I copied it entirely) :-
Error in apply(SeparatedGroupsofmealsCombs[[i...
2017 Nov 18
2
Complicated analysis for huge databases
Although the loop seems to be formulated correctly I wonder why
it gives me these errors :
-object 'i' not found
- unexpected '}' in "}"
the desired output is expected to be very large as for each dataframe in the list of dataframes I expect to see maf value for each of the 600 columns! and this is only for
for one dataframe in the list .. I have around 150-200 dataframes.. not sure how R will store these results.. but first I need the analysis to be done correctly. The final output has to be something like this :-
> mafsforeachcolumns(I,II...
2017 Nov 18
0
Complicated analysis for huge databases
...w your code", not=r did you post complete error messages. Both of these practices are strongly recommended by the Posting Guide. Please read it (again?).
--
David.
>
>
> the desired output is expected to be very large as for each dataframe in the list of dataframes I expect to see maf value for each of the 600 columns! and this is only for
>
> for one dataframe in the list .. I have around 150-200 dataframes.. not sure how R will store these results.. but first I need the analysis to be done correctly. The final output has to be something like this :-
>
>
>>...
2017 Nov 18
2
Complicated analysis for huge databases
...gleMealCode,SingleMealCode$MealsCombinations)
after investigating the structure of "SeparatedGroupsofmealsCombs" , I can see
a list of different databases, each of which represents a different Meal combinations which is great.
No, I'm struggling with the last part, how can I run the maf code for all dataframes?
when I run this code as before :-
maf <- apply(SeparatedGroupsofmealsCombs, 2, function(x)maf(tabulate(x+1)))
an error message says : dim(X) must have a positive length . I'm not sure which length
I need to specify.. any suggestions to correct this syntax ?
Regar...
2010 Nov 29
3
how to use by() ?
Hello, All!
How might one accomplish this using the by() function?
m1 is a data frame.
# populate column "m1$major_allele"
for ( i in 1:length(m1$major_allele)) {
if ( m1$Freq1[i] == m1$MAF[i]){
m1$major_allele[i] = m1$Al1[i]
}
else{
m1$major_allele[i] = m1$Al2[i]
}
}
Jim
[[alternative HTML version deleted]]
2017 Nov 18
0
Complicated analysis for huge databases
Something like the following?
AllMAFs <- list()
for (i in length(SeparatedGroupsofmealsCombs) {
AllMAFs[[i]] <- apply(SeparatedGroupsofmealsCombs[[i]], 2, function(x)maf(tabulate(x+1)))
}
(untested, of course)
Also the solution is a bit generic since I don't know what the output of maf() looks like in your case, and I d...
2017 Nov 17
0
Complicated analysis for huge databases
...2 2
>
> 5 44 66 4 1 1 0 1
>
> 6 44 66 9 2 0 1 2
>
> .
>
> .
>
> 600,000
>
>
>
> I wanted to find maf() for each column(from 4 to 600) after calculating the frequency of the 3 values (0,1,2) but this should be done group by group (i.e. group(33-55) : rows 1:3 then group(44-66) :rows 4:6 and so on).
>
>
> I can do the analysis for the entire column but not group by group like this :
>...
2017 Nov 18
0
Complicated analysis for huge databases
On 18/11/2017 4:40 PM, Allaisone 1 wrote:
>
> The loop :
>
>
> AllMAFs <- list()
>
> for (i in length(SeparatedGroupsofmealsCombs) {
> AllMAFs[[i]] <- apply( SeparatedGroupsofmealsCombs[[i]], 2, function(x)maf( tabulate( x+1) ))
> }
>
>
> gives these errors (I tried this many times and I'm sure I copied it entirely) :-
>
>...
2017 Nov 19
1
Complicated analysis for huge databases
......
..$ III : int [1:256] 1 1 2 1 1 2 1 2 1 1 ...
..$ IV : int [1:256] 2 2 2 2 2 2 2 2 2 2 ...
any suggestions to solve this issue rather than unlisting the list as this will affect
the current shape of data (i.e. being separated dataframes). I need to find maf for each column(I,II,III..600) under this dataframe (33_55) and the rest of dataframes.
________________________________
From: Duncan Murdoch <murdoch.duncan at gmail.com>
Sent: 18 November 2017 23:15:15
To: Allaisone 1; David Winsemius
Cc: R-help
Subject: Re: [R] Complicated analysis for h...
2017 Nov 17
3
Complicated analysis for huge databases
...2
4 44 66 7 0 2 2 2
5 44 66 4 1 1 0 1
6 44 66 9 2 0 1 2
.
.
600,000
I wanted to find maf() for each column(from 4 to 600) after calculating the frequency of the 3 values (0,1,2) but this should be done group by group (i.e. group(33-55) : rows 1:3 then group(44-66) :rows 4:6 and so on).
I can do the analysis for the entire column but not group by group like this :
MAF <- apply(M...
2017 Nov 09
2
Calculating frequencies of multiple values in 200 colomns
...unction but struggled with the part of writing
> the appropriate function inside it which calculate the frequency of the 3
> values. Tabulate () function is a good start but the problem is that this
> calculates the frequency of two values only per column which means that
> when I apply maf () function , maf value will be calculated using the
> frequency of these 2 values only without considering the frequency of the
> 3rd value. For example, if I have the values : 1 , 2 , 3 in each column,
> applying Tabulate () would calculate the frequency of 1 and 2 without 3 . I
> nee...
2005 Jul 15
1
2D contour predictions
...; image plots from the predictors.
Is there an easy way to do this? My current (newbie) experience with R
would suggest there is but that it's not always easy to find it!
f3 <- lm( fc ~ poly( speed, 2 ) + poly( torque, 2 ) + poly( sonl, 2 ) +
poly( p_rail, 2 ) + poly( pil_sep, 2 ) + poly( maf, 2 ) + (speed + torque +
sonl + p_rail + pil_sep + maf)^2 )
hat <- predict( f3 )
contour( sonl, maf, hat )
Error in contour.default(sonl, maf, hat) :
increasing 'x' and 'y' values expected
image(sonl, maf, hat)
Error in image.default(sonl, maf, hat) : increasing 'x...
2017 Nov 10
0
Calculating frequencies of multiple values in 200 colomns
...u for your effort Bert..,
I knew what is the problem now, the values (1,2,3) were only an example. The values I have are 0 , 1, 2 . Tabulate () function seem to ignore calculating the frequency of 0 values and this is my exact problem as the frequency of 0 values should also be calculated for the maf to be calculated correctly.
________________________________
From: Bert Gunter <bgunter.4567 at gmail.com>
Sent: 09 November 2017 23:51:35
To: Allaisone 1; R-help
Subject: Re: [R] Calculating frequencies of multiple values in 200 colomns
[[elided Hotmail spam]]
"For example, if I have...
2017 Nov 18
0
Complicated analysis for huge databases
The correct code is:
for (i in 1:length(SeparatedGroupsofmealsCombs)) { ...
I had mentioned that this is untested, but the error is so obvious ...
B.
> On Nov 18, 2017, at 4:40 PM, Allaisone 1 <allaisone1 at hotmail.com> wrote:
>
>
> The loop :
>
> AllMAFs <- list()
>
> for (i in length(SeparatedGroupsofmealsCombs) {
> AllMAFs[[i]] <- apply( SeparatedGroupsofmealsCombs[[i]], 2, function(x)maf( tabulate( x+1) ))
> }
>
> gives these errors (I tried this many times and I'm sure I copied it entirely) :-
> Error in ap...
2017 Nov 10
2
Calculating frequencies of multiple values in 200 colomns
...rt Bert..,
>
>
> I knew what is the problem now, the values (1,2,3) were only an example. The values I have are 0 , 1, 2 . Tabulate () function seem to ignore calculating the frequency of 0 values and this is my exact problem as the frequency of 0 values should also be calculated for the maf to be calculated correctly.
>
> ________________________________
> From: Bert Gunter <bgunter.4567 at gmail.com>
> Sent: 09 November 2017 23:51:35
> To: Allaisone 1; R-help
> Subject: Re: [R] Calculating frequencies of multiple values in 200 colomns
>
> [[elided Hotm...
2017 Nov 10
0
Calculating frequencies of multiple values in 200 colomns
...gt;>
>>
>> I knew what is the problem now, the values (1,2,3) were only an example. The values I have are 0 , 1, 2 . Tabulate () function seem to ignore calculating the frequency of 0 values and this is my exact problem as the frequency of 0 values should also be calculated for the maf to be calculated correctly.
>>
>> ________________________________
>> From: Bert Gunter <bgunter.4567 at gmail.com>
>> Sent: 09 November 2017 23:51:35
>> To: Allaisone 1; R-help
>> Subject: Re: [R] Calculating frequencies of multiple values in 200 colomns...
2003 Sep 17
2
CART analysis
Greetings,
Does anyone know of an R code for classification and regression tree
analysis (CART)?
Thank you
Ron
Ron Thornton BVSc, PhD, MACVSc (pathology, epidemiology)
Programme Co-ordinator, Active Surveillance
Animal Biosecurity
MAF Biosecurity Authority
P O Box 2526
Wellington, New Zealand
phone: 64-4-4744156
027 223 7582
fax: 64-4-474-4133
e-mail: ron.thornton at maf.govt.nz
http://www.maf.govt.nz
2017 Nov 09
3
Calculating frequencies of multiple values in 200 colomns
Hi All
I have a dataset of 200 columns and 1000 rows , there are 3 repeated values under each column (7,8,10). I wanted to calculate the frequency of each value under each column and then apply the function maf () given that the frequency of each value is known. I can do the analysis step by step like this :-
> Values
A B C ... 200
1 7 10 7
2 7 8 7
3 10 8 7
4 8 7 10
.
.
.
1000
For column A : I...