Update chrom column of .bed/.bim/.fam files (or from a .vcf file)?

384 views
Skip to first unread message

Angela Parody

unread,
Oct 18, 2017, 5:52:48 PM10/18/17
to plink2-users
Hello everyone,

I am having problems when converting my .vcf file into other formats and I think I can solve it if I edit or update chromosome information in my vcf file (I don't have crhom information so all are set to 0). First I converted my .cvf file into .bed/.bim/.fam and I created a tab-delimited text file with two columns and no headers: First column is the new chromosomes values (integers) and second column is the ID, just as it is shown in http://zzz.bwh.harvard.edu/plink/dataman.shtml.

Then I used --update-chr like this:

plink2 --bfile myplinkfile --update-map chromupdate.txt --update-chr chromupdate.txt --make-bed --out myplinkchromupdated

I don't receive error messages but it doesn't do the work actually. This is what I got:

MacBook-Pro-de-Angela:editingCHROMcolumn angelaparodymerino$ plink2 --bfile myplinkID --update-map updatechrom.txt --update-chr updatechrom.txt --make-bed --out myplinkIDCHROM

PLINK v1.90b3 64-bit (11 Jan 2015)         https://www.cog-genomics.org/plink2

(C) 2005-2015 Shaun Purcell, Christopher Chang   GNU General Public License v3

Logging to myplinkIDCHROM.log.

8192 MB RAM detected; reserving 4096 MB for main workspace.

3412 variants loaded from .bim file.

265 people (0 males, 0 females, 265 ambiguous) loaded from .fam.

Ambiguous sex IDs written to myplinkIDCHROM.nosex .

--update-map: 0 values updated, 1 variant ID not present.

Using 1 thread (no multithreaded calculations invoked).

Before main variant filters, 265 founders and 0 nonfounders present.

Calculating allele frequencies... done.

Total genotyping rate is 0.99727.

3412 variants and 265 people pass filters and QC.

Note: No phenotypes present.

--update-chr: 0 values updated, 1 variant ID not present.

--make-bed to myplinkIDCHROM.bed + myplinkIDCHROM.bim + myplinkIDCHROM.fam ...

done.


Anyone knows what I am doing wrong?

Or anyone knows a better way to update/edit chrom column of a VCF file?


Thanks in advance,


'Angela

Christopher Chang

unread,
Oct 18, 2017, 6:13:16 PM10/18/17
to plink2-users
From the "--update-chr: 0 values updated, 1 variant ID not present" line in the log, the similar line for --update-map, and the fact that you're on a Mac, I'm guessing that the --update-map and --update-chr input files use old-style Mac linebreaks which are not recognized by plink.  If you're using BBEdit/TextWrangler, you need to open and re-save those files with "Unix (LF)" line endings.
Reply all
Reply to author
Forward
0 new messages