[adegenet-forum] Importing rowwise SNP data into adegenet [SEC=UNCLASSIFIED]

Zhian Kamvar zkamvar at gmail.com
Fri May 4 16:29:43 CEST 2018


Hi Dale,

You may have to roll your own here, but luckily for you, it shouldn't be TOO difficult. Since it looks like the sixth row contains a single value indicating the count of alternate alleles, then it's already practically in the format needed by genlight. If this is true, all you will need to do is:

1. import your data to a data frame (if read.csv is slow, you may try readr::read_csv())
2. validate and clean your data (no data are ever perfect)
3. create a genlight object by transposing your data from the sixth column onwards:
    new("genlight", t(myData[, 6:length(myData)]))
4. add the meta information (sample names, position, chromosome, locus names, etc...) to the genlight object.

Hope that helps,
Zhian

> Date: Thu, 3 May 2018 06:13:54 +0000
> From: Dale Maschette <Dale.Maschette at aad.gov.au>
> To: "adegenet-forum at lists.r-forge.r-project.org"
> 	<adegenet-forum at lists.r-forge.r-project.org>
> Subject: [adegenet-forum] Importing rowwise SNP data into adegenet
> 	[SEC=UNCLASSIFIED]
> Message-ID: <a7559880c47b4ee99ca87de5a184376b at KGS-EX01.AAD.GOV.AU>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hello All,
> I have recently been sent some SNP data in CSV and am trying to work out how to get it imported with adegenet.
> 
> The data is samples as columns and alleles as rows because the full dataset has more alleles than CSV can handle as columns. I have read the tutorials and documentation but can't seem to work out if it's possible.
> 
> I have attached an example data set, if anyone could suggest how to import it I would be very grateful.
> 
> Cheers,
> Dale
> 
> 
> ___________________________________________________________________________
> 
>    Australian Antarctic Division - Commonwealth of Australia
> IMPORTANT: This transmission is intended for the addressee only. If you are not the
> intended recipient, you are notified that use or dissemination of this communication is
> strictly prohibited by Commonwealth law. If you have received this transmission in error,
> please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
> DELETE the message.
>        Visit our web site at http://www.antarctica.gov.au/
> ___________________________________________________________________________
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20180503/cde0db10/attachment-0001.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: Example SNP.CSV
> Type: application/octet-stream
> Size: 1238 bytes
> Desc: Example SNP.CSV
> URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20180503/cde0db10/attachment-0001.obj>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20180504/c6336b77/attachment.sig>


More information about the adegenet-forum mailing list