Is there a way to tell PLINK and VCFtools to sort the samples in a particular order?
1
1
Entering edit mode
7.2 years ago
beausoleilmo ▴ 580

I wonder if it's possible to output the samples names in a particular order in a VCF file and in a PLINK output (BED or PED).

I have a vector on with I'd like to sort:

 samples = c("JP3048_for", "JP3162_for", "JP3171_for", "JP3402_for", "JP343_for", 
"JP3539_for", "JP3574_for", "JP3582_for", "JP3631_for", "JP3633_for", 
"JP3636_for", "JP3640_for", "JP3642_for", "JP3652_for", "JP3657_for", 
"JP3658_for", "JP3661_for", "JP3670_for", "JP3676_for", "JP3681_for", 
"JP3683_for", "JP3687_for", "JP3695_for", "JP3697_for", "JP3738_for", 
"JP3747_for", "JP3748_for", "JP3750_for", "JP3751_for", "JP3752_for", 
"JP3753_for", "JP3754_for", "JP3755_for", "JP3774_for", "JP3790_for", 
"JP3835_for", "JP3839_for", "JP3844_for", "JP3894_for", "JP3895_for", 
"JP3913_for", "JP3914_for", "JP3922_for", "JP3923_for", "JP3924_for", 
"JP3934_for", "JP3943_for", "JP3959_for", "JP3960_for", "JP687_for", 
"SH241_for", "SH367_for", "SH520_for", "SH824_for", "SH851_for", 
"SH855_for", "JP261_ful", "JP262_ful", "JP278_ful", "JP286_ful", 
"JP290_ful", "JP293_ful", "JP294_ful", "JP295_ful", "JP303_ful", 
"JP306_ful", "JP309_ful", "JP342_ful", "JP348_ful", "JP359_ful", 
"JP393_ful", "JP411_ful", "JP475_ful", "JP506_ful", "JP512_ful", 
"JP3607_mag", "JP3626_mag", "JP3656_mag", "JP3665_mag", "JP3666_mag", 
"JP3684_mag", "JP3688_mag", "JP3690_mag", "JP3693_mag", "JP3699_mag", 
"JP3740_mag", "JP3746_mag", "JP3810_mag", "JP3565_sca", "JP3583_sca", 
"JP3587_sca", "JP3610_sca", "JP3647_sca", "JP3653_sca", "JP3655_sca", 
"JP3664_sca")

Is there a way to output a bed or a ped with a particular output order?

PLINK VCFtools sort ped bed • 3.0k views
ADD COMMENT
2
Entering edit mode
7.2 years ago

PLINK 1.9's --indiv-sort flag (https://www.cog-genomics.org/plink2/data#indiv_sort ) lets you do this. (If you want to export a VCF, though, you'll need to run PLINK twice, once with --indiv-sort + --make-bed, and then once with --recode vcf using the newly sorted fileset.)

ADD COMMENT

Login before adding your answer.

Traffic: 1569 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