Results 1 to 9 of 9

Thread: Converting .vcf to .csv??

  1. #1
    Banned
    Posts
    115
    Sex
    Location
    America
    Ethnicity
    Nepali Brahmin
    Nationality
    American
    Y-DNA
    R-M198
    mtDNA
    N1a

    United States of America Nepal

    Converting .vcf to .csv??

    Hello! Another conversion question. Turns out, I got a .vcf file for raw data with a .bam and I was wondering if I can convert .vcf to a .csv for third party usage, because most support only the 23andme, Ancestry and FTDNA formats (.txt or .csv). If it ain't possible, please let me know! Thanks!

  2. #2
    Moderator
    Posts
    5,668
    Sex
    Location
    Normandy
    Ethnicity
    northwesterner
    Y-DNA
    R-BY3604-Z275
    mtDNA
    H5a1

    Normandie Netherlands Friesland Finland Orkney
    Quote Originally Posted by gyanwali View Post
    Hello! Another conversion question. Turns out, I got a .vcf file for raw data with a .bam and I was wondering if I can convert .vcf to a .csv for third party usage, because most support only the 23andme, Ancestry and FTDNA formats (.txt or .csv). If it ain't possible, please let me know! Thanks!
    Personally I use vcftools http://vcftools.sourceforge.net/index.html
    En North alom, de North venom
    En North fum naiz, en North manom

    (Roman de Rou, Wace, 1160-1170)

  3. The Following User Says Thank You to anglesqueville For This Useful Post:

     parasar (09-04-2017)

  4. #3
    Banned
    Posts
    5,173
    Sex

    The quickest way to convert a vcf to 23andMe assuming you have Linux, and your vcf already has dbSNP IDs assigned is with Plink, using the following plink command:

    ./plink --vcf example.vcf --recode 23 --chr 1-23 --out example.txt

    where . is the path to your plink executable.


    I have added --chr 1-23 so that only chromosomes 1-23 get extracted, because that is what Gedmatch needs to see in an uploaded file.

  5. The Following 4 Users Say Thank You to Kurd For This Useful Post:

     jortita (09-04-2017),  khanabadoshi (09-04-2017),  parasar (09-04-2017),  poi (01-02-2018)

  6. #4
    Banned
    Posts
    115
    Sex
    Location
    America
    Ethnicity
    Nepali Brahmin
    Nationality
    American
    Y-DNA
    R-M198
    mtDNA
    N1a

    United States of America Nepal
    Quote Originally Posted by anglesqueville View Post
    How do you use that? I tried opening it but it doesnt exactly run.

  7. #5
    Moderator
    Posts
    5,668
    Sex
    Location
    Normandy
    Ethnicity
    northwesterner
    Y-DNA
    R-BY3604-Z275
    mtDNA
    H5a1

    Normandie Netherlands Friesland Finland Orkney
    Quote Originally Posted by gyanwali View Post
    How do you use that? I tried opening it but it doesnt exactly run.
    You have to install it on Linux. Once installed it's basically the same as Plink. I use vcftools because I had sometimes problems of memory attribution with Plink that I did'nt have with vcftools. Anyway afaik nothing is possible without installing Linux, or Perl ( but I have no experience of vcftools on Perl)).

    edit: that said, vcf is nothing magical. A vcf file is basically a text file, and it's always possible to write a R script in order to convert it in any other text format. I myself wrote one some weeks ago in order to convert the data of the HLA-zone of the chrom6 from dna.land imputed datas ( for the people of the french subforum, who don't have Linux on their PC). The problem is that R is not the best way, and is unable to work with very large files: I tried myself for fun, and it becomes impossible with more then 2.000.000 snps.
    Last edited by anglesqueville; 09-05-2017 at 06:51 AM.
    En North alom, de North venom
    En North fum naiz, en North manom

    (Roman de Rou, Wace, 1160-1170)

  8. #6
    Banned
    Posts
    115
    Sex
    Location
    America
    Ethnicity
    Nepali Brahmin
    Nationality
    American
    Y-DNA
    R-M198
    mtDNA
    N1a

    United States of America Nepal
    UPDATE: I went onto sequencing.com which claimed to convert my vcf file to 23andme format .txt file, but I donít know if it did because it is 1 gb. Literally if anyone is willing to help me please PM me. I just wanted my ancestry file to be in a format that allowed me to use multiple third party formats without hassle. Probably shouldíve gotten an actual 23andme. Lol

  9. #7
    Banned
    Posts
    6,336
    Sex
    Location
    Torun
    Ethnicity
    Central 75% + 25% Mazovia
    Nationality
    Pole
    Y-DNA
    R1a > M198 > YP 1337

    Poland
    deleted
    Last edited by lukaszM; 12-06-2017 at 04:47 PM.

  10. #8
    Registered Users
    Posts
    352
    Sex
    Ethnicity
    Turkish
    Nationality
    German
    Y-DNA
    J2b2a1-L283>Z1297
    mtDNA
    HV4

    Quote Originally Posted by gyanwali View Post
    UPDATE: I went onto sequencing.com which claimed to convert my vcf file to 23andme format .txt file, but I donít know if it did because it is 1 gb. Literally if anyone is willing to help me please PM me. I just wanted my ancestry file to be in a format that allowed me to use multiple third party formats without hassle. Probably shouldíve gotten an actual 23andme. Lol
    I struggled myself a bit with this yesterday, so I wanted to share what I found out. As Kurd already mentioned, the quickest and simplest method is to use Plink. It's also available for Windows, so you don't require Linux. If you want a regular 23andme v3 file, about 20mb, you have to select only specific SNPs.

    1. Download Plink 1.9 from here: https://www.cog-genomics.org/plink/1.9/.
    2. Extract the zip file to the same folder where your VCF file is located.
    3. Download these two text files to the same folder: v3snps.txt & Xv3.txt
    4. Start the command prompt (type cmd in your windows search bar) and change the directory to where your file is located.
    Command example (just copy-paste your file directory after cd): cd your_file_directory
    5. Then type: plink --vcf your_filename.vcf.gz --extract v3snps.txt --snps-only --out 23andme.txt
    6. Open the 23andme.txt, go to the end of the document and copy-paste the content of Xv3.txt, and save.
    Done. Shouldn't take more than 5 minutes.

    Now you can use it for DIYDodecad calculators or upload it to other platforms.

  11. #9
    This is a very important conversion for Free Softaken Vcard to CSV Converter file format. Now you can easily convert vcard to CSV file format. Read this article, this will help you to convert vcf to CSV contacts file format.

Similar Threads

  1. Converting .bam format to CSV (Zipped)?
    By gyanwali in forum General
    Replies: 15
    Last Post: 08-25-2017, 04:35 PM
  2. little script ( windows + R) converting to 23&me
    By anglesqueville in forum DNA.Land
    Replies: 2
    Last Post: 08-16-2017, 11:56 AM
  3. Replies: 0
    Last Post: 08-25-2012, 01:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •