File convert vcf to .bed format with plink2
0
0
Entering edit mode
3.8 years ago
safiq713 ▴ 10

Dear All

I am facing a problem to convert the VCF file to .bed file with plink2

first step OO update sex information

My Sex information file was like this, I think it is fine.

#IID    SEX
L63604  1
L63605  2

My phenotype file was like this:(definitely NOT fine)

#IID    FAMILY
L56955  eck8
L56956  eck8
L56957  eck8

My command was without Phenotypic data

plink2 --vcf ZZ_ZW_64_BiSnps.recode.vcf --update-sex SexInfo-M1-F2.txt --chr-set 28 --chr 29,30  --make-bed --out ./ZZ_ZW_64_BiSnps

My command was with Phenotypic data

plink2 --vcf ZZ_ZW_64_BiSnps.recode.vcf --update-sex SexInfo-M1-F2.txt --chr-set 28 --chr 29,30 --pheno popInfo-64.txt --make-bed --out ./ZZ_ZW_64_BiSnps

in the both cases .bed file inside like this (not worked)

UUUUUUu◊}W’W]|UUUUUUUUU’UTUUUWUUˇˇˇˇflˇgfl˝fl˝ˇflˇ˜ˇˇˇˇˇflˇw_˝fi˝ˇflˇ˜ˇU’UUUUUU˝fl˝ˇfløˆˇU’UUUUUU˝€˝ˇflˇ˜ˇUUUUUUUU˝ü˝ˇ ø˜ˇUUUUUUUU˝fl˝ˇfløˆˇUUUUUUUU˝

Second I want to convert VCf file to genpop file, but it is also shows the same.

Command was:

plink2 --vcf ZZ_ZW_64_BiSnps.recode.vcf --chr-set 28 --chr 29,30 --make-pgen -out ./pop-gen/ab

output file was like this:

l l @@6/q!!" r "" !! 1r ! !' 7s7 3""rw""!r!'!A D q1s7 "! 2 @ D 0!r1" 2!!" @D@D "D!# """ wrws#" "" 3' DD " $D !" ""7wq7r2'r''ww33s " 7 !"1 ! qG"" !" B ""! r3w" "" 6 $" C t!rw""'q!'!B@rws"r"ww3'" " $ "1 #! #' rr "7$D """ "wBD "r7r'"r "! s3! qw7D D ""wr'' ! r Dq$! ! $! $ r pt "tqw 1! "! wr" 1 "!rD! "! D " ww1'' "D! "AF@ r" !''

Definitely not worked.

How can overcome this issues. Please help

thank you

SNP vcf ddRAD • 1.3k views
ADD COMMENT
1
Entering edit mode

bcftools query -f '%CHROM\t%POS0\t%END\n' in.vcf ?

ADD REPLY
0
Entering edit mode

It looks like command worked but, I don't get it, how to define Contig, In this data set I have two contig only (Sex chromosomes 29=Z from ZZ and 30=W from ZW)

[W::vcf_parse] Contig '30' is not defined in the header. (Quick workaround: index the file with tabix.)
30  15668   15669
30  15743   15744
30  15795   15796

please help

ADD REPLY
0
Entering edit mode

Contig '30' is not defined in the header

the VCF dictionary is missing (lines starting with ##contig= )

ADD REPLY
1
Entering edit mode

Please use the formatting bar (especially the code option) to present your post better. You can use backticks for inline code (`text` becomes text), or select a chunk of text and use the highlighted button to format it as a code block. If your code has long lines with a single command, break those lines into multiple lines with proper escape sequences so they're easier to read and still run when copy-pasted. I've done it for you this time.
code_formatting

ADD REPLY

Login before adding your answer.

Traffic: 2007 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6