This is a test version of Biostars. For the public version, visit https://www.biostars.org.
VCF file

Removal Sample

###junk removal

vcftools --gzvcf cohorts_combined_filtered_calls_annotated.vcf --maf 0.05 --max-missing 0.8 --min-meanDP 10 --recode --out SNP-co.vcf


####Sample removal

bcftools view --samples-file ^ /media/bioinformatician/My\ Passport/sample_id_no-RNASEq.txt SNP-co.vcf.



###chromosome extraction

vcftools --gzvcf SNP_co.vcf.gz --chr 2 --from-bp 47843908 --to-bp 47877312 --recode --out snps_filt_chr2

##conversion vcf to plink
./plink --vcf /media/bioinformatician/My\ Passport/annotated/tabix/snps_filt_chr2.vcf.gz.recode.vcf --recode HV --out /media/bioinformatician/My\ Passport/annotated/tabix/chr2
PLINK v1.90p 64-bit (6 Jun 2021)             
Logging to /media/bioinformatician/My Passport/annotated/tabix/chr2.log.
Options in effect:
  --out /media/bioinformatician/My Passport/annotated/tabix/chr2
  --recode HV
  --vcf /media/bioinformatician/My Passport/annotated/tabix/snps_filt_chr2.vcf.gz.recode.vcf

31909 MB RAM detected; reserving 15954 MB for main workspace.
Error: No variants in VCF file.
haploview vcf

Please take some time to formulate a question to go with this section of code.

Ohh Sorry. The query was deleted out of that. I have vcf file, I want to remove some samples, filter junk and extract chr2 with specific position as vcf file to visualize in haploview. I executed above commands. I am getting error. Please help me.

IMO it seems your VCF files does not contain any variants at Chr2 47843908 - 47877312. Maybe try to use grep/awk to check manually if there is any position in this region showing a variant.

The variant is already known in this region. Previously it was giving an error there is no genotype.

0 answers

No answers yet.

Log in to answer this question.