knausb / vcfR

Tools to work with variant call format files
248 stars 54 forks source link

R aborted after loading vcf file #133

Closed majeedjamakhani closed 5 years ago

majeedjamakhani commented 5 years ago

Dear sir when i load vcf file it is going to R session abort and started new R session , i tried previous posts related to meta lines , but nothing is working , So i'm attaching my vcf file here

output.zip

majeedjamakhani commented 5 years ago

vcf file R code error

knausb commented 5 years ago

Hi @majeedjamakhani ,

Your file does not appear to be a valid VCF format file. Using less -NS output.vcf I see the following.

      1 ##fileformat=VCFv4.2                                                    
      2 "##FILTER=<ID=PASS,Description=""All filters passed"">"                 
      3 ##samtoolsVersion=1.9+htslib-1.9                                        
      4 ##samtoolsCommand=samtools mpileup -f refernce.fa -v -u -o output.vcf ch
      5 ##reference=file://refernce.fa                                          
      6 "##contig=<ID=chr1,length=249250621>"                                   
      7 "##contig=<ID=chr2,length=243199373>"                                   
      8 "##contig=<ID=chr3,length=198022430>" 

Note that lines 2, 6, 7, and 8 (and other subsequent lines) are surrounded by quotes. I believe that is what is causing your problem. It would be nice if vcfR handled this more elegantly, but this does not appear to be a vcfR issue. I suggest you review your workflow and try to determine where these quotes were added.

majeedjamakhani commented 5 years ago

Dear sir, When I see VCF file in excel sheet it doesn't shown " quote in 2 and other lines .

It would grateful if you could say how can I remove those " quote ?

On Mon 13 May, 2019, 8:51 PM Brian Knaus, notifications@github.com wrote:

Hi @majeedjamakhani https://github.com/majeedjamakhani ,

Your file does not appear to be a valid VCF format file. Using less -NS output.vcf I see the following.

  1 ##fileformat=VCFv4.2
  2 "##FILTER=<ID=PASS,Description=""All filters passed"">"
  3 ##samtoolsVersion=1.9+htslib-1.9
  4 ##samtoolsCommand=samtools mpileup -f refernce.fa -v -u -o output.vcf ch
  5 ##reference=file://refernce.fa
  6 "##contig=<ID=chr1,length=249250621>"
  7 "##contig=<ID=chr2,length=243199373>"
  8 "##contig=<ID=chr3,length=198022430>"

Note that lines 2, 6, 7, and 8 (and other subsequent lines) are surrounded by quotes. I believe that is what is causing your problem. It would be nice if vcfR handled this more elegantly, but this does not appear to be a vcfR issue. I suggest you review your workflow and try to determine where these quotes were added.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/knausb/vcfR/issues/133?email_source=notifications&email_token=AMB35AG7HE55JJMNWXJXFWDPVGBRNA5CNFSM4HMOFZMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVIU6BQ#issuecomment-491867910, or mute the thread https://github.com/notifications/unsubscribe-auth/AMB35ABWI4FXVALB5NPYHZ3PVGBRNANCNFSM4HMOFZMA .

knausb commented 5 years ago

Excel will probably suppress the quotes because it thinks they are protecting character strings. You also have tabs ("\t") in your meta lines, which excel will probably not show. I think you should review your workflow to determine what step(s) created an invalid VCF file. If you open your file in excel, that may be the step. But because the issues are not consistent, I'd suspect something else. Good luck!