Bioconductor / VariantAnnotation

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

updated the returned values for vcfFields() #13

Closed Liubuntu closed 5 years ago

Liubuntu commented 5 years ago

Hi Val,

I have modified the returned value for vcfFields()$fixed, which now returns "REF", "ALT", "QUAL", and "FILTER" instead of only specific field, by the original definition:

!> selectMethod("fixed", "VCFHeader")
 Method Definition:

 function (x)
 {
     fixed <- c("QUAL", "FILTER", "ALT", "REF")
     lst <- slot(x, "header")
     lst[names(lst) %in% fixed]
 }
 <environment: namespace:VariantAnnotation>

 Signatures:
         x
 target  "VCFHeader"
 defined "VCFHeader"

In this way, it's more consistent with the output for fixed(VCF object).

> VCF <- scanVcf(fl)
> fixed(VCF)
DataFrame with 10376 rows and 4 columns
                 REF                ALT      QUAL      FILTER
      <DNAStringSet> <DNAStringSetList> <numeric> <character>
1                  A                  G       100        PASS
2                  C                  T       100        PASS
3                  G                  A       100        PASS
4                  C                  T       100        PASS
5                  C                  T       100        PASS
...              ...                ...       ...         ...
10372              A                  G       100        PASS
10373              A                  G       100        PASS
10374              A                  G       100        PASS
10375              G                  A       100        PASS
10376              G                  C       100        PASS

Also, in the package of VCFArray, we want to include as many columns as possible from the VCF file that could be converted into VCFArray object. with the new returned values for vcfFields(...), the "REF", "QUAL", and "FILTER" columns are all able to be converted into VCFArray object.

> fl <- system.file("extdata", "chr22.vcf.gz", package="VariantAnnotation")
> hdr <- scanVcfHeader(fl)
> fixed(hdr)
DataFrameList of length 1
names(1): ALT
> vcfFields(hdr)$fixed
[1] "REF"    "ALT"    "QUAL"   "FILTER"

Let me know for any questions or suggestions. Thanks!

Best, Qian

mtmorgan commented 5 years ago

I’m not sure that I follow; you say that you updated this, but there is no commit to VariantAnnotation?

From: Qian Liu notifications@github.com Reply-To: Bioconductor/VariantAnnotation reply@reply.github.com Date: Monday, October 15, 2018 at 3:37 PM To: Bioconductor/VariantAnnotation VariantAnnotation@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Bioconductor/VariantAnnotation] updated the returned values for vcfFields() (#13)

Hi Val,

I have modified the returned value for vcfFields()$fixed, which now returns "REF", "ALT", "QUAL", and "FILTER" instead of only specific field, by the original definition:

!> selectMethod("fixed", "VCFHeader")

Method Definition:

function (x)

{

 fixed <- c("QUAL", "FILTER", "ALT", "REF")

 lst <- slot(x, "header")

 lst[names(lst) %in% fixed]

}

Signatures: x target "VCFHeader" defined "VCFHeader" In this way, it's more consistent with the output for fixed(VCF object). > VCF <- scanVcf(fl) > fixed(VCF) DataFrame with 10376 rows and 4 columns REF ALT QUAL FILTER 1 A G 100 PASS 2 C T 100 PASS 3 G A 100 PASS 4 C T 100 PASS 5 C T 100 PASS ... ... ... ... ... 10372 A G 100 PASS 10373 A G 100 PASS 10374 A G 100 PASS 10375 G A 100 PASS 10376 G C 100 PASS Also, in the package of VCFArray, we want to include as many columns as possible from the VCF file that could be converted into VCFArray object. with the new returned values for vcfFields(...), the "REF", "QUAL", and "FILTER" columns are all able to be converted into VCFArray object. > fl <- system.file("extdata", "chr22.vcf.gz", package="VariantAnnotation") > hdr <- scanVcfHeader(fl) > fixed(hdr) DataFrameList of length 1 names(1): ALT > vcfFields(hdr)$fixed [1] "REF" "ALT" "QUAL" "FILTER" Let me know for any questions or suggestions. Thanks! Best, Qian ________________________________ You can view, comment on, or merge this pull request online at: https://github.com/Bioconductor/VariantAnnotation/pull/13 Commit Summary * updated the returned values for vcfFields() File Changes * M DESCRIPTION (2) * M R/methods-VCFHeader-class.R (2) Patch Links: * https://github.com/Bioconductor/VariantAnnotation/pull/13.patch * https://github.com/Bioconductor/VariantAnnotation/pull/13.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread. This email message may contain legally privileged and/or confidential information. If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited. If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.
Liubuntu commented 5 years ago

Hi @mtmorgan ,

I didn't make commits directly to VariantAnnotation, instead I forked this fold to my account and made a pull request.

Qian

Liubuntu commented 5 years ago

Thanks @vobencha for the merge!