Re: [galaxy-dev] patch for vcf QUAL field with missing value "." in lib/galaxy/visualization/tracks/data_providers.py

2012-08-23 Thread Jeremy Goecks
Committed in -central changeset 146d0f4c29de

Thanks much Jim,
J.

On Aug 22, 2012, at 4:09 PM, Jim Johnson wrote:

> The VCF format ( 
> http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41
>  )
> specifies "." to represent missing values.
> 
> lib/galaxy/visualization/tracks/data_providers.py  throws an float conversion 
> error when the qual field of  a vcf file has the missing value:  "."
> 
> This can be remedied with the following patch,  trackster handles the "None"  
> value when displaying the variant.
> 
> diff -r eb542e228a0f lib/galaxy/visualization/tracks/data_providers.py
> --- a/lib/galaxy/visualization/tracks/data_providers.py Wed Aug 22 14:56:49 
> 2012 -0500
> +++ b/lib/galaxy/visualization/tracks/data_providers.py Wed Aug 22 14:58:46 
> 2012 -0500
> @@ -634,7 +634,7 @@
> # TODO? VCF does not have strand, so default to 
> positive.
> "+",
> new_seq,
> -float( feature[5] ) ]
> +None if feature[5] == '.' else float( feature[5] 
> ) ]
> rval.append(payload)
> 
> return { 'data': rval, 'message': message }
> 


___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/


[galaxy-dev] patch for vcf QUAL field with missing value "." in lib/galaxy/visualization/tracks/data_providers.py

2012-08-22 Thread Jim Johnson

The VCF format ( 
http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41
 )
specifies "." to represent missing values.

lib/galaxy/visualization/tracks/data_providers.py  throws an float conversion error when 
the qual field of  a vcf file has the missing value:  "."

This can be remedied with the following patch,  trackster handles the "None"  
value when displaying the variant.

diff -r eb542e228a0f lib/galaxy/visualization/tracks/data_providers.py
--- a/lib/galaxy/visualization/tracks/data_providers.py Wed Aug 22 14:56:49 
2012 -0500
+++ b/lib/galaxy/visualization/tracks/data_providers.py Wed Aug 22 14:58:46 
2012 -0500
@@ -634,7 +634,7 @@
 # TODO? VCF does not have strand, so default to 
positive.
 "+",
 new_seq,
-float( feature[5] ) ]
+None if feature[5] == '.' else float( feature[5] ) 
]
 rval.append(payload)

 return { 'data': rval, 'message': message }

___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

 http://lists.bx.psu.edu/