Displaying 20 results from an estimated 3000 matches similar to: "prcomp - surprising structure"
2013 Nov 08
1
SNPRelate: Plink conversion
Hi,
Following my earlier posts about having problems performing a PCA, I have
worked out what the problem is. The problem lies within the PLINK to gds
conversion.
It seems as though the SNPs are imported as "samples" and in turn, the
samples are recognised as SNPs:
>snpsgdsSummary("chr2L")
Some values of snp.position are invalid (should be > 0)!
Some values of
2006 Apr 06
4
Reshaping genetic data from long to wide
Bottom Line Up Front: How does one reshape genetic data from long to wide?
I currently have a lot of data. About 180 individuals (some
probands/patients, some parents, rare siblings) and SNP data from 6000 loci
on each. The standard formats seem to be something along the lines of Famid,
pid, fatid, motid, affected, sex, locus1Allele1, locus1Allele2,
locus2Allele1, locus2Allele2, etc
In other
2005 Apr 05
2
cat bailing out in a for loop
Dear All,
I am trying to calculate the Hardy-Weinberg Equilibrium p-value for 42
SNPs. I am using the function HWE.exact from the package "genetics".
In order not to do a lot of coding "by hand", I have a for loop that
goes through each column (each column is one SNP) and gives me the
p.value for HWE.exact. Unfortunately some SNP have reached fixation and
HWE.exact requires a
2012 Sep 24
4
serial subtraction within a vector
Hello,
I have a vector (numeric) v-> c(a,b,c,d,e) and I want to create the vector
n->c(b-a,c-b,d-c,e-d). How can I do that?
Thank you
Hermann
[[alternative HTML version deleted]]
2013 Jan 03
5
count appearence of zero in a vector
Hello,
I wish to count how often zero (0) appears in the vector test.
test
[1] 1 1 1 1 1 1 2 1 1 1 0 2 0 1 1 0 0 0 1 1 1 0 1 2 1 1 1 1 1 1
I think of something like ...
> sapply (test, function (x) if (x==0 ...
... but actually I dont know how to carry on.
Could anybody give me a hint?
Thanks Hermann
[[alternative HTML version deleted]]
2007 Feb 05
3
RSNPper SNPinfo and making it handle a vector
If I run an analysis which generates statistical tests on many SNPs I would
naturally want to get more details on the most significant SNPs. Directly
from within R one can get the information by loading RSNPer (from
Bioconductor) and simply issuing a command SNPinfo(2073285). Unfortunately,
the command cannot handle a vector and therefore only wants to do one at a
time.
I tried the lapply and
2012 Sep 05
2
Installing lumi and hdrcde
To whom it may concern.
As I would like to analyse some array data I was keen on downloading the
lumi package that depends obviously on hdrcde that is not available for r
2.12.1. I did not find instructions to solve or circumvent this problem.
Installing hdrcde by hand did not work either. It was not detected by
> (.packages(all.available=TRUE))
if installed in the R library.
Thanks
Hermann
2013 Mar 29
3
From a vector with characters to binary information
Hello,
I would like to transform a character vector into a "binary" vector
("keine" and " " become 0 and the rest 1).
> dput (scm)
c("keine", " ", "keine", "Erstgradverw.", "Mutter", "Erstgradverw.",
"Erstgradverw.", "keine", " ", "Vater",
2012 Sep 10
3
plot: x and y chromosomes are missing
Hello,
I have a list with gene names, fold changes (=expression level) and
chromosomes.
Names fold change chromosome
hz 1.5 2
If I plot fold change versus chromosome (or vice versa):
plot (ch, fc)
I see only the chromosomes with numbers but not those with letter (x and
y). What can I do?
A second question:
How can I add a single line in that plot at a certain
2012 Mar 14
3
Needing a better solution to a lookup problem.
I have a solution (actually a few) to this problem, but none are computationally efficient enough to be useful. I'm hoping someone can enlighten me to a better solution.
I have data frame of chromosome/position pairs (along with other data for the location). For each pair I need to determine if it is with in a given data frame of ranges. I need to keep only the pairs that are within any of
2013 Nov 08
2
making chains from pairs
Hello,
having a data frame like test with pairs of characters I would like to
create chains. For instance from the pairs A/B and B/I you get the vector A
B I. It is like jumping from one pair to the next related pair. So for my
example test you should get:
A B F G H I
C F I K
D L M N O P
> test
V1 V2
1 A B
2 A F
3 A G
4 A H
5 B F
6 B I
7 C F
8 C I
9 C K
10 D L
2011 Jun 21
4
Re; Getting SNPS from PLINK to R
I a using plink on a large SNP dataset with a .map and .ped file.
I want to get some sort of file say a list of all the SNPs that plink is
saying that I have. ANyideas on how to do this?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2012 Nov 05
2
fusion of overlapping intervals
Hello,
I have start and end coordinates from different experiments (DNase
hypersensitivity data) and now I would like to combine overlapping
intervals. For instance (see my test data below) (2) 30-52 and (3) 49-101
are combined to 30-101. But 49-101 and 70-103 would not be combined because
they are on different chromosomes (chr a and chr b).
Does anybody have an idea?
Thanks
Hermann
> df
2007 Jan 21
2
efficient code. how to reduce running time?
Hi,
I am new to R.
and even though I've made my code to run and do what it needs to .
It is taking forever and I can't use it like this.
I was wondering if you could help me find ways to fix the code to run
faster.
Here are my codes..
the data set is a bunch of 0s and 1s in a data.frame.
What I am doing is this.
I pick a column and make up a new column Y with values associated with that
2010 Feb 12
1
"drop if missing" command?
This will probably seem very simple to experienced R programmers:
I am doing a snp association analysis and am at the model-fitting stage. I
am using the Stats package's "drop1" with the following code:
##geno is the dataset
## the dependent variable (casectrln) is dichotomous and coded 0,1
## rs743572_2 is one of the snps (which is coded 0,1,2 for the 3 genotypes)
2012 Jul 17
1
problem with function
Dear list,
I have a problem with defining a function (see below) to read my testfile
(see testfile). My function only returns mydata I wish to work with
attr(mydata, 'fc') as well (for labelling a plot). Principally it works if
I do not insist on this function but it would be much easer if it is
possible to return mydata AND attr(mydata, 'fc') by using a function.
1) testfile:
2012 Oct 23
1
factor or character
Hi,
The program below work very well.
(snps = c('rs621782_G', 'rs8087639_G', 'rs8094221_T', 'rs7227515_A',
'rs537202_C'))
Selec = todos[ , colnames(todos) %in% snps]
head(Selec)
But, I have a data set with 1.000 columns and I need extract 70 to use
(like snps in command above).
This 70 snps are in a file. So I create a file to extract them with
2020 Oct 08
2
2 D density plot interpretation and manipulating the data
Hello,
I have a data frame like this:
> head(SNP)
mean var sd
FQC.10090295 0.0327 0.002678 0.0517
FQC.10119363 0.0220 0.000978 0.0313
FQC.10132112 0.0275 0.002088 0.0457
FQC.10201128 0.0169 0.000289 0.0170
FQC.10208432 0.0443 0.004081 0.0639
FQC.10218466 0.0116 0.000131 0.0115
...
and I am creating plot like this:
s <- ggplot(SNP, mapping = aes(x = mean, y = var))
2011 Jul 27
1
SNP Tables
Hello,
I have indicators for the present of absent of a snps in columns and the
categorey (case control column). I would like to extract ONLY the tables and
the indices (SNPS) that give me 2 x 3 tables. Some gives 2x 2 tables when
one of the allelle is missing. The data look like the matrix snpmat below:
so the first snp should give me the following table: (aa=0, Aa=1 and AA=2)
aa
2011 Feb 03
1
bug in codetools/R CMD check?
Hi Mr Tierney,
I have noticed an error message from R 1.12.x's CMD check for a while (apparently prof Ripley completely rewrote CMD check in R 1.12+)
e.g.:
http://bioconductor.org/checkResults/2.7/bioc-LATEST/snpMatrix/lamb2-checksrc.html
----------------
* checking R code for possible problems ... NOTE
Warning: non-unique value when setting 'row.names': ?new?
Error in