Displaying 5 results from an estimated 5 matches for "locus2".
Did you mean:
locus
2018 Mar 15
3
stats 'dist' euclidean distance calculation
...am trying to calculate the pairwise genetic distance between individuals using the stats package 'dist' function, using euclidean distance. I took a subset of this dataset (3 samples x 3 loci) to test how euclidean distance is calculated:
3x3 subset used
Locus1 Locus2 Locus3
Samp1 GG <NA> GG
Samp2 AG CA GA
Samp3 AG CA GG
The euclidean distance function is defined as: sqrt(sum((x_i - y_i)^2))
My assumption was that the difference between...
2011 Feb 17
4
Find and replace all the elements in a data frame
Hi all,
I'm having a problem once again, trying to do something very simple. Consider
the following data frame:
x <- read.table(textConnection("locus1 locus2 locus3
A T C
A T NA
T C C
A T G"), header = TRUE)
closeAllConnections()
I am trying to make a new data frame, replacing "A" with "A/A", "T" with "T/T",
"G" with "G/G", and "C" with "C/C." Note also the presence o...
2009 Jan 19
1
Deleting columns where the frequency of values are too disparate
...xample, called "x" for simplicity. There are 20 different individuals ("ID"), with information about the alleles (A,T, G, C) at six different loci ("Locus1" - "Locus6") for each of these 20 individuals. At any single locus (e.g., "Locus1" or "Locus2", ... or "Locus6"), the individuals have either one allele (from the set of A,T,C,G) or one other allele (from the set of A,T,C, G). For example, at Locus1 individuals have have either the A or T allele only; at Locus2 the individuals can have either C or G only; at Locus3 the indivi...
2018 Mar 15
0
stats 'dist' euclidean distance calculation
> 3x3 subset used
> Locus1 Locus2 Locus3
> Samp1 GG <NA> GG
> Samp2 AG CA GA
> Samp3 AG CA GG
>
> The euclidean distance function is defined as: sqrt(sum((x_i - y_i)^2)) My
> assumption wa...
2007 Sep 27
2
create data frame(s) from a list with different numbers of rows
...List.elements<-cbind(c1,c2,c3,c4,c5,c6,c7,c8)
#Locus 1
L1.pairwise.columns <- matrix(3:ncol(List.elements), byrow=TRUE, ncol=2)
Loc1.gamete.counts<- apply(L1.pairwise.columns , 1, function(.row){
paste(List.elements[,1:2], List.elements[,.row])
})
#Locus2
L2.pairwise.columns <- matrix(5:ncol(List.elements), byrow=TRUE, ncol=2)
Loc2.gamete.counts<- apply(L2.pairwise.columns , 1, function(.row){
paste(List.elements[,3:4], List.elements[,.row])
})
#Locus3
L3.pairwise.columns <- matrix(7:ncol(List.ele...