Bioconductor / VariantAnnotation

Annotation of Genetic Variants
https://bioconductor.org/packages/VariantAnnotation
26 stars 20 forks source link

rewriting the `vcfFields,character` to have remote VCF filepath work #18

Closed Liubuntu closed 5 years ago

Liubuntu commented 5 years ago

Hi @vobencha ,

I have just made a small change for the vcfFields,character so that vcfFields now could work for the remote vcf filepath by skipping the check of file.exists(x) e.g.,

chr22url <- "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20130502/ALL.chr22.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz"
vcfFields(chr22url)
 CharacterList of length 4
 [["fixed"]] REF ALT QUAL FILTER
 [["info"]] CIEND CIPOS CS END IMPRECISE MC ... DP AA VT EX_TARGET MULTI_ALLELIC
 [["geno"]] GT
 [["samples"]] HG00096 HG00097 HG00099 HG00100 ... NA21142 NA21143 NA21144

However, for local files, the check could still be done inside the next line of code hdr <- scanVcfHeader(x), so no need to worry about that. E.g.,

!> vcfFields("random/path")
 Error in .io_check_exists(path(con)) : file(s) do not exist:
   'random/path'

I have also synced the 2 commits from git.bioconductor.org on Nov. 19 and Nov 27 that are made by yourself.

Thanks, Qian

vobencha commented 5 years ago

Thanks @Liubuntu .