Permalink
Browse files

0.6.1 release

  • Loading branch information...
1 parent b6c085b commit 3cd09d5c637d368a65916de70c7a8ba80d936f31 @casbon casbon committed Nov 27, 2012
Showing with 19 additions and 9 deletions.
  1. +8 −8 README.rst
  2. +10 −0 docs/HISTORY.rst
  3. +1 −1 vcf/__init__.py
View
@@ -14,7 +14,7 @@ There main interface is the class: ``Reader``. It takes a file-like
object and acts as a reader::
>>> import vcf
- >>> vcf_reader = vcf.Reader(open('vcf/test/example-4.0.vcf', 'rb'))
+ >>> vcf_reader = vcf.Reader(open('vcf/test/example-4.0.vcf', 'r'))
>>> for record in vcf_reader:
... print record
Record(CHROM=20, POS=14370, REF=G, ALT=[A])
@@ -49,7 +49,7 @@ one-entry Python lists (see, e.g., ``Record.ALT``). Semicolon-delimited lists
of key=value pairs are converted to Python dictionaries, with flags being given
a ``True`` value. Integers and floats are handled exactly as you'd expect::
- >>> vcf_reader = vcf.Reader(open('vcf/test/example-4.0.vcf', 'rb'))
+ >>> vcf_reader = vcf.Reader(open('vcf/test/example-4.0.vcf', 'r'))
>>> record = vcf_reader.next()
>>> print record.POS
14370
@@ -68,7 +68,7 @@ examine properties of interest::
>>> print record.nucl_diversity, record.aaf
0.6 0.5
>>> print record.get_hets()
- [Call(sample=NA00002, GT=1|0, HQ=[51, 51], DP=8, GQ=48)]
+ [Call(sample=NA00002, CallData(GT=1|0, GQ=48, DP=8, HQ=[51, 51]))]
>>> print record.is_snp, record.is_indel, record.is_transition, record.is_deletion
True False True False
>>> print record.var_type, record.var_subtype
@@ -101,7 +101,7 @@ call data in ``data``::
>>> print call.sample
NA00001
>>> print call.data
- {'GT': '0|0', 'HQ': [58, 50], 'DP': 3, 'GQ': 49}
+ CallData(GT=0|0, GQ=49, DP=3, HQ=[58, 50])
Please note that as of release 0.4.0, attributes known to have single values (such as
``DP`` and ``GQ`` above) are returned as values. Other attributes are returned
@@ -134,7 +134,7 @@ For example::
ALT records are actually classes, so that you can interrogate them::
- >>> reader = vcf.Reader(file('vcf/test/example-4.1-bnd.vcf'))
+ >>> reader = vcf.Reader(open('vcf/test/example-4.1-bnd.vcf'))
>>> _ = reader.next(); row = reader.next()
>>> print row
Record(CHROM=1, POS=2, REF=T, ALT=[T[2:3[])
@@ -146,22 +146,22 @@ Random access is supported for files with tabix indexes. Simply call fetch for
region you are interested in::
>>> vcf_reader = vcf.Reader(filename='vcf/test/tb.vcf.gz')
- >>> for record in vcf_reader.fetch('20', 1110696, 1230237):
+ >>> for record in vcf_reader.fetch('20', 1110696, 1230237): # doctest: +SKIP
... print record
Record(CHROM=20, POS=1110696, REF=A, ALT=[G, T])
Record(CHROM=20, POS=1230237, REF=T, ALT=[None])
Or extract a single row::
- >>> print vcf_reader.fetch('20', 1110696)
+ >>> print vcf_reader.fetch('20', 1110696) # doctest: +SKIP
Record(CHROM=20, POS=1110696, REF=A, ALT=[G, T])
The ``Writer`` class provides a way of writing a VCF file. Currently, you must specify a
template ``Reader`` which provides the metadata::
>>> vcf_reader = vcf.Reader(filename='vcf/test/tb.vcf.gz')
- >>> vcf_writer = vcf.Writer(file('/dev/null', 'w'), vcf_reader)
+ >>> vcf_writer = vcf.Writer(open('/dev/null', 'w'), vcf_reader)
>>> for record in vcf_reader:
... vcf_writer.write_record(record)
View
@@ -17,6 +17,16 @@ New features should have test code sent with them.
Changes
=======
+0.6.1 Release
+-------------
+
+* Add strict whitespace mode for well formed VCFs with spaces
+ in sample names (thanks Marco)
+* Ignore blank lines in files (thanks Martijn)
+* Tweaks for handling missing data (thanks Sean)
+* bcftools tests (thanks Martijn)
+* record.FILTER is always a list
+
0.6.0 Release
-------------
View
@@ -177,4 +177,4 @@
from vcf.filters import Base as Filter
from vcf.parser import RESERVED_INFO, RESERVED_FORMAT
-VERSION = '0.6.0'
+VERSION = '0.6.1'

0 comments on commit 3cd09d5

Please sign in to comment.