Hi Steffen,

Thanks so much for your help.  I tried and it works!  This was just to
check how many SNPs had both values.  I agree, your code using c() works,
too.

Do you know how to write negation condition  or more complex expressions in
the  in the filter of the getBM command?  For example, to extract SNPs that
are not "UPSTREAM", I would write:
in the filter ..  values = c(not('UPSTREAM')), but I don't know if not()
exists.

Thanks,

Adriana

On Wed, Nov 16, 2011 at 11:56 AM, Steffen Durinck
<durinck.steffen@gene.com>wrote:

> Hi Adriana,
>
> You're query gets translated into XML and XML doesn't like ampersand's (&)
> by themselves.
> You'll have to replace & with &amp; and then it should work.
> That said, why are you putting these two consequences together in one
> value.  If you want SNPs with both these consequence types you should set
> values=c('SYNONYMOUS_CODING','NON_SYNONYMOUS_CODING')
>
> Cheers,
> Steffen
>
> On Wed, Nov 16, 2011 at 8:31 AM, Adriana Munoz <adri.embo@gmail.com>wrote:
>
>> Thanks so much for the information you sent.  It's very useful.
>>
>> I was trying to run the following code to get SNPs with 'consequence_type'
>> = "SYNONYMOUS_CODING&NON_SYNONYMOUS_CODING" , but I got error messages:
>>
>> d <- getBM(attributes = c('refsnp_id', 'consequence_type_tv'), filters =
>> c('consequence_type'), values =
>> c("SYNONYMOUS_CODING&NON_SYNONYMOUS_CODING"), mart = snpmart, uniqueRows =
>> TRUE)
>>
>> Error in getBM(attributes = c("refsnp_id", "consequence_type_tv"), filters
>> = c("consequence_type"),  :
>>  Query ERROR: caught BioMart::Exception: non-BioMart die():
>> not well-formed (invalid token) at line 1, column 357, byte 357 at
>> /usr/lib/perl5/XML/Parser.pm line 187
>>
>> d <- getBM(attributes = c('refsnp_id', 'consequence_type_tv'), filters =
>> c('consequence_type'), values =
>> list("SYNONYMOUS_CODING&NON_SYNONYMOUS_CODING"), mart = snpmart,
>> uniqueRows
>> = TRUE)
>>
>> Error in getBM(attributes = c("refsnp_id", "consequence_type_tv"), filters
>> = c("consequence_type"),  :
>>  Query ERROR: caught BioMart::Exception: non-BioMart die():
>> not well-formed (invalid token) at line 1, column 357, byte 357 at
>> /usr/lib/perl5/XML/Parser.pm line 187
>>
>> Do you know what syntax I should use for this case?
>>
>> Please let me know,
>>
>> Thanks,
>>
>> Adriana
>>
>> On Mon, Nov 14, 2011 at 12:44 PM, Valerie Obenchain <vobencha@fhcrc.org
>> >wrote:
>>
>> > On 11/14/2011 12:16 AM, Xavier de Pedro wrote:
>> >
>> >> As far as I remember, only available since R 2.14.
>> >> Cheers
>> >> Xavier
>> >>
>> >>
>> > Yes, that is correct. You'll need R-2.14 for VariantAnnotation.
>> >
>> > To find the locations of your variant with biomaRt you could try
>> > 'consequence_type_tv' as the attribute then filter on the value you want
>> > with 'consequence_type'.
>> >
>> > ## Here we select a group of snps from chr8:
>> > snps_all<- getBM(c('refsnp_id','allele','**chrom_start','chrom_strand',
>>
>> > 'consequence_type_tv', 'set_description', 'set_name'),
>> >                         filters = c('chr_name','chrom_start','**
>>
>> > chrom_end'),
>> >                         values = list(8,148350,158612),
>> >                         mart = snpmart)
>> >
>> > ## List the possible values for 'consequence_type_tv':
>> > > unique(snps_all$consequence_**type_tv)
>>
>> >  [1] "INTRONIC"
>> >  [2] "DOWNSTREAM"
>> >  [3] "SYNONYMOUS_CODING"
>> >  [4] "WITHIN_NON_CODING_GENE"
>> >  [5] "NON_SYNONYMOUS_CODING"
>> >  [6] "UPSTREAM"
>> >  [7] "WITHIN_NON_CODING_GENE&**INTRONIC&SPLICE_SITE"
>> >  [8] "WITHIN_NON_CODING_GENE&**INTRONIC"
>> >  [9] "WITHIN_NON_CODING_GENE&**SPLICE_SITE"
>> > [10] ""
>> >
>> > ## Select only nonsynonymous coding snps:
>> > snps_nsc <- getBM(c('refsnp_id','allele','**chrom_start','chrom_strand',
>>
>> > 'consequence_type_tv', 'set_description', 'set_name'),
>> >                         filters =
>> c('chr_name','chrom_start','**chrom_end',
>>
>> > 'consequence_type'),
>> >                         values = list(8,148350,158612,
>> > 'NON_SYNONYMOUS_CODING'),
>> >                         mart = snpmart)
>> >
>> > Valerie
>> >
>> >  On 11/11/11 18:16, Adriana Munoz wrote:
>> >>
>> >>> Hi Valerie,
>> >>>
>> >>> Thanks for the information.  I used the filter you mentioned and it
>> >>> works.
>> >>>  I'd like to try the Variant Annotation package that you mentioned to
>> >>> get where my variant is located (coding, non-coding, utr, etc.) , too,
>> >>> but
>> >>> I got the following error message in my Mac:
>> >>> "Warning message:
>> >>> In getDependencies(pkgs, dependencies, available, lib) :
>> >>>   package ‘VariantAnnotation’ is not available (for R version 2.13.2)"
>> >>>
>> >>> Then, I tried loading the package in Windows that has R version 2.12.,
>> >>> but
>> >>> I  the following error message:
>> >>> "Warning message:
>> >>> In getDependencies(pkgs, dependencies, available, lib) :
>> >>>   package ‘VariantAnnotation’ is not available"
>> >>>
>> >>> May I ask you if you know by chance  what version of R you were
>> running
>> >>> for
>> >>> the Variant Annotation package? or do you know of any attributes and
>> >>> filters in Biomart to get where my variant is located (coding,
>> >>> non-coding,
>> >>> utr, etc.)?
>> >>>
>> >>> Thanks,
>> >>>
>> >>> Adriana
>> >>>
>> >>> On Tue, Nov 8, 2011 at 7:37 PM, Valerie Obenchain<vobencha@fhcrc.org
>> >**
>>
>> >>> wrote:
>> >>>
>> >>>  Hi Adriana,
>> >>>>
>> >>>> I believe the filter you want is consequence_type. Take a look at the
>> >>>> filters available to you with,
>> >>>>
>> >>>>    listFilters(snpmart)
>> >>>>
>> >>>> You may also want to take a look at the VariantAnnotation package.
>> There
>> >>>> are functions
>> >>>>
>> >>>>    ?locateVariants
>> >>>>    ?predictCoding
>> >>>>
>> >>>> that can tell you where your variant is located (coding, non-coding,
>> >>>> utr,
>> >>>> etc.) and provide the amino acid coding change is for the
>> non-synonymous
>> >>>> variants. Recently SIFT and PolyPhen scores have been made available
>> >>>> through db packages
>> >>>> SIFT.Hsapiens.dbSNP132 and PolyPhen.Hsapiens.dbSNP131.
>> >>>>
>> >>>> Valerie
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> On 11/02/2011 07:33 AM, Adriana Munoz wrote:
>> >>>>
>> >>>>  Hello,
>> >>>>>>
>> >>>>>> I'd like to ask you if there is an attribute to extract SNP
>> function
>> >>>>>> information from variation datasets in biomaRt such as synonymous,
>> >>>>>> nonsynonymous, etc and
>> >>>>>>
>> >>>>>> a related filter.
>> >>>>>>
>> >>>>>> I'm using the following rcode:
>> >>>>>>
>> >>>>>>  snpmart = useMart("snp", dataset="hsapiens_snp")
>> >>>>>
>> >>>>>  Any help will be appreciated.
>> >>>>>
>> >>>>>> Thanks,
>> >>>>>>
>> >>>>>> Adriana
>> >>>>>>
>> >>>>>>
>> >>>>>>         [[alternative HTML version deleted]]
>> >>>>>>
>> >>>>>>
>> >>
>> >
>>
>>         [[alternative HTML version deleted]]
>>
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>
>

	[[alternative HTML version deleted]]

