search for: nsnps

Displaying 7 results from an estimated 7 matches for "nsnps".

Did you mean: snps
2007 May 25
1
Speeding up resampling of rows from a large matrix
...types, each pair of haplotypes forms a genotype, and each column corresponds to a SNP. I'm using resampling to compute the null distribution of the maximum over correlated SNPs of a simple statistic. The code: #------------------------------------------------------------------------------- nSNPs <- 1000 H <- matrix(sample(0:1, 120*nSNPs , replace=T), nrow=120) G <- matrix(0, nrow=3, ncol=nSNPs) # Keep in mind that the real H is 120 x 65000 nResamples <- 3000 pair <- replicate(nResamples, sample(1:120, 2)) gen <- function(x){g <- sum(x); c(g==0, g==1, g==2)} for (i i...
2012 Aug 24
0
A question about GRAMMAR calculations in the FAM_MDR algorithm
...woutput.txt") # loading data and bringing in GenABEL format rawfile="simulation.raw" convert.snp.ped(pedfile, mapfile, rawfile) simulation.GenABEL = load.gwaa.data(phenofile = phenofil, genofile = rawfile, force=F,makemap=F,sort=F) pedigree=read.table(pedfile) pedsize=nrow(pedigree) nsnps=(ncol(pedigree)-6)/2 # minor allele count and handling missing genotype data allelic = function(k){ geno=pedigree[,(5+2*k):(6+2*k)] allelic=rowSums(geno==2)-(geno[,1]==0 & geno[,2]==0) # -1 for missing, 0,1,2 gives count of variant allele } # preparing MB-MDR SNPS = matrix(0,nrow=p...
2006 May 02
4
Repeating tdt function on thousands of variables
I am using dgc.genetics to perform TDT analysis on SNP data from a cohort of trios. I now have a file with about 6008 variables. The first few variables related to the pedigree data such as the pedigree ID the person ID etc. Thereafter each variable is a specific locus or marker. The variables are named by a pattern such as "Genotype.nnnnn" with nnnnn corresponding to a number which
2010 May 20
1
ERROR: cannot allocate vector of size?
...4 on a Linux x86_64 Redhat cluster system. When I log in, based on the specs I provide [qsub -I -X -l arch=x86_64] I am randomly assigned to a x86_64 node. I am using package GenABEL. My data (~ 650,000 SNPs, 3,000 people) loads in okay and I am able to look at the data using basic commands [nids, nsnps, names(phdata)] The problem occurs when I try to run the extended analysis: xs <- mlreg(GASurv(age,dm2)~sex,dta) ****************** 1) I have looked through the memory limits on R mem.limits() nsize vsize NA NA 2) Code: gc() used (Mb) gc trigger (Mb) max used (Mb) Ncell...
2011 Feb 03
1
bug in codetools/R CMD check?
...<- rbind(value, new) assign("srcinfo", value, entry) Apply this "fix" would result in snpMatrix's "R CMD check" churning out: --------------------- .ld.withmany: local variable ?names.components? assigned but may not be used .ld.withmany: local variable ?nsnps.for.each? assigned but may not be used misinherits: local variable ?nc.snps? assigned but may not be used misinherits: local variable ?nr.snps? assigned but may not be used qq.chisq: local variable ?lab? assigned but may not be used read.HapMap.data: local variable ?base? assigned but may not be us...
2006 Jun 05
3
Fastest way to do HWE.exact test on 100K SNP data?
...dure multiple times (~1000) permuting the cases and controls (affection status). It seems straightforward to implement it like this: ############################################# for (iter in 1:1000) { set.seed(iter) # get the permuted affection status permut <- sample(affSt) for (j in 1:nSNPs) { test <- tapply(all.geno[[j]], permut, HWE.exact) pvalControls[j] <- test$"1"$p.value pvalCases[j] <- test$"2"$p.value } } ############################################## The problem is that it takes ~1 min/iteration (on AMD Opteron 252 processor runnin...
2010 Oct 31
1
R-help Digest, Vol 92, Issue 31
...with possible haplotype configurations for each subject weighted by their posterior probabilities given genotype data. Are your markers SNPs? If so you can use a utility function from the hapassoc package to get started. For example, if your data is in a dataframe dat, with nsnp SNPs in the last nsnps columns, you could create an augmented data frame (augmented by pseudo-individuals for each subject with ambiguous phase) with library(hapassoc) ph<-pre.hapassoc(dat,nsnps) augdat<-cbind(ph$nonHaploDM,ph$haploDM) wts<-ph$wt and then use coxph with augdat as the data frme and wts as the...