<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
There is also a function in to read bed files in the bioconductor
snpStats package. This might be a vantage point.<br>
<br>
see : search.bioconductor.jp/codes/6594<br>
<br>
Maarten Kooyman<br>
<br>
On 11/22/2013 10:04 AM, L.C. Karssen wrote:<br>
<span style="white-space: pre;">> How difficult would it be to
import .bed files [1] instead of the text<br>
> conversion? Given the binary data of both the .bed and the
GenABEL<br>
> format, wouldn't conversion be much quicker?<br>
><br>
><br>
> Lennart.<br>
><br>
> [1] <a class="moz-txt-link-freetext" href="http://pngu.mgh.harvard.edu/~purcell/plink/binary.shtml">http://pngu.mgh.harvard.edu/~purcell/plink/binary.shtml</a><br>
><br>
><br>
> On 11/22/2013 09:54 AM, Yurii Aulchenko wrote:<br>
>> Too slow, too difficult for the user, or both? :)<br>
>><br>
>> On Friday, November 22, 2013, Maksim Struchalin wrote:<br>
>><br>
>> Yes. Looks like it was a bad idea to use plink
R-plugin for<br>
>> converting plink files to *ABEL format.<br>
>> Maksim<br>
>><br>
>> On 18/11/2013 18:48, Yury Aulchenko wrote:<br>
>>> I would say that in principle
DatABEL::text2databel is the<br>
>>> "natural" way to go from text-files to
DatABEL-files<br>
>>><br>
>>> The problem is that 'regular' text input may be
allele by allele,<br>
>>> not genotype by genotype... (e.g. data are in
format "A G", or<br>
>>> "A/G", not "0" or "1" or "2"). <br>
>>><br>
>>> Y<br>
>>><br>
>>> On Nov 15, 2013, at 17:48 PM, L.C. Karssen
<a class="moz-txt-link-rfc2396E" href="mailto:lennart@karssen.org"><lennart@karssen.org></a><br>
>>> wrote:<br>
>>><br>
>>>> Hi Maksim,<br>
>>>><br>
>>>> On 15-11-13 05:53, Maksim Struchalin wrote:<br>
>>>>> An easy way to write a function for
conversion a plink format<br>
>>>>> file to a<br>
>>>>> GenABEL format file:<br>
>>>>><br>
>>>>> Use plink support of 'plug-in' functions<br>
>>>><br>
>>>> Nice find. I didn't know that existed.<br>
>>>><br>
>>>>>
(<a class="moz-txt-link-freetext" href="http://pngu.mgh.harvard.edu/~purcell/plink/rfunc.shtml">http://pngu.mgh.harvard.edu/~purcell/plink/rfunc.shtml</a><br>
>>>>>
<a class="moz-txt-link-rfc2396E" href="http://pngu.mgh.harvard.edu/%7Epurcell/plink/rfunc.shtml"><http://pngu.mgh.harvard.edu/%7Epurcell/plink/rfunc.shtml></a>).<br>
>>>>> This allows us<br>
>>>>> to write a simple R script (myscript.R)
which is called by plink<br>
>>>>> (plink<br>
>>>>> --file mydata --R myscript.R). plink
reads the file mydata<br>
>>>>> (which is in<br>
>>>>> plink format) and iteratively, SNP by
SNP, trasfer all the data to a<br>
>>>>> script myscript.R. This script contains a
function<br>
>>>>> Rplink(PHENO,GENO,CLUSTER,COVAR) which
will take every SNP (GENO<br>
>>>>> variable) and store it in a *flv format
through calling DatABEL<br>
>>>>> functions.<br>
>>>>><br>
>>>>> The whole process of conversion will look
like this:<br>
>>>>><br>
>>>>> 1) User asks GenA convert plink file to
GenA file<br>
>>>>> 2) GenA looks weather the plink is
installed. If it is not<br>
>>>>> installed,<br>
>>>>> then GenA goes to a plink site and
download/install it itself<br>
>>>>> (use an R<br>
>>>>> function "download.file" from "utils"
package)<br>
>>>>> 3) GenA run a simple line: system('plink
--file mydata --R<br>
>>>>> myscript.R')<br>
>>>>> 4) Rplink function (from myscript.R) gets
every SNP and stote it<br>
>>>>> in *flv<br>
>>>>> format. This function creates an flv file
and then open and<br>
>>>>> close it for<br>
>>>>> saving every single SNP.<br>
>>>>> 5) Work is Done<br>
>>>><br>
>>>> I'm not sure how portable it is to download
and run plink. Also, the<br>
>>>> plink page says: Currently, there is only
support for R-plugins for<br>
>>>> Linux-based and Mac OS PLINK distributions.<br>
>>>><br>
>>>>><br>
>>>>> The only issue is how fast the
converssion will run: how much<br>
>>>>> time does<br>
>>>>> it take to open a filvector file, store
one SNP and close it? I<br>
>>>>> can not<br>
>>>>> find a DatABEL R function for adding SNP
to a flv file. Is there a C<br>
>>>>> DatABEL function which can do it?<br>
>>>><br>
>>>> Wouldn't it be easier/possible to use plink
to export to text<br>
>>>> (.csv) and<br>
>>>> then use filevector's txt2fvf binary (of
course this could be<br>
>>>> done from<br>
>>>> R using system())?<br>
>>>><br>
>>>> I'm also wondering if going per SNP is really
necessary. If I<br>
>>>> understand<br>
>>>> it correctly the R script (myscript.R) has to
have a function called:<br>
>>>> Rplink <-
function(PHENO,GENO,CLUSTER,COVAR)<br>
>>>> where GENO is the matrix of genotypes. So we
could write that into a<br>
>>>> DatABEL file at once. Of course you may want
to do this per<br>
>>>> chromosome<br>
>>>> to reduce memory consumption (not sure how
plink/R would handle large<br>
>>>> data sets).<br>
>>>><br>
>><br>
>><br>
>> -- <br>
>> -----------------------------------------------------<br>
>> Yurii S. Aulchenko<br>
>><br>
>> [ LinkedIn
<a class="moz-txt-link-rfc2396E" href="http://nl.linkedin.com/in/yuriiaulchenko"><http://nl.linkedin.com/in/yuriiaulchenko></a> ] [ Twitter<br>
>> <a class="moz-txt-link-rfc2396E" href="http://twitter.com/YuriiAulchenko"><http://twitter.com/YuriiAulchenko></a> ] [ Blog<br>
>> <a class="moz-txt-link-rfc2396E" href="http://yurii-aulchenko.blogspot.nl/"><http://yurii-aulchenko.blogspot.nl/></a> ]<br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> genabel-devel mailing list<br>
>> <a class="moz-txt-link-abbreviated" href="mailto:genabel-devel@lists.r-forge.r-project.org">genabel-devel@lists.r-forge.r-project.org</a><br>
>>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel</a><br>
>><br>
><br>
><br>
><br>
> _______________________________________________<br>
> genabel-devel mailing list<br>
> <a class="moz-txt-link-abbreviated" href="mailto:genabel-devel@lists.r-forge.r-project.org">genabel-devel@lists.r-forge.r-project.org</a><br>
>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel</a></span><br>
<br>
<br>
</body>
</html>